45604 outdoor module...go back to previous setting?

I’ve got my cool homeseer event working perfectly in vera. Well, almost perfectly.

I have 4 outside doors with hrds1 sensors and a virtual ‘any/all door’ device. If it is night, and any door is opened, the flood lights, front porch light, deck lights (on 45604 outdoor module), side light, and back porch light all turn on. When ALL doors are closed (via virtual any/all device), the floods and front porch lights turn off after a minute. I want the 45604 deck lights to also turn off after a minute, but this command option does not seem to work on this module. It stays on. My back and side lights are on dusk to dawn, so they receive no command.

In the off scene (triggered by ‘any door open’ turning off), I’m using the ‘turn xxx on, then after one minute go back to previous setting’ option for the floods, front, and deck lights. Floods and front are GE dimmers, the deck is the 45601 outdoor and it does not respond to this ‘go back’ command.

Should this work, or does ‘go back’ only work for light/dimmer modules?

I just tried the basic case of a scene with a single outdoor module in it:

  • Module is off -> run scene -> module comes on, off after 1 minute.
  • Module is on -> run scene -> module comes on, stays on.
    So it appears to work.

Thanks for testing, this is not working for me. I’ll try a different module and see if it’s just the one that’s not behaving.

.

The basic test I did is not working for you, or you’re just reiterating that your scene does not work?

At any rate, what happens if you modify the off scene to ‘unchanged’ and then ‘after 1 min go to previous’?

My scene (same commands as your test) works for two other lights, but not the outdoor module. I did not re-create your test scene, but I will when I get time.

Thanks for the help.

OK. I think my test had 2 points: 1) ‘Go back’ does do something with the outdoor module. 2) Entering the scene with the light on, leaves it on. Are you sure the scene has ‘go back’, not just ‘off’, for the other 2 lights?

I created a new scene, and it works like you suggested.

module is on
scene to go back to previous setting, it stays on

module is off
scene to go back to previous setting, it goes off

Then I went back to my original scene. Same basic commands except for the 2 additional lights. Since it was day when I was testing, I removed the luup…

if not ( luup.is_night() ) then
return false

end

…and all lights and the outdoor module worked properly. The module turned back off according to the ‘go back to previous’ condition.

But tonight, on the same scene, I added back the ‘is night’ luup, and the outdoor module will not turn back off even if it is originally off. The other lights turn back off fine.

I’m stumped.

Anyway, I have a scene to automatically turn off the deck lamps (triggered by an on) back off after 1.5 hours, and that might actually work better. When we’re opening the deck door at night, I don’t want the deck lights switching…the 1.5 hour delayed off is probably best.

[quote=“Intrepid, post:7, topic:168224”][…]
But tonight, on the same scene, I added back the ‘is night’ luup, and the outdoor module will not turn back off even if it is originally off. The other lights turn back off fine.[/quote]
Have you tried

if not ( luup.is_night() ) then
 return false
else
 return true
end

OR just

return (luup.is_night())

(Or if there is other code there, make sure you return true at the end.)

[quote=“Intrepid, post:1, topic:168224”]I have 4 outside doors with hrds1 sensors and a virtual ‘any/all door’ device. If it is night, and any door is opened, the flood lights, front porch light, deck lights (on 45604 outdoor module),
Should this work, or does ‘go back’ only work for light/dimmer modules?[/quote]
@Intrepid, can provide insight / Code for your “any/all” virtual device as to how your using this, thanxs in advance. Mike

Oti, thanks for taking the time to help diagnose/understand this. I’m up early, still dark, so I tried these.

[quote=“oTi@, post:8, topic:168224”]Have you tried

if not ( luup.is_night() ) then return false else return true end [/quote]

This gives the same result as my original without the ‘else return true’. other lights turn back off, outdoor module does not turn back off.

OR just [code] return (luup.is_night()) [/code] (Or if there is other code there, make sure you return true at the end.)

this does nothing, and none of the lights turn on. it aborts the scene, i guess?

