Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Search the Community

Showing results for tags 'debug'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • FIBARO Community
    • FIBARO Portal and Forum policy
    • FIBARO
    • Say hello!
    • Off-topics
  • FIBARO Update
    • FIBARO System Update
    • FIBARO Mobile Update
  • FIBARO Community Support
    • Scenes and Interface
    • FIBARO Products
    • FIBARO Mobile
    • FIBARO HomeKit
    • FIBARO Assistant Integrations
    • Other Devices / Third-party devices
    • Tutorials and Guides
    • Home Automation
    • Suggestions
  • FIBARO Społeczność
    • FIBARO
    • Przywitaj się!
    • Off-topic
  • FIBARO Aktualizacja
    • FIBARO System Aktualizacja
    • FIBARO Mobile Aktualizacja
  • FIBARO Wsparcie Społeczności
    • Sceny i Interfejs
    • FIBARO Urządzenia
    • FIBARO Mobilnie
    • FIBARO HomeKit
    • Integracja z Amazon Alexa i Google Home
    • Urządzenia Firm Trzecich
    • Poradniki
    • Automatyka Domowa
    • Sugestie

Categories

  • Scenes
  • Virtual Devices
  • Quick Apps
  • Icons

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook


Google+


Skype


Website URL


WhatsApp


Country


Gateway/s


Interests

