Hello there,
I have a question that I can not answer.
I want my bathroom light to stay on for 1 hour but when I turn it off within the hour the time set should go to nil.
Now I have build a working blocky but the time goes on after i turned of the light. When i turn the light on within the first time set, say after 50 minutes, then the light turns off in 10 minutes. I want the time to set again for a hour.
Is there anyone who knows how to build this in blocky?
Thanks in advance,
Herbert
Bathroom light on for a specific amount of time
Moderator: leecollings
- kuifje
- Posts: 36
- Joined: Wednesday 25 October 2017 16:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Heemskerk
- Contact:
Bathroom light on for a specific amount of time
- Attachments
-
- Knipsel.JPG (34.91 KiB) Viewed 2707 times
-
tozzke
- Posts: 135
- Joined: Friday 02 January 2015 9:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands
- Contact:
Re: Bathroom light on for a specific amount of time
You should change to the other If-block (with the blue icon on top) and add a variable like so:

In this case the 'Else if' turns the switch off again, but turning it off with this blockly results in the cancellation of the timed off from the first 'If' statement.
The variable prevents retriggering

In this case the 'Else if' turns the switch off again, but turning it off with this blockly results in the cancellation of the timed off from the first 'If' statement.
The variable prevents retriggering
- kuifje
- Posts: 36
- Joined: Wednesday 25 October 2017 16:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Heemskerk
- Contact:
Re: Bathroom light on for a specific amount of time
Thanks tozzke i will give it a try,and it works like a charm.
greetings,
Herbert
greetings,
Herbert
- Antori91
- Posts: 136
- Joined: Sunday 12 February 2017 17:12
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10717
- Location: France
- Contact:
Re: Bathroom light on for a specific amount of time
Hello,
I've tried such Blockly in a Raspberry using the latest Domoticz release.
It doesn't work in my environment. The first time I switch ON "Hue gen2 3", I can see "TEST_badkamer" taking the value 1 (initial value 0) and then "Hue gen2 3" automatically switched OFF after 30 seconds.
BUT it seems the Else If code part is never executed when "Hue gen2 3" goes down. So the timer off cancellation never happens and because "TEST_badkamer" keeps the value 1 instead of going to zero, next time you switch ON "Hue gen2 3", it is for always.
Any idea?
I've tried such Blockly in a Raspberry using the latest Domoticz release.
It doesn't work in my environment. The first time I switch ON "Hue gen2 3", I can see "TEST_badkamer" taking the value 1 (initial value 0) and then "Hue gen2 3" automatically switched OFF after 30 seconds.
BUT it seems the Else If code part is never executed when "Hue gen2 3" goes down. So the timer off cancellation never happens and because "TEST_badkamer" keeps the value 1 instead of going to zero, next time you switch ON "Hue gen2 3", it is for always.
Any idea?
Domoticz High Availability Cluster: Synology Dz V4.10693 (Main) - Raspberry Dz V4.10717 (Backup) - Scripts Node.js
Alarm server: Raspberry - motionEye - iot_ALARM-SVR Node.js
Sensors/Actuators: ESP8266-Arduino
https://github.com/Antori91/Home_Automation
Alarm server: Raspberry - motionEye - iot_ALARM-SVR Node.js
Sensors/Actuators: ESP8266-Arduino
https://github.com/Antori91/Home_Automation
- Antori91
- Posts: 136
- Joined: Sunday 12 February 2017 17:12
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10717
- Location: France
- Contact:
Re: Bathroom light on for a specific amount of time
Sorry, in fact IT JUST WORKS FINE !!
My Blockly had a nasty error in the Else If part (see below)
My Blockly had a nasty error in the Else If part (see below)
Domoticz High Availability Cluster: Synology Dz V4.10693 (Main) - Raspberry Dz V4.10717 (Backup) - Scripts Node.js
Alarm server: Raspberry - motionEye - iot_ALARM-SVR Node.js
Sensors/Actuators: ESP8266-Arduino
https://github.com/Antori91/Home_Automation
Alarm server: Raspberry - motionEye - iot_ALARM-SVR Node.js
Sensors/Actuators: ESP8266-Arduino
https://github.com/Antori91/Home_Automation
- Antori91
- Posts: 136
- Joined: Sunday 12 February 2017 17:12
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10717
- Location: France
- Contact:
Re: Bathroom light on for a specific amount of time
Hello,
Finally, I've modified a little bit the code (remove second condition of the first if). See code below. I suggest this modification because :
- the code I've removed doesn't seem necessary to do the job,
- in case of unattended Domoticz shutdown when "Hue gen2 3" is ON, at Domoticz restart, "TEST_badkamer" will be still equal to 1. So, the next time you switch ON "Hue gen2 3", it is for ever (no timer countdown anymore) unless you manually switch OFF "Hue gen2 3".
PS: in my blockly version, ENTREE is "Hue gen2 3" and TWILIGHT is "TEST_badkamer"
Finally, I've modified a little bit the code (remove second condition of the first if). See code below. I suggest this modification because :
- the code I've removed doesn't seem necessary to do the job,
- in case of unattended Domoticz shutdown when "Hue gen2 3" is ON, at Domoticz restart, "TEST_badkamer" will be still equal to 1. So, the next time you switch ON "Hue gen2 3", it is for ever (no timer countdown anymore) unless you manually switch OFF "Hue gen2 3".
PS: in my blockly version, ENTREE is "Hue gen2 3" and TWILIGHT is "TEST_badkamer"
Domoticz High Availability Cluster: Synology Dz V4.10693 (Main) - Raspberry Dz V4.10717 (Backup) - Scripts Node.js
Alarm server: Raspberry - motionEye - iot_ALARM-SVR Node.js
Sensors/Actuators: ESP8266-Arduino
https://github.com/Antori91/Home_Automation
Alarm server: Raspberry - motionEye - iot_ALARM-SVR Node.js
Sensors/Actuators: ESP8266-Arduino
https://github.com/Antori91/Home_Automation
Who is online
Users browsing this forum: No registered users and 1 guest