Page 1 of 1

Blocky programming not working as expect

Posted: Friday 14 October 2022 11:01
by nitro
Hello,

Hopefully you can help me with something, I have made the following Blockly program:
Lampen Woonkamer Uit.png
Lampen Woonkamer Uit.png (17.25 KiB) Viewed 1295 times
But what happend is, that within the minut the PowerOff function is on that the lights "Lampen" will go off but jump back on.

It seems that Domoticz checked every minut the cycle or something.

The lights is sent with KAKU 433 in combination of RFXCOM.
The PowerOff is a scene in Logitech Harmony Hub when I shutdown the TV I want 5 minutes later that the light will go off and stay off.

Re: Blocky programming not working as expect

Posted: Saturday 15 October 2022 0:34
by solarboy
You cannot set 2 lamps with 1 command, it must be..

set Lamp Links = Off after 300 seconds
set Lamp Rechts = Off after 300 seconds

2 separate commands.

Re: Blocky programming not working as expect

Posted: Saturday 15 October 2022 9:47
by nitro
Thanks for the reply, do u also know what the following mean. Can't find it anywhere:

Triggers:
All
Device
Security
Time
User Variable
Trigger.png
Trigger.png (4.22 KiB) Viewed 1261 times
Time Variable:
time.png
time.png (2.08 KiB) Viewed 1261 times

Re: Blocky programming not working as expect

Posted: Saturday 15 October 2022 10:05
by jvdz
The Trigger field sets the type of "Trigger for the Event".
Device-> Trigger an event when a device changes
Time-> Trigger an event each minute
User Variable-> Trigger an event when a user variable changes
Security> Trigger an event when the security settings changes (Armed Home/Armed Away/Disarmed)
All-> When any of the above happen.

In your case it should be a Device Event as you want the act on the change of device "PowerOff".
Jos

Re: Blocky programming not working as expect

Posted: Saturday 15 October 2022 13:38
by solarboy
I started out with Blockly and I never found it required to use anything other than "All" in the trigger field although I am sure it has it's uses. I think it has it's roots in the lua (and dzvents) language underpinning the eventsystem.

Re: Blocky programming not working as expect

Posted: Saturday 15 October 2022 14:29
by nitro
Is it also possible to set the time between 22:00 and 07:00 ? or later then 23:59.
I have the feeling that Domoticz reset at 00:00 so if i stay up till 00:20 and i go to bed, the lights won't go off or is this incorrect ?

My scripting skills is horrible, but can you tell me if i do this in lua script how to write it ?

The thing i want is as follow:

When the device PowerOff is 'On' and it is between 22:00 and 03:00 in the night, turn Lamp Links and Right 'Off' after 300 seconds.

Re: Blocky programming not working as expect

Posted: Sunday 16 October 2022 22:40
by solarboy
if time > 22:00 or time < 07:00...

Re: Blocky programming not working as expect

Posted: Monday 17 October 2022 15:08
by nitro
Thx, that is working indeed :)