Hello,
I make use from blockly to make events. I want to set off the heathing in the house, when the door is open for more then 60 seconds. There is not a sollution in blockly to do that ? No the heather gets of when I open the door en gets on when I close it. That works, but it is not so charming.
Is it not possible to make a block, that counts down in seconds. When counter=0 and that you can set the value for the counter in seconds.
Greetings,
Peter
Timer block in "Blockly"
Moderators: leecollings, remb0
-
- Posts: 113
- Joined: Friday 08 January 2016 12:32
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Timer block in "Blockly"
Hi.
The best way to do this I beleive would be to use Lua or bash script. I'm no familiour enough with them to help, but you could probably find a work around using block and a. Couple of virtual switches. Something like this;
You have a switch "door" which is either on or off depending if the door is open or closed.
Create another virtual switch " counter".
Blocky 1:
If :door=on
Set: counter on after 60 seconds.
Then the second blocky will check if the door is still open after 60 seconds.
Blocky 2
If: door =on And. Counter = on
Set: heating on.
Set: counter off.
Else if : door = off And counter = on
Set counter off.
This would not account for if the door was closed, and then open again inside the 60 seconds though.
Just if the door is open, and is then also open 60 seconds later. May help though
The best way to do this I beleive would be to use Lua or bash script. I'm no familiour enough with them to help, but you could probably find a work around using block and a. Couple of virtual switches. Something like this;
You have a switch "door" which is either on or off depending if the door is open or closed.
Create another virtual switch " counter".
Blocky 1:
If :door=on
Set: counter on after 60 seconds.
Then the second blocky will check if the door is still open after 60 seconds.
Blocky 2
If: door =on And. Counter = on
Set: heating on.
Set: counter off.
Else if : door = off And counter = on
Set counter off.
This would not account for if the door was closed, and then open again inside the 60 seconds though.
Just if the door is open, and is then also open 60 seconds later. May help though

running domoticz 3.4834 on rpi2, with
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.
Next: harmony hub.
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.
Next: harmony hub.
-
- Posts: 73
- Joined: Sunday 06 March 2016 23:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: Schaijk
- Contact:
Re: Timer block in "Blockly"
Hi,
Thanks for your reply. Your solution works fine !! I'm going to use this. When the door opens en closes, Then still the virtual switch "counter" still gets on and at the same time off. That results only in a cosmetic problem.
Greetings,
Peter
Thanks for your reply. Your solution works fine !! I'm going to use this. When the door opens en closes, Then still the virtual switch "counter" still gets on and at the same time off. That results only in a cosmetic problem.

Greetings,
Peter
-
- Posts: 113
- Joined: Friday 08 January 2016 12:32
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Timer block in "Blockly"
You could try an additional blocky:
If door is closed,
Set timer off.
Or possibly a Json command in the off action of the door switch.
This may over ride the initial 60 second timer??
I'm not sure if this would work though am not home to test.
If door is closed,
Set timer off.
Or possibly a Json command in the off action of the door switch.
This may over ride the initial 60 second timer??
I'm not sure if this would work though am not home to test.
running domoticz 3.4834 on rpi2, with
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.
Next: harmony hub.
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.
Next: harmony hub.
- sisaenkov
- Posts: 50
- Joined: Friday 27 May 2016 7:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8
- Location: Moscow, Russia
- Contact:
Re: Timer block in "Blockly"
Unfortunatelly, additional timer device will lead to high memory usage every time it was triggered. More devices - more memory consumption. As a result - Domoticz freezes.
P.S.
This issue was resolved in latest release.
P.S.
This issue was resolved in latest release.
Who is online
Users browsing this forum: No registered users and 1 guest