Hi,
I'm trying to create a script in blocky where it would turn on lights in a room when the motion sensor detects motion and automaticly turn off the lights after 1 minute of no activity. I cannot seem to get it working properly. Is there anyone who can paste me an example of how this is done?
Regards,
Peter
Blocky timer automatic off after xx minutes
Moderator: leecollings
-
- Posts: 84
- Joined: Sunday 14 August 2016 13:45
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: Netherlands
- Contact:
Re: Blocky timer automatic off after xx minutes
It depends what the state of your motion sensor is in Domoticz. If motion is 'on' and no motion is 'off' you can build something like this in blockly:
Code: Select all
if motion-sensor = on
set light/group = on
else if motion-sensor = off
set light/group = off After 60 seconds
-
- Posts: 75
- Joined: Monday 17 October 2016 16:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Groningen
- Contact:
Re: Blocky timer automatic off after xx minutes
Thanks for your reactions. If i would use your idea @desertdog, would i have to set the timer-off setting of my Aeontec Multisensor to 1 second and work with dummy timers in domoticz?
-
- Posts: 81
- Joined: Thursday 10 December 2015 0:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.4834
- Location: Netherlands
- Contact:
Re: Blocky timer automatic off after xx minutes
What kind of motion sensor do you have? Because most of them have a parameter to determine after how many seconds after the motion, the motion sensor switches to off. That might also solve your problem. Then you can just turn off the light when the motion switch goes to off.
-
- Posts: 75
- Joined: Monday 17 October 2016 16:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Groningen
- Contact:
Re: Blocky timer automatic off after xx minutes
@Slinkos, you are right, mine has one too (i got the Aeontec Multisensor). However you do want to remain flexable with your settings. For example, if i would have the light switch on between 07:00-08:00 for 15 minutes and 00:00-07:00 for only a minute. It kind of hard to think of a way which works with domoticz timers and the no-motion timer of the sensor.
-
- Posts: 81
- Joined: Thursday 10 December 2015 0:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.4834
- Location: Netherlands
- Contact:
Re: Blocky timer automatic off after xx minutes
I get your point. This is how I would do it in basic:
The big drawback of this blocky is that it wil turn your lights 'Off' after 60 seconds either way, also if there is motion detected in the meantime.
If you don't want to use LUA, then we can do it in Blocky by adding a dummy switch to it:
I did not test it, but I think that works.
Code: Select all
If: Motion = 'On'
Set: Light = 'On'
Elseif: Motion = Of AND Light = 'On'
Set: Light = 'Off' AFTER 60 seconds
If you don't want to use LUA, then we can do it in Blocky by adding a dummy switch to it:
Code: Select all
If: Motion = 'On'
Set: Light = 'On'
Elseif: Motion' = Of AND Light = 'On'
Set: Dummy = 'On' AFTER 60 seconds
Elseif: Dummy = 'On' AND Motion = 'Off'
Set: Light = 'Off'
Elseif: Elseif: Dummy = 'On' AND Motion = 'On'
Set: Dummy = 'Off'
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Blocky timer automatic off after xx minutes
I use the Fibaro Motion / Multi Sensor.
All of the delay, blind time, sensitivity settings etc. are done in the Z-Wave settings for the sensor. Therefore it becomes a simple on-off device for Domoticz, and avoids the timer problems:-
Bedroom PIR = Fibaro FGMS001
Bedroom Auto = Dummy switch to set the light to manual. Use the Domoticz switch timers here for setting the automation off before going to bed etc.
Bedroom Actual = Lux Level from FGMS001
Bedroom Centre Light = Controlled light
I don't know about your unit but hopefully you can do something similar.
All works for years for me.
All of the delay, blind time, sensitivity settings etc. are done in the Z-Wave settings for the sensor. Therefore it becomes a simple on-off device for Domoticz, and avoids the timer problems:-
Bedroom PIR = Fibaro FGMS001
Bedroom Auto = Dummy switch to set the light to manual. Use the Domoticz switch timers here for setting the automation off before going to bed etc.
Bedroom Actual = Lux Level from FGMS001
Bedroom Centre Light = Controlled light
I don't know about your unit but hopefully you can do something similar.
All works for years for me.
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
Who is online
Users browsing this forum: No registered users and 1 guest