Page 1 of 1
On for 240 min does not work
Posted: Sunday 30 May 2021 21:58
by Pierre1958
Hi,
I wrote a Blocky script to switch on/off my e-bike charger.
When I manual switch it on it has to be off after 4 hours (240 min)
E-bikeLader and E-bikeLader1 is a dummy switch, FietsLaders is the switch.
When I use 5 or 30 or 60 minutes it works fine but with 240 minutes blocky does not switch off after 240 minutes.
Can someone help me if I do somthings wrong or is this a bug in 2021.1 build 13.222

- Laders.jpg (161.9 KiB) Viewed 1052 times
Re: On for 240 min does not work
Posted: Monday 31 May 2021 6:36
by Treve
Try to use,
IF E-bikelader = ON
SET E-bikelader = OFF after 14400 seconds
I use this 3 hours blockly (10800 sec.) for years now.
Re: On for 240 min does not work
Posted: Monday 31 May 2021 11:51
by Pierre1958

- laders1.jpg (35.28 KiB) Viewed 1017 times
@Treve thank you for yuour responce.
I changed the blokly but after 4 1/2 hour it was still on.
I changed the name E-bikeLader to FietsLaders because E-bikeLader is a dummy and FietsLaders is the switch.
Re: On for 240 min does not work
Posted: Monday 31 May 2021 12:17
by jvdz
Doesn't it do a "set FietsLaders Off after 14400"
each minute making it never switch off? (I am not too familiar with Blockly as I prefer coding it in LUA.

)
Re: On for 240 min does not work
Posted: Monday 31 May 2021 12:39
by Treve

This is my blockly which works like a charm on Version: 4.11474.
On for 240 min does not work
Posted: Monday 31 May 2021 12:46
by Treve
This is the logfile as proof it works.
I use a Neo CoolcamZWave wall plug device with on/off switch on the device.
When push the on/off button, the switch go off after three hours.
Re: On for 240 min does not work
Posted: Monday 31 May 2021 13:48
by Dickey
jvdz wrote:Doesn't it do a "set FietsLaders Off after 14400"
each minute making it never switch off? (I am not too familiar with Blockly as I prefer coding it in LUA.

)
I think that’s the problem.
Verzonden vanaf mijn iPad met Tapatalk Pro
Re: On for 240 min does not work
Posted: Wednesday 02 June 2021 12:52
by Pierre1958
I am desperate.
I've reset domoticz to 4.10717 stable and it still doesn't work.
I can switch up to 1 hour, anything above an hour the switch just won't turn off.
I have this installed on Ubuntu Server 18.04.5, could Ubuntu play a part in this?
In 4.10717 I have only one new switch installed.
Re: On for 240 min does not work
Posted: Wednesday 02 June 2021 12:59
by jvdz
Try removing the lines that test for the Sunday time as those make this script a Time script, which means it will run each minute.
So just try the top part as shown in this post without anything else in it:
Pierre1958 wrote: ↑Monday 31 May 2021 11:51
laders1.jpg@Treve thank you for your response.
Jos
Re: On for 240 min does not work
Posted: Wednesday 02 June 2021 13:15
by Pierre1958
@ JVDZ
I already did it.
In settings the timeout sensors were set to 60 min, I set this to 300 min.
I just restarted the timer and will see if it turns off in 2 hours.

- laders2.jpg (24.88 KiB) Viewed 963 times
Re: On for 240 min does not work
Posted: Wednesday 02 June 2021 13:40
by jvdz
Pierre1958 wrote: ↑Wednesday 02 June 2021 13:15
In settings the timeout sensors were set to 60 min, I set this to 300 min.
I just restarted the timer and will see if it turns off in 2 hours.
Guess you mean to say 120 minutes as 300min = 5 hours!
You have also set the Trigger field to "Device" !?
Re: On for 240 min does not work
Posted: Wednesday 02 June 2021 16:12
by Pierre1958
Setting the senor timeout value to 300 min didn't help.

- laders3 (2).jpg (118.01 KiB) Viewed 942 times
@JVDZ
What do you mean by set the Trigger field to "Device"?
Is it a must to set a time here?

- laders4.jpg (253.31 KiB) Viewed 942 times
Whatever I do the timer works for up to 60 minutes. Within this time it switches off correctly.
If I now want to extend the switch-off time to, for example, 120 minutes, it will NOT switch off anymore.
It seems like there is a 60 minute timer block on somewhere or Domoticz restarts after 60 minutes and Blockly doesn't remember its turn on time or even Blockly stops altogether.
Re: On for 240 min does not work
Posted: Wednesday 02 June 2021 16:41
by waltervl
I think @jvdz is referring to the Blockly Triggers:
https://www.domoticz.com/wiki/Blockly#Triggers
If you want to trigger on a device change as in your case you should use the device Trigger (pull down menu in Edit Blockly Events page). Default it is set to "All" so every minute it will run and (re)set the delay.
A total different approach would be to use the Off Delay in Device Edit form:
https://www.domoticz.com/wiki/Managing_ ... _Off_Delay
The Off delay on a switch device causes a device to switch Off with a delay of the set amount of seconds after the device switched to On.
(note that is differnt than the off delay in a Scene or Group: The Off delay on switch device in a Group/Scene causes a device to switch Off with a delay of the set amount of seconds after the switchOff command is given. )
Re: On for 240 min does not work
Posted: Wednesday 02 June 2021 20:52
by Pierre1958
Sorry, I set the trigger to DEVICE but somehow blockly doesn't switch at a time setting of more than 60 minutes, less then 60 minutes it works perfect.
Why exactly 60 minutes?
Re: On for 240 min does not work
Posted: Thursday 03 June 2021 15:50
by Pierre1958
SOLVED
I have installed a clean new Ubuntu version.
The timer problem has been solved with this, even a timer setting of 4 hours now works perfectly.
Thanks to everyone who contributed