Motion triggered lights with manual override

Posted on
Fri Mar 30, 2018 10:23 am
noel1983 offline
Posts: 439
Joined: Oct 17, 2014

Re: Motion triggered lights with manual override

haavarda wrote:
Well. I have been able to find something that works for me. Takes some triggers but it works.
The basis for the logic is that a group trigger stores the triggering device to a variable. One group trigger for on, and one for off, with each own variable.
With the group trigger I also start a one minute timer. When the timer expires I compare the two different variables. If they are equal I assume I want to ignore this change. If they are different I assume this is a manual override...
This is just the basis for the manual override. Underneath is a more complex motion trigger setup.


Would you be happy share a bit more info on this?

Specifically in terms of how you’re detecting the switch press? Is it a toggle or momentary switch?

Thanks
Noel

Posted on
Fri Mar 30, 2018 10:37 am
noel1983 offline
Posts: 439
Joined: Oct 17, 2014

Re: Motion triggered lights with manual override

stuartcolman wrote:
Are you using the Fibaro Dimmer module? If so there is a setting for sending scene commands. I use that and then set a trigger action on that.


Hi Stuart,
Could you elaborate on this please?

Do you mean that when someone flicks the switch it doesn’t turn the light on directly i.e. it sends a scene command to indigo that then issues the instruction to turn the lights on?

Or is the scene command sent as well as turning the light on i.e. to give you an indication in indigo that the switch has been used?

Thanks
Noel

Posted on
Fri Mar 30, 2018 11:21 am
stuartcolman offline
Posts: 81
Joined: Nov 01, 2015
Location: Essex, United Kingdom

Re: Motion triggered lights with manual override

Noel,

I use the Scene command to change a variable. I then have a trigger which looks at when the variable changes and stops one timer (the 5 minute one) and starts another (30 minute). So this acts as a manual override.

Normally our kitchen lights come on with motion, then go off after 5 minutes of inactivity. So switching the light on manually changes the length of time the timer runs for. When the kitchen lights come on normally with motion our kickboard RGBs are blue, when you switch them on manually from the switch this changes to green to denote the change.

Hope that makes sense.

Stuart

Posted on
Fri Nov 01, 2019 11:59 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: Motion triggered lights with manual override

mundmc wrote:
I will try to be clearer on my usage:

I use motion sensors that send an “on” and “off” command. The “off” command is sent when a predefined amount of time passes (i use 30sec).

Rather than poll anything, Indigo listens for the “on” and “off” commands, and it executes a separate trigger for each command.

The trigger runs python logic as follows:

Ex.: “on” received
1) check a global variable (isDaylight, etc), do nothing if it’s daytime
2) if it’s night time, check each bulb to see if it’s already on. If on, do nothing. If off, set the lights to a specified brightness (i use odd numbers, 99, 97, 21 for late at night, etc).

Ex.: “off” received
1) check if lights are at a setpoint as described above (99, 97, 21, etc.)
2) If so, turn them off

Let me know if you need my code. I’m using Z-Wave Multisensors and Hue bulbs


Sent from my iPhone using Tapatalk


I am returning to this since I am not completely happy with my current setup. Can you share how you do this with python?

Håvard

Posted on
Mon Nov 04, 2019 2:39 pm
mundmc offline
User avatar
Posts: 702
Joined: Sep 14, 2012

Motion triggered lights with manual override

For sure- if only i could access my scripts from anywhere! I’ll look at whatever i cooked up and i’ll reread the post.

Posted on
Mon Nov 04, 2019 5:21 pm
siclark offline
Posts: 1232
Joined: Jun 13, 2017
Location: UK

Re: Motion triggered lights with manual override

mundmc wrote:
For sure- if only i could access my scripts from anywhere! I’ll look at whatever i cooked up and i’ll reread the post.


Pythonista and iCloud...

Posted on
Mon Nov 04, 2019 6:16 pm
mundmc offline
User avatar
Posts: 702
Joined: Sep 14, 2012

Re: Motion triggered lights with manual override

So since my last reply, I think I implemented Timers house-wide, with a little script. It works as follows (in pseudo-code):
T= trigger, S= script


Trigger: Movement detected
Actions:
Code: Select all
if light.isOn==“false”:
    turn light on to desired brightness based on house mode (e.g. time of day)
Restart timer


Trigger: Timer expires
Action: Turn off light

And that’s the simple way, albeit involving two triggers, one Timer device, and one script.

Using this, you assume that a) if a timer is going, then b) the light was turned on automatically.

Posted on
Mon Nov 04, 2019 6:18 pm
mundmc offline
User avatar
Posts: 702
Joined: Sep 14, 2012

Re: Motion triggered lights with manual override

siclark wrote:
mundmc wrote:
For sure- if only i could access my scripts from anywhere! I’ll look at whatever i cooked up and i’ll reread the post.


Pythonista and iCloud...


I love Pythonista, but I mean my embedded scripts, not external.

Posted on
Mon Nov 04, 2019 7:01 pm
FlyingDiver offline
User avatar
Posts: 4123
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Motion triggered lights with manual override

mundmc wrote:
siclark wrote:
mundmc wrote:
For sure- if only i could access my scripts from anywhere! I’ll look at whatever i cooked up and i’ll reread the post.


Pythonista and iCloud...


I love Pythonista, but I mean my embedded scripts, not external.


Make them all external....

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Nov 05, 2019 6:44 pm
mundmc offline
User avatar
Posts: 702
Joined: Sep 14, 2012

Re: Motion triggered lights with manual override

Intriguing best practice- will investigate this.

Who is online

Users browsing this forum: No registered users and 1 guest

cron