Welcome to Smart Home Forum by FIBARO
Search the Community
Showing results for tags 'timing'.
As I anounced already, I want to explore a simple main control scene. The main goal is to have as few scenes as possible that run continously ('autostart') to improve overview and avoid contradictions and racing conditions. Because it is meant as an exploration I will keep it very simple. At some time I will probably join either the @Sankotronic stream or the @jgab event model. They are far beyond my experience on this platform for this moment. And too complex for me as a beginner also. I already presented my time calculation model, based on integers from 0 to 2359, with two very simple functions to work with decimal hours (7+1.5 -> 830) and timesteps 759+5 -> 804. One thing I learned from the last month or so was "zwave freeze". Causes can be multiple, but one of them certainly may be poor programming practices. Therefore I want to fire fibaro calls at low speed and log them when needed. local testmode=true function deviceCall(deviceID,value1,value2) if (value2 == nil) then fibaro:call(deviceID,value1); log(fibaro:getName(deviceID)..': '..value1) else fibaro:call(deviceID,value1,value2); log(fibaro:getName(deviceID)..': '..value1..'='..value2) end fibaro:sleep(1000) end function switchOff(deviceID) deviceCall(deviceID, "turnOff"); end function log(AMessage) if testmode then fibaro:debug(AMessage) end end The deviceCall function can handle most of the commands at a beginners level anyway, so fine for now. A built-in sleep certifies a low pace. It checks testmode on the log funtion. Without testmode no logging.
Hi sorry for the stupid title, I dont have any better right now tl/dr: do a trigger keep rerunning/starting a new instance of a scene? long version: I want to create a scene where my bathroom fan turns on if humidity sensor is over 70%, then turn off. If I do this: if ( tonumber(fibaro:getValue(298, "value")) > 70 ) then fibaro:call(413, "turnOn"); fibaro:debug('WC humidity over 70. Turning fan on.'); fibaro:sleep(120000); fibaro:call(413, "turnOff"); fibaro:debug('WC humidity under 70. Turning fan off.'); end will the HC2 check for the humidity every second or so? and if yes, will it start a new instance of the same scene, or somehow lenghten this? or shall I do this? if ( tonumber(fibaro:getValue(298, "value")) > 70 ) then fibaro:call(413, "turnOn"); fibaro:debug('WC humidity over 70. Turning fan on.'); else fibaro:call(413, "turnOff"); fibaro:debug('WC humidity under 70. Turning fan off.'); end but in this case, will the fan turn off is the humidity falls under 70? I cannot find a good description of triggers, and it seems so important... thanks in advance
Hello all! Worst thing with developing for Fibaro is lack of any knowledge database. Please, don't jump immediately and mention e-learning, manuals or developer site because there you can find only some basic information, usually not complete! So, for me, this forum is still the best knowledge base that can be found for Fibaro thanks to experienced members that have no problem with sharing knowledge. I believe I don't need to mention them by name because we all know who they are! I thank them thousand times!!!! So, I just don't like to use fibaro:sleep any more since ti is not flexible and it doesn't count time that is needed for code to be executed. Due to not precise repeating of Main scene FTBE time for wake up at 06:20h was missed this morning and Angelina didn't wake us up: To continue developing next version of Main scene FTBE and all other software I just need HELP to find out if there is a better way to control code execution to avoid such mishits in future. QUESTIONS 1) What is %% timer used for in scene header and how to use this feature? 2) How to achieve that code is repeated at exactly same time intervals regardless of amount of code executed? Any advice in this matter is highly needed and appreciated! Yours truly Sankotronic