[SOLVED][Motion Sensor Triggering

Posted on
Mon Apr 11, 2011 3:01 pm
mpierc offline
Posts: 19
Joined: Apr 09, 2011

[SOLVED][Motion Sensor Triggering

Hello,

I am new to Indigo and am loving the the capability it provides.

I want to setup a motion sensor for our deck lights, with the following criteria:

- Only turns on lights when dark
- Auto-off after 45 minutes
- Doesn't execute if the lights its controlling is already on
- "don't want it shutting the lights off, or ramping to 100% if we are on the deck, lights dimmed etc.."
- This is the part I don't know how to do

Additionally,
- When daylight
- Do not turn lights on
- Notify that motion has been detected

I know this is nebie stuff, but I greatly appreciate your help and guidance!


Best Regards,

Mike Pierce

Posted on
Mon Apr 11, 2011 4:52 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Motion Sensor Triggering

Welcome - I think there are a couple of wiki articles that will help you get the gist of what you're wanting to do:

http://www.perceptiveautomation.com/wik ... d=auto_off
http://www.perceptiveautomation.com/wik ... sor_basics

Basically, I think you have two triggers: "Turn On outside lights at night on motion", and "Notify on motion during the day".

The first one would defined roughly like this:

Trigger Tab
Type: Device State Changed
Device: "YOUR MOTION SENSOR NAME"
"On/Off State"
"Becomes On"

Condition Tab
"If script returns true"
In the script text box:
Code: Select all
if not (on state of device "NAME OF LIGHTS HERE") then
    if (value of variable "isDaylight" = "false") then
        return true
    end if
end if
return false


This script says if the on state of your lights is not true (meaning they're off), then if isDaylight is false (which means it's dark), then the actions should be executed, otherwise the actions won't be executed.

Actions Tab
Type: "Control Light / Appliance"
Device: "NAME OF LIGHTS HERE"
Action: "Turn On"
check "Auto-off after" and enter 45 minutes


That should do it for the first one. The second trigger is very simple:

Trigger Tab
(define exactly as above)

Condition Tab
"if daylight"

Actions Tab
(whatever you want it to do to notify)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Apr 12, 2011 1:31 pm
mpierc offline
Posts: 19
Joined: Apr 09, 2011

Re: Motion Sensor Triggering

Hello Jay,

Thank you very much, I greatly appreciate your help and guidance!

Best Regards,

Mike

Posted on
Mon May 23, 2011 10:59 am
Brandt offline
User avatar
Posts: 414
Joined: Dec 24, 2008
Location: Mission Viejo, CA

Re: Motion Sensor Triggering

What type of motion sensor is being used here?

I am confused on the difference between "device state becomes on" and "received an X10 on" when using an MS14a. I wasn't able to get my triggers to work using "device state becomes on" with the X10 motion sensors. I ended up using "received an X10 on" to turn on, and "device state becomes off" to turn off. The house/unit codes for the motion sensors and the devices they control are essentially "mapped" in my setup by turning on a device with a different house/unit code than the code that is assigned to the motion sensor. I also have it setup to "send off 5 minutes after last on command" in the motion sensors device settings.

I'm sure you can clear this up, can't wait to finally understand this.

Indigo 7 w/ Dual-Band 2413U PLM
macOS High Sierra 10.13.x
2011 iMac 3.4 GHz Intel Core i7

Posted on
Mon May 23, 2011 11:09 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Motion Sensor Triggering

There's a good wiki article that discusses motion sensors and the virtual device state that we create for them.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon May 23, 2011 11:16 am
Brandt offline
User avatar
Posts: 414
Joined: Dec 24, 2008
Location: Mission Viejo, CA

Re: Motion Sensor Triggering

jay wrote:
There's a good wiki article that discusses motion sensors and the virtual device state that we create for them.



I had read that, and I understand that it is for an OFF command and it works for me with both X10 and Insteon motion sensors.

The problem however is that I can't get devices to turn on when the trigger is "device state becomes on" for an X10 motion sensors, only when I change it to "received X10 on command". I guess I don't see the difference. When I setup the motion sensors BEFORE I had read that article my intuition was to set it to "received x10 on command".

Maybe, I'm missing a piece of the puzzle here.

Indigo 7 w/ Dual-Band 2413U PLM
macOS High Sierra 10.13.x
2011 iMac 3.4 GHz Intel Core i7

Posted on
Mon May 23, 2011 11:47 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Motion Sensor Triggering

Not sure why device state becomes on isn't working for you - it does for me using X10 (and INSTEON) motion sensors.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon May 23, 2011 12:21 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Motion Sensor Triggering

"Received X10 XYZ Command" and "Received INSTEON XYZ Command" are low level protocol specific command catchers. It is preferred, but not required, in most cases to use the higher level abstraction of the Indigo internally tracked Device State. Doing so will make it easier to swap out the Devices with different types of hardware in the future (X10 Motion Sensor <-> INSTEON Motion Sensor, etc) -- you won't have to change your Trigger Action logic at all -- just change the Device type.

Additionally, the Device State change tracking is more of a requirement for the INSTEON motion sensors. They differ in how/when they send ON and OFF commands, so a higher level abstraction is needed for them to work well.

I suspect your problem with the Device State Change ON trigger not firing is because its state is already ON. All device state change triggers only fire where there is a change from one state to another. Going from ON to ON will not trigger it. If you need to execute logic anytime the X10 motion sensor sends ON for some reason, then you will indeed have to use the lower level "Received X10 ON Command" trigger type.

Image

Posted on
Mon May 23, 2011 12:51 pm
Brandt offline
User avatar
Posts: 414
Joined: Dec 24, 2008
Location: Mission Viejo, CA

Re: Motion Sensor Triggering

Thanks Matt...that clears things up a bit

Indigo 7 w/ Dual-Band 2413U PLM
macOS High Sierra 10.13.x
2011 iMac 3.4 GHz Intel Core i7

Posted on
Mon May 23, 2011 1:24 pm
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Motion Sensor Triggering

I found it very helpful to have Indigo change the state of the X10 motion sensor
to off, after a few seconds delay, whenever it became on. Then it's always ready to be re-triggered to an on state with new motion.

Carl

Posted on
Sun Sep 29, 2013 5:40 pm
decouto offline
Posts: 20
Joined: Apr 28, 2013

Re: Motion Sensor Triggering

Hi all,

First of all, love this system. Still working on bending it to my will, but there you go... Also really appreciate the support you all give.

Had a bit of an issue getting my Insteon 2842 wireless motion sensor to work, and seemed to be related to the issue mentioned previously by Matt:

matt (support) wrote:
I suspect your problem with the Device State Change ON trigger not firing is because its state is already ON. All device state change triggers only fire where there is a change from one state to another. Going from ON to ON will not trigger it. If you need to execute logic anytime the X10 motion sensor sends ON for some reason, then you will indeed have to use the lower level "Received X10 ON Command" trigger type.


So I think I had 'manually' set the motion sensor to ON in the device panel in Indigo, and therefore future ON commands from the sensor itself were not changing the device state and therefore my triggers were not firing.

My question is: given that the motion sensor was sending OFF commands, how come the device state in Indigo did not switch back to OFF? That is, even though I manually set it to ON, eventually after I go out and walk around in front of the sensor, it sends OFF, and I expected Indigo device state to sync up with the sensor's state itself. Think I am missing something...

Posted on
Sun Sep 29, 2013 6:04 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Motion Sensor Triggering

It should. It seems likely that the motion sensor's signals aren't getting back to the PowerLinc. Are you sure you have enough dual-band devices in place so that there's a good signal from the Motion Sensor to the PowerLinc?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 12 guests