Found 12 results

  1. Version 2.0

    600 downloads

    I have noticed that sometime scenes or virtual devices stuck without any visible error. Another observation, that when it happens I cannot see debug information/messages of the scene/VD. In addition the Chrome browser crushes - Ah, Snap. The idea behind this scene is to monitor debug text of all scenes and virtual devices (including all buttons, sliders and etc.) in the system. In case the length of all messages over 40.000 characters, the scene clears the buffer. Since the code already reads debug messages, it checks the last message and if there is an error message (scene or virtual device) the code sends email to administrator with an error description. Note: In case of error the messages are not deleted! The purpose of that is to keep the error for user review and debugging. Currently this scene runs every 300 sec. (5 minutes) . In order to set different time, please change sleepTime variable. (sleepTime = xxx) By default scene clears debug buffer over 40.000 characters. In order to set different default length, please change txtLen variable. (txtLen = xxxxxx) In addition you have an option to set max. debug buffer length to any size for any scene or virtual device and its buttons. To do so please update txtLenTbl table as follow: Since the system could use same ID for VD and scene, this table has two elements of arrays, VD (vdLen) and scene (sceneLen) local txtLenTbl = { vdLen = {{30000,"|618|615b12|515b3|"}, {35000,"|134|163b13|"} }, sceneLen = {{35000,"|25|"},{30000,"|17|545|"} }, } --[[ Vitual Device table elemnt: 1st param. 30000 is the desired buffer length size. 2nd param. "|618|615b12|515b3|" is the list of VD ids and button number separated by "|". For main loop use device ID only, for VD's button use button number same as in fibaro:call(VDid, "pressButton", button_num) function. For example: 618 - means Virtual device id 618 main loop. 615b12 - means Virtual device id 615 button number 12. Scene table element: 1st paraam. 35000 is the desired buffer length size. 2nd param. "|34|25|" is the list of scene ids separated by "|". You can defined as many arrays as needed. --]] The scene designed to run automatically, so please set "Max. running instances:" to 3 and "Run scene:" to automatic. . When the buffer cleared, the name of that scene/VD will be displayed at scene's debug window. This code should find all scenes and Virtual devices (including all buttons, sliders and etc.) at the system. To make sure that everything has found at your system, please press "Start" button to run second instance of scene. This "one-time" instance will be executed without loop. Means only one instance of automatic loop could be exist. After second instance execution you should see on scene's debug window printout of every scene/VD/VD button. its current buffer length size and max. allowed buffer size. Since this code runs in my system I didn't get any stuck issues and has successfully caught few unexpected errors in the scenes and VDs. I don't know if it somehow related to system freeze problem, but since this code runs I don't have system freeze or any CPU overloads. Hope it helps...
  2. Latest version of Lualibs = lualibs v1.0.1.zip Changelog for v1.0.1 (thank to @petergebruers) - fix HC user authentication (was: user:password in URL, is now: basic authentication).- fix chunked responses (was: use only chunk 1, is now: concatenate chunks). Fixes "getDevicesId".- add error checking and display in the HTTP part, to get sensible error messages. Most of the information came from the french forum which can be found here all credits go to Steven! ZeroBrane is an IDE for development in Lua code. It offers you auto completion and partial support to use the actual fibaro: option in your code too. To get started grab the latest version from https://studio.zerobrane.com/download (1.5.0 as of writing) grab your favorite flavor. It supports Mac, Windows and Linux. To use the Lua Library you have to install it, grab the lua libs (top of page) for fibaro. You need to install these files in your c:\<yourlocation>\ZeroBraneStudio\lualibs (for Mac this would be /Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/lualibs) after that a restart of the app is a good thing to do. Use this always in your code when you start testing your setup. For example: require("FibaroSceneAPI") hc2_user = "youraccount" hc2_pwd = "yourpassword" hc2_ip = "192.168.x.x" local data = fibaro:getGlobal("somevariable") print(data) Do keep in mind this is your userid/password on the box itself, do NOT use a fibaro ID since that is only the login to your remote. To change the Colors to be the same as on Fibaro (if you feel really cozy with those colors) edit your user settings at: Edit -> Preferences -> Settings: User styles = loadfile('cfg/tomorrow.lua')('TomorrowNight') stylesoutshell = styles -- apply the same scheme to Output/Console windows styles.auxwindow = styles.text -- apply text colors to auxiliary windows styles.calltip = styles.text -- apply text colors to tooltips local colors = { orange = {255,158,89}, braun = {217,191,140}, darkgray = {38,38,38}, blue = {89,158,255}, green = {188,210,121}, red = {179,94,77}, white = {255,255,255}, gray = {102,102,102} } styles.comment = {fg = colors.gray} styles.operator = {fg = colors.white} styles.number = {fg = colors.red} styles.stringtxt = {fg = colors.green} styles.keywords0 = {fg = colors.blue} styles.text = {fg = colors.braun, bg = colors.darkgray} styles.keywords3 = {fg = colors.orange} styles.keywords4 = {fg = colors.orange} styles.keywords5 = {fg = colors.orange} styles.keywords6 = {fg = colors.orange} styles.keywords7 = {fg = colors.orange} And if you want to have auto completion you have to add fibaro.lua to your ZeroBraneStudio/api/lua folder. Please note that this file is the english file and has some few additions which i didn't see or where incorrect. Looks like: To activate it, please make sure you add it. Go to Edit -> Preferences -> Settings: System Add the following string to it: api = {luadeb = {'fibaro'}} The fibaro:calculateDistance doesn't work and the sourcetrigger needs to be set manually. See below snippet for testing: __fibaroSceneSourceTrigger = {type="global", name="Pushbullet"} -- __fibaroSceneSourceTrigger = {type="global", name="Pushbullet"} -- __fibaroSceneSourceTrigger = {type="property", deviceID=6, propertyName="value"} -- __fibaroSceneSourceTrigger = {type="autostart"} -- __fibaroSceneSourceTrigger = {type="other"} print(fibaro.getSourceTrigger().type) -- global print(fibaro.getSourceTrigger().name) -- Pushbullet __fibaroSceneSourceTrigger = {type="autostart"} print(fibaro.getSourceTrigger().type) -- autostart FAQ: Q: I get the following error message: lualibs/json/decode.lua:74: bad argument #1 to 'match' (string expected, got nil) A: It cannot reach Fibaro system correctly. Please make sure you have the right userid/pwd and correct ip number. Q: I don't see any completion on my fibaro: A: Make sure you added the completion Edit -> Preferences -> Settings: System (lualib) Q: Where do i get all my values from? A: You can make use of the excellent tool from @Krikroff found in this thread to grab all the values. Q: Where is this data coming from? A: Fibaro has an api interface, you can go there via http://192.16.x.x/docs where you can try it out. Q: I click on play but it does not keep running? A: Make sure you click the double green arrow. The other one stops untill you press forward. (F6 = Go, F5 = Waits on next itteration) Q: I want to change the width of the tabs A: Go to Edit -> Preferences -> Settings: User and add "editor.tabwidth = 3" Q: Disable wordwrap for long lines A: Go to Edit -> Preferences -> Settings: User and add "editor.usewrap = false" Q: How to i debug line by line? A: See below (credits go to Fred the Phew for below screenshots & explanation) Open Zerobranstudio and display the following windows if you have not already done so insert the following code in a new blank window Zerobranstudio (we will revise multiplication ) local loop = true local i = 1 local j = 1 while loop == true do i = i + 1 j = j + 2 print ( i .. "x" .. j .. "=" .. i * j ) end To activate dynamic tag tracking, simply select the name of the variable you want to track, then right click on it to bring up a context menu. You must then select the option Add watch expression as in the image below. In our case, it must be done for the 2 variables i & j. To switch to debug mode, press the F5 key once, the window should look like this. The green cursor is positioned on the first instruction, and the Watch window displays the values of i and j (to nil at the moment which is logical) Now press the F10 key to execute the program step by step, until the first result of the multiplication is displayed, as shown below. The result of the multiplication is consistent with the values of i and j. To test now the modification on the fly of a variable, we will re-run the loop a second time by pressing the F10 key several times but without executing the print instruction, as in the image below. The value of the 2 variables has been modified by programming. To modify dynamically the value of j, click on the Remote console tab, type the line i = 20 then press the Enter key to validate the command, as in the image below. We can then see that the value of ja has been modified in the Watch window. It is now enough to click on the tab Output (suspended), and to press the key F10 to resume the execution of the program. It is now that the value of j set by hand has been dynamically taken into account by the program. Happy Coding! \o/ (feel free to make remarks so i can make it better) lualibs.zip
  3. Hi all, I would like to display a debug message with the time of sunset + an x amount of minutes. So there needs to be a calculation. I have a few scenes whose start is dependent of the month, turning lights on earlier or later. My debug message should be something like "today lights will be on at 21:15". That 21:15 is the calculated time. I have these declarations at the start of scenes: local sunsettime = fibaro:getGlobalValue("SunsetTime"); local sunsetHour = fibaro:getValue(1,'sunsetHour') But I can't figure out how to do this. Shouldn't be very complicated, but i'm not good in LUA programming with time. Hope someone can help me out.
  4. cag014

    HC-WebEye

    Version 3.0

    675 downloads

    This is JavaScript code, which displays debug information (in parallel to code development) at full screen on desktop (supports HC2 and HC3 controllers) Main purpose is to support scenes where debug information is in HTML format, like All-in-One Scene, Z-wave monitor/viewer, Z-Range analyzer . All other formats will be displayed in same format as in debugger window. Since HTML format is not supported by HC3 and debugger window is too small, it could be a helpful alternative for better view and debug your code. In many cases variables values include a lot of information (like jSON table) and it couldn't be reviewed by HC interface, this application offers to display Global variables (including QuickApp variables) on "big" screen. Follow information and features are supported: Display debug information of selected scene. (HC2) Display scenes debug information filtered by messages tags including levels (trace, warning,error). (HC3). Note: Currently all scenes print info in same debugger. Issue reported to Fibaro Group - in Progress. Start scene. (HC2/3) VD main and buttons' debug information. (HC2) Select and Press VD button. (HC2) Display current value of selected global variable. (HC2/3) QuickApp debug information. (HC3) . Note: Currently when debug info is loaded it clears debug info from HC3 debugger window. Display current value of selected QuickApp variable. (HC3) Turn On/Off (toggle method) QuickApp (HC3) Select and Press QuickApp button. (HC3) Note: Since HC3 doesn't support HTML format anymore, this is the only option to view and analyze information on upcoming All-in-One Scene and Z-wave monitor applications. After downloading the file please remove .txt extension. Currently supported browser are Firefox, Chrome or IE browsers. Recently Java Scripts are blocked by Cross-Origin Resource Sharing (CORS) mechanism, please download Disable CORS file for further instructions how to disable CORS. How it works: Before execution, open the file to define HC IP-address and HC3 transfer protocol at User Configurable Parameters // ============= USER CONFIGURABLE PARAMETERS ================ var hcip={"HC3":"192.68.0.10","HC2":"10.0.0.69"} var protocol={"HC3":"https"} On first run, login information will be required. (To keep your credentials secured, login data is not stored in file ) Application interface is very simple and self-guided. Select controller: HC2 or HC3 Select item : Scene, V Device, Variable, QuicpApp... Select item of previous selected section. Press "Reload" button to load debug information. By checking debug checkbox, API executed commands are shown. 1. If scene selected "Start" button appears. 2. If V Device selected list of available buttons shown and "Press" button appears. 3. If QuickAppDevice selected, list of available buttons shown. "Press" and "Toggle" buttons appear. By pressing "Toggle" button, QuickApp will turned ON or OFF in sequential order. 4. If Variables selected,list of available variables shown. By selecting the variable, his current value displayed.
  5. Hi, I have several problems to get my HUE lights working white my Fibaro HC2. I have made a scene for my bathroom just to turn on and off the light in combination white a motion sensor. This is working fine but the light is always changing back to the warm color after about 24 hours. So i like to set the color by a LUA command. I used the debug function for the settings (see below) --[[ %% properties %% events %% globals --]] fibaro:debug(fibaro:getValue(162, "ui.brightness.value")) fibaro:debug(fibaro:getValue(162, "ui.saturation.value")) fibaro:debug(fibaro:getValue(162, "ui.hue.value")) If i change the Brightness on the HUE app the value changed. But the saturation and HUE value doesn't change at all. Whats the problem? is it a error of the Hue bridge (square one) or anything else??? This Youtube example looks oke to me: All you input is welcome and of course i can provite more information if necessary. Thank you in advance. Michel
  6. Version 1.0.0

    48 downloads

    This function can come in handy if you want to print a json structure in readable form for debugging or inspection. It takes a json string as input and returns a HTML formatted string which can be printed in the debug window using fibaro:debug(); Example Input: "{\"api_data\":{\"status\":\"online\",\"timestamp\":\"2019-01-18-18:01:32\",\"sensor_1\":[\"value_1\":125,\"value_2\":35],\"sensor_2\":[\"value_a\":34.5,\"value_b\":45]}}" Output: { "api_data" : { "status" : "online", "timestamp" : "2019-01-18-18:01:32", "sensor_1" : [ "value_1" : 125, "value_2" : 35 ], "sensor_2" : [ "value_a" : 34.5, "value_b" : 45 ] } }
  7. This is feature request with low priority. So i will post it only on forum Better function of clipboarding from debug windows from VD debug window and LUA scene debug window. How it is now works: Succesfull clipboard: Hold left mouse button to select some debug lines and then ctrl+C for copy, while left mouse button is held down. Unsuccesfull clipboard: Hold left mouse button to select some debug lines, release mouse button and then ctrl+C for copy, while left mouse button is holded. What is requested: Hold left mouse button to select some debug lines, release mouse button and then ctrl+C for copy, while left mouse button is holded.
  8. Hi, can somebody explain me how the debug in scenes is working? Meaning, how many records HC2 will store maximum (or characters), what's the rotation mechanism, .... ? The reason I ask, In some scene's I can find a lot of history (with a lot of text). In others only some hours (where text is even very limited). Thanks.
  9. How to write a scene: what does the following: show the time of activation and show me which lights are still on in debug mode. A start of a scene could look like this: local cTime = fibaro:getGlobalValue('Time') local motionSensor = 267; -- motion sensor family lounge if ( cTime == '01:30' or cTime == '04:30' ) and tonumber(fibaro:getValue(motionSensor, "value")) == 0 and fibaro:getGlobalValue("Auto_Sleep_Mode") == "AWAKE" then fibaro:debug("Forgot lights at...."); fibaro:setGlobal("Awake_Message", "FORGOT LIGHTS"); setTimeout(function() fibaro:startScene(263); end, 5000) end But then iI would like to see what was still ON and at what time ? and maybe show this in a notification which light(s) is/are still ON Any help would be appreciated.
  10. Now Fibaro:debug outputs the time before a debug line. It could be usefull to output the date also. (and yes I know I can make this happen through lua)
  11. Hi, is there a smart way to see what scene was executed a specific time? Could I get that info trough a api or somehow?
  12. How to add a variable "BathroomSetTemp" to a scene I made a variable in varaibles panel = BathroomSetTemp write a temperature to variable "BathroomSetTemp" read the temperature from the vairaible "BathroomSetTemp" This is my code: Wondering what i am doing wrong... as in the debug window in my scene, i am getting: [DEBUG] 13:40:57: Previous Target Temperature: nil < NIL instead of a temperature reading from my variable -- Thermostat ID local FloorHeating = 262 -- Heatit Unit -- Get Temp (Target) Readings local FloorBathroomSetTemp = tonumber(fibaro:getValue(262, "value")); -- Get Variables local NewSetTemp = fibaro:getGlobalValue("BathroomSetTemp"); log("Set Target Temperature: "..FloorBathroomSetTemp); fibaro:setGlobal("BathroomSetTemp", FloorBathroomSetTemp); log("Previous Target Temperature: "..NewSetTemp); Thanks in advance
×
×
  • Create New...