Programming Question

I have a patio light that is turned on by an HSM100 motion sensor. It comes on and times out and turns off. I also have it where I can turn it on with a remote. I want it to only work when it is dark out. I know that the HSM100 light level function will not do this, so I tried to add the “After Sunset” timing to the automation. Problem is, it turns on after sunset and stays on. What setting am I missing?
I’m new to Z-Wave, but have been able to incorporate schedules, timers, and remotes into my system. I just need a little help in doing some of the combination programming.

[quote=“apsdadmcv, post:1, topic:171126”]I have a patio light that is turned on by an HSM100 motion sensor. It comes on and times out and turns off. I also have it where I can turn it on with a remote. I want it to only work when it is dark out. I know that the HSM100 light level function will not do this, so I tried to add the “After Sunset” timing to the automation. Problem is, it turns on after sunset and stays on. What setting am I missing?
I’m new to Z-Wave, but have been able to incorporate schedules, timers, and remotes into my system. I just need a little help in doing some of the combination programming.[/quote]

The easiest way would be to have the motion detector fire a scene to turn on your light. Then in the scene add in the luup section

return luup.is_night() -- Only run if at night

http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#function:_is_night” .

Next to creating the scene you need to add in a delay for switching off the light after a specified timeframe. You can manage that on the Devices, Lights view.

The light is controlled by two scenes. The Turn On scene occurs “when the sensor is tripped”. The Turn Off scene occurs “when the sensor is not tripped” and I use the time-out on the sensor to set my on time.
So if I add the “return luup.is_night()” as part of the turn on scene, I should get what I need. Right?

That will work.

You also have the option of using armed/bypassed, but that involves a little more work and scenes.
Here is a quick rundown:
Scene1 - scheduled to “arm” sensor at sunset
Scene2 - scheduled to “disarm” sensor & turn off light at sunrise
Scene3 - “On” scene with trigger “armed device is tripped”
Scene4 - “Off” scene with trigger “armed device is untripped”

The reason I added “turn off light” to scene 2…you could theoretically trip the sensor just before sunrise and then Vera disarms it. Then when the sensor untrips, it has already been disarmed and the light never turns off.

This would allow you to more easily adjust when the arming takes place, based on when it actually gets dark in your area (like 30/60 minutes after sunset, and 30/60 minutes before sunrise).