I have a Vera2, and a long time ago I set it up so that I could have an “Away” switch that would hold the temperature in the house to a certain temperature while we were on vacation. It worked well, but over time I forgot how to work it and sometimes I couldn’t get it to “hold”, and other times I couldn’t get it to go back to “normal”. In frustration, I deleted all the virtual switches and Luup code that were part of the configuration.
So now, my system is working fine with my normal daily schedule, but I can no longer go “Away”. I’ve tried searching the forums for instructions on how to set up an “Away” or “Vacation” mode, but I can’t seem to find anything.
From what I read, UI7 has this functionality baked in, but also seems to have tons of bugs and problems as well, so I don’t want go that route unless I have to.
Any help would be greatly appreciated!
David
The usual approach (pre-UI7) is to install the VirtualSwitch or MultiSwitch plugin to indicate the Home or Away state. This state is used by scenes, Lua code or PLEG logic to change how devices are controlled.
How you do this is dependent on the way you currently control your house temperature. If it is already controlled by scenes or PLEG, it should be simple to insert additional logic based on the Home/Away virtual switch.
We can probably help more if you tell us what type of thermostat you use and how the temperature setpoint is controlled.
Thanks RexBeckett!
I have Trane Remote Energy Management Thermostats (TZEMT043AB32MAA). I have several Schedules that change the temperature depending on the day of the week and the time (example: M-F, 7AM, change temp to 70 degrees on thermostats X, Y and Z."
Each thermostat also has a Energy Saving Mode temperature stored on it.
I’d love to use the simplest solution so that I can ensure that I set it properly when I leave for vacation and again when I return.
Warmly,
David
If you are currently using Vera scenes triggered by schedules, the simplest approach would be to have two sets of scenes - for Home and Away. In each scene you can insert Lua code that checks the state of your Home/Away virtual switch and enables or blocks the scene.
The mechanism is explained in Conditional Scene Execution and the second post in that thread has example code for VirtualSwitch and MultiSwitch.
Thanks again, RexBeckett. I really appreciate you taking the time to help. I have a few follow-up questions:
-
Can you point me in the right direction to create a Virtual Switch? I tried searching, but can’t find any reference to actually creating one.
-
I’d like to see if I understand how to use the virtual switch. Let’s say I create a Virtual Switch called “At Home”, which I keep “On” when we are NOT on Vacation (i.e. when we want the normal temperature scenes to run). Assuming a device ID of 32, I would paste this code into the LUUP tab of each scene.
local dID = 32 -- 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:VSwitch1","Status",dID)
return ((status == "1") == allow)
When the “At Home” virtual switch is set to ON, these scenes will run. When it is set to OFF, these scenes will not run. Did I get that right?
1. Can you point me in the right direction to create a Virtual Switch? I tried searching, but can't find any reference to actually creating one.
Woo hoo! I actually found the answer to this one on my own:
http://wiki.micasaverde.com/index.php/Create_Virtual_Switch_Manually
Can you point me in the right direction to create a Virtual Switch? I tried searching, but can't find any reference to actually creating one.
If you are running Vera firmware 1.5.xxx (I assume so from your first post), click on http://apps.mios.com/plugin.php?id=1408. You will need to log in with your normal Vera username and password and select your Vera. Then click the Install button to install VirtualSwitch on Vera. When Vera has finished installing and restarted, refresh your browser and you should find a new VirtualSwitch device. You can change its name and room by opening the device tile and selecting the Advanced tab. After any change, restart Vera and refresh the browser page.
I'd like to see if I understand how to use the virtual switch. Let's say I create a Virtual Switch called "At Home", which I keep "On" when we are NOT on Vacation (i.e. when we want the normal temperature scenes to run). Assuming a device ID of 32, I would paste this code into the LUUP tab of each scene.
Code: [Select]
local dID = 32 – 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:VSwitch1”,“Status”,dID)
return ((status == “1”) == allow)
When the “At Home” virtual switch is set to ON, these scenes will run. When it is set to OFF, these scenes will not run. Did I get that right?
Spot-on. It really is as easy as that. 
[quote=“tripletdad, post:6, topic:186015”]
1. Can you point me in the right direction to create a Virtual Switch? I tried searching, but can’t find any reference to actually creating one.
Woo hoo! I actually found the answer to this one on my own:
http://wiki.micasaverde.com/index.php/Create_Virtual_Switch_Manually[/quote]
I haven’t tried that one. It may well work just as well as the full plugin.
It seems to be working! Thanks again for all your help. I have added an additional scene called “Vacation” which lowers the temp on all thermostats to 55 when “At Home” is “Off”. Here is what I used:
local dID = 34 -- Device ID of your VirtualSwitch
local allow = false -- false runs scene if switch is off, true blocks it
local status = luup.variable_get("urn:upnp-org:serviceId:VSwitch1","Status",dID)
return ((status == "1") == allow)
Is that correct as well?
[quote=“tripletdad, post:9, topic:186015”]It seems to be working! Thanks again for all your help. I have added an additional scene called “Vacation” which lowers the temp on all thermostats to 55 when “At Home” is “Off”. Here is what I used:
local dID = 34 -- Device ID of your VirtualSwitch
local allow = false -- false runs scene if switch is off, true blocks it
local status = luup.variable_get("urn:upnp-org:serviceId:VSwitch1","Status",dID)
return ((status == "1") == allow)
Is that correct as well?[/quote]
That should work too. Did you install the VirtualSwitch plugin? If you are using the other way to create a virtual switch that you linked, you would need to change the serviceId in the luup.variable_get(…) call. It would use the normal binary-light service: “urn:upnp-org:serviceId:SwitchPower1” instead of the VirtualSwitch one: “urn:upnp-org:serviceId:VSwitch1”.
Are you triggering this new scene with a schedule?
Are you triggering this new scene with a schedule?
No. After playing around a bit, I decided to make the new scene (Vacation) triggered when the “At Home” button is set to “Off”. I don’t think I need to use any LUUP code in this one, since it only happens once, when triggered. All the other temperature scenes are suppressed by the LUUP code you provided, so it seems like it should work without any LUUP code itself. (I originally thought I would need to have the LUUP code I referenced that included “local allow = false”, but on second thought I don’t think that code is necessary).
Does that seem right to you?
Did you install the VirtualSwitch plugin?
I did.
Does that seem right to you?
It does. It is why I asked about the trigger.
Great! I think everything is working nicely now. Thanks again for all your help. It was very kind of you!
I’m happy to help, David.