[quote=“Michael_N_Blackwell, post:9, topic:168224”][quote=“Intrepid, post:1, topic:168224”]I have 4 outside doors with hrds1 sensors and a virtual ‘any/all door’ device. If it is night, and any door is opened, the flood lights, front porch light, deck lights (on 45604 outdoor module),
Should this work, or does ‘go back’ only work for light/dimmer modules?[/quote]
@Intrepid, can provide insight / Code for your “any/all” virtual device as to how your using this, thanxs in advance. Mike[/quote]

Sure! I’m ultra-new and not a programmer, but I did get this one going. I’ve had this working in homeseer for 10 years. HS allows conditionals in GUI events, but this is actually just as easy in Vera.

I have 4 exterior doors with HRDS1 sensors. If ANY door is opened (tripped), the ‘any door’ virtual device turns on. When ALL 4 doors are closed, the vrtual device turns off.

I mainly use this for night scenes where I want all exterior lighting (mainly floods) to come on when any exterior door is opened and stay on until all exterior doors are closed.

  1. Create a virtual device:
    http://forum.micasaverde.com/index.php?topic=2138.0

  2. Create 4 scenes (one for each door) called ‘door 1 open’, ‘door 2 open’, etc. Each of these are triggered by the event HRDS1 for being tripped, yes. And the command of turning ‘any door virtual’ on.

  3. Create 4 more scenes called ‘door 1 closed’, door 2 closed, etc. Each triggered by event HRDS1 tripped, no. And the luaa:

[code]
– Find the status of any doors

local Door1State= luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”, “Tripped”, 8)
local Door2State= luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”, “Tripped”, 27)
local Door3State= luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”, “Tripped”, 28)
local Door4State= luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”, “Tripped”, 29)

– Exit the scene if any door is open
if (Door1State == “1”) or (Door2State == “1”) or (Door3State == “1”) or (Door4State == “1”) then
return false
end[/code]

8, 27, 28, 29 are the devices for my HRDS1s.

I’m sure there is a more elegant way to handle this without having 8 scenes, but this was my first attempt, and it works.

Besides the lighting scene being discussed in this thread, It’s also handy to have one indicator device to see if any door is open on my iphone.

Hope that helps.

IIUC, you could get along with only two scenes.

Create scene 1 with all events from step 2.
Create scene 2 with all events from step 3.

Multiple events get OR’ed, see http://wiki.micasaverde.com/index.php/Luup_Scenes_Events#Adding_Lua_code_to_scenes_and_events.

I think I see what you’re getting at, but how do you do an OR on the EVENT that triggers the scene? The reason I have 4 open scenes (step 2) is that the triggering even is one trigger (each door open) per scene. Can I use one scene that is triggered if ANY of 4 hrds1s is tripped? how?

For step 3, it is similar. The conditional test (all doors closed) is the same in all 4 scenes, but I have 4 scenes because I don’t know how to check conditions on the initial trigger (any of 4 hrds1s closed).

I get the conditions on whether or not to continue the scene, but not to start or activate the scene.

Thanks.

Instead of creating one event per scene, use four events for your scene. If any one of the four events occur, the scene will run the commands and the Luup code. If I understand correctly, your Luup and the commands are the same for the four door open scenes, then this will work. Similarly, the same would work to make just one door closed scene.

Wow, now I see it, you can have multiple events for a scene. A month with the vera and I didn’t notice that.

I assume they are OR events?

Thanks

Yes, the events are ORed. Also, you can add multiple timers as well, which are also ORed. The scene will each time any event occurs or each time any timer fires.

Thanks for the tips. I just cut 8 scenes (4 open, 4 closed) down to 2.

The multiple events ORs is so obvious now, but I just never noticed it in the interface.

Great! (BTW, here’s the flowchart.)

You still have the different behavior for ‘go back to previous setting’, right?

Yes, the outdoor module ‘go back’ with the isnight check still does not work.

@oTi!

Im going to investigate this thread later on during the day…
On forehand… is it possible in an ON scene to have the " ( luup.is_night() )" variable trigger on an event that is hardcoded for time (On at 0600AM when night) but not the second event that is based on sunset (30min before)
Both events created within in the same scene?