n00b question, blind command repeat for a minute

Moderator: leecollings

Post Reply
TheCondor
Posts: 78
Joined: Thursday 18 June 2015 10:32
Target OS: Linux
Domoticz version:
Contact:

n00b question, blind command repeat for a minute

Post 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!
User avatar
jvdz
Posts: 2333
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: n00b question, blind command repeat for a minute

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
TheCondor
Posts: 78
Joined: Thursday 18 June 2015 10:32
Target OS: Linux
Domoticz version:
Contact:

Re: n00b question, blind command repeat for a minute

Post 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!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest