Page 1 of 1

n00b question, blind command repeat for a minute

Posted: Sunday 19 March 2017 19:49
by TheCondor
Hello, i'm not new to domoticz but full new to LUA. I worked with Blocky but now seems to be impossible to trigger an event comparing time, weekday and device state in the same time so I moved to lua. This is my first very basic script that must close one blind if it's not already closed at a specific time:

Code: Select all

time = os.date("*t")
commandArray = {}
if (time.hour == 19) and (time.min == 40) and (otherdevices['Sala Tapparella'] == 'Open') then
    commandArray['Sala Tapparella']='Set Level 100'
    print('Tapparella chiusa')
end
return commandArray
When the fibaro blind controller level is over 98% the status appear as "close" so a level of 100 is equal to "close".
The event is triggered but i can ear for the whole minute a repeating "click" from the releay and also in the log appear the repetition:

Code: Select all

 2017-03-19 19:37:59.814 EventSystem: Script event triggered: Buonanotte_Tapparelle
2017-03-19 19:37:59.806 (Sigma UZB ZWave USB) Light/Switch (Sala Tapparella)
2017-03-19 19:37:59.855 OpenZWave: Domoticz has send a Switch command!, Level: 99, NodeID: 6 (0x06)
2017-03-19 19:37:59.862 LUA: Tapparella chiusa
2017-03-19 19:37:59.863 EventSystem: Script event triggered: Buonanotte_Tapparelle
2017-03-19 19:37:59.855 (Sigma UZB ZWave USB) Light/Switch (Sala Tapparella)
2017-03-19 19:37:59.864 (Sigma UZB ZWave USB) Light/Switch (Sala Tapparella)
2017-03-19 19:37:59.904 OpenZWave: Domoticz has send a Switch command!, Level: 99, NodeID: 6 (0x06)
2017-03-19 19:37:59.911 LUA: Tapparella chiusa
2017-03-19 19:37:59.912 EventSystem: Script event triggered: Buonanotte_Tapparelle
2017-03-19 19:37:59.904 (Sigma UZB ZWave USB) Light/Switch (Sala Tapparella)
2017-03-19 19:37:59.924 (Sigma UZB ZWave USB) Light/Switch (Sala Tapparella)
2017-03-19 19:37:59.953 OpenZWave: Domoticz has send a Switch command!, Level: 99, NodeID: 6 (0x06)
2017-03-19 19:37:59.961 LUA: Tapparella chiusa
2017-03-19 19:37:59.961 EventSystem: Script event triggered: Buonanotte_Tapparelle
2017-03-19 19:37:59.953 (Sigma UZB ZWave USB) Light/Switch (Sala Tapparella)
2017-03-19 19:37:59.989 (Sigma UZB ZWave USB) Light/Switch (Sala Tapparella)
2017-03-19 19:38:00.002 OpenZWave: Domoticz has send a Switch command!, Level: 99, NodeID: 6 (0x06) 

Thanks in advance who can help!

Re: n00b question, blind command repeat for a minute

Posted: Sunday 19 March 2017 19:56
by jvdz
Change the "All" to "Time" under the LUA dropdownbox. This will ensure it only runs one time per minute on the minute.

Jos

Re: n00b question, blind command repeat for a minute

Posted: Sunday 19 March 2017 21:13
by TheCondor
jvdz wrote:Change the "All" to "Time" under the LUA dropdownbox. This will ensure it only runs one time per minute on the minute.

Jos
Great, it's working now! Thanks man!