I have a question I am trying to wrap my head around. A few years back I created a quick scene to solve the fact that just before Bed time I set my hot water heater to turn on for a few minutes in the morning to give me hot water for a morning shower.
What I did was.
created a Virtual Switch which was my just before bed trigger. I just switched it to on.
had another virtual switch (lets call it 6am switch) which always turned on by a scene at 6am.
a second schene had two triggers 1 and 2 being on which caused the hotwater to come on.
a 3rd scene which has a generic role of switching the hot water heater off always after 30mins took care of the off.
Looking at all this a few years later makes me feel like an idiot
I am sure there is a way to make it all much simpler. Certainly only one scene. Funny thing i dont understand is why the two ON virtual switches behave like AND in the scene. i.e. the scene triggers because both are on. it wont trigger if either is on. Is this logical? had i perhpas done something to the triggers? why cant a trigger be a time and a switch to make it simpler?
hey CW Kid, this is pretty much what i have now with the exception that i am looking for an “AND” condition. the AND is that the scene triggers at 6am but only turns on the immersion heater IF a virtual switch i have was set as on.
i guess this means i should use some kind of LUA in addition to what you mentioned to only run the schene if virtual swithc device is set to on? right? how?
do you understand why the current setup is behaving as an and? i.e. two virtual switches are set as triggers but neither alone triggers the scene? is this something vera does as a behavior?
on a separate note, has the combination switch created once upon a time by Futzle broken?
You would enter this LUA code in to the Scene also.
The scene will only run when the virtual switch is turned on.
local dID = 101 -- Device ID of your VirtualSwitch
local allow = true -- true runs scene if switch is on, false blocks it
local status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status",dID)
return ((status == "1") == allow)
Depending on how you created your virtual switch? You may need to change the urn to the correct one:
urn:upnp-org:serviceId:SwitchPower1
Works for me for a virtual switch I created myself in Vera.