We have moved at community.getvera.com

Author Topic: Setting a scene for away  (Read 16072 times)

Offline wscannell

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
Re: Setting a scene for away
« Reply #15 on: May 11, 2011, 10:39:39 pm »
You do not need any Luup code for the away thermostat scenes.  Add an event to your scene in the event tab of the scene.  Then select the virtual switch. Select event type "a device is turned on or off".   For the scene that you want to run when you go away, set the which mode to on and save.
The scene should run when you turn the virtual switch on.  You can turn it on from the dashboard.  I have something like this in my setup and I just tested it.

If that does not work, test the scene by clicking on the run button from the dashboard.  See if it does the correct thing.

Offline tscott

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Setting a scene for away
« Reply #16 on: May 12, 2011, 11:03:29 am »
Err - Frustrating.  I understand exactly what is being said.  I also think it should work.  I run the scenes "away" and it set my Thermostats at ESM, and run "Home" it set back to normal.  The scenes are working.

I link the scenes to the Virtual Switch - "Energy Saving Mode" and nothing happens to the scenes.  I have attached a couple screen shots of the Dashboard, My Virtual Switch Advanced Tab, Away Sceen Event Tab, Away Summary showing 2 commands and 1 event linked. 

The two commands is for two thermostats. 

The scenes work on their own when run, however do not trigger from the virtual switch.  The other frustating bit is I have the virtual switch contoling three lights which are on timer scenes.  When i press on, the lights follow the timers.  At least i think they do, the lights come on like they should, i assume the timers are functioning. 

I know i'm close to having it working.   

Offline JimMac

  • Sr. Member
  • ****
  • Posts: 309
  • Karma: +2/-1
Re: Setting a scene for away
« Reply #17 on: May 12, 2011, 11:24:03 am »
What code do you have in the Luup tab of your scene?  How are you toggling the state of your virtual switch?

Try toggling your "Energy Saving Mode" virtual switch using Luup code.  I have had issues where switching it in the command section does not always work.

The best way to test this out is to keep it simple.  Add the code below to the Luup tab in a new scene.  Run the scene and observe the status of your "Energy Saving Mode" switch.  It should change from off to on/on to off every time your run the scene.   If this works then your virtual switch is working.

local Energy_Mode=luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status",11)

if (Energy_Mode == "1") then
luup.variable_set("urn:upnp-org:serviceId:SwitchPower1","Status",0,11)
else
luup.variable_set("urn:upnp-org:serviceId:SwitchPower1","Status",1,11)
end

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Setting a scene for away
« Reply #18 on: May 12, 2011, 11:31:53 am »
I know i'm close to having it working.   
Are you sure you picked up the v0.1 zip from here?
Dezwaved at the moment...

Offline tscott

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Setting a scene for away
« Reply #19 on: May 12, 2011, 11:48:30 am »
JmMac - I have completed the test.  The switch turns off/on when i set up the test scene using your codes. 

OTI@ - i'm pretty sure i'm running v1. 


Offline tscott

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Re: Setting a scene for away
« Reply #20 on: May 12, 2011, 12:04:37 pm »
Having downloaded the last files from OTI@ and uploaded into my files.  Everything seems to be working.  The virtual switch is now activating the ThermoStat scenes.  Awesome -

Thanks for all the help.



Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Setting a scene for away
« Reply #21 on: May 12, 2011, 12:33:17 pm »
[...] The virtual switch is now activating the ThermoStat scenes.  Awesome -
At last! I guess you were missing the boiling batwing. And now have your (first) scars. ;)
« Last Edit: May 12, 2011, 12:35:41 pm by oTi@ »
Dezwaved at the moment...

Offline shahhim

  • Sr. Newbie
  • *
  • Posts: 26
  • Karma: +0/-0
Re: Setting a scene for away
« Reply #22 on: May 18, 2011, 09:24:46 pm »
Can some one help! How do I implement a virtual switch. Is the any link that goes over step by step instructions ?

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Setting a scene for away
« Reply #23 on: May 18, 2011, 11:32:45 pm »
Can some one help! How do I implement a virtual switch. Is the any link that goes over step by step instructions ?
The plug-ins can be found here. Search for 'Virtual StateDevice'.

Generic instructions how to install the files are here.
Dezwaved at the moment...

Offline axill

  • Full Member
  • ***
  • Posts: 183
  • Karma: +3/-0
Re: Setting a scene for away
« Reply #24 on: May 19, 2011, 01:59:15 am »
I had the similar idea - for Vera to identify automaticaly away.
First of all I create a virtual status device which represent away status (in my case OFF means away).
I used StateDevice described in enother thread.

Second I create two scenes:

1. Trigerring entrance and setting my status to away OFF (someone entering house).
This one is simple - I add events for all my 10 motion sensors to trigger in Tripped = ON

2. More complicated. It is a timer based scene (in my case run each 30 minutes).
In this scene I go thouth the circle on luup.devices and looking to Tripped status and LastTrip timestamp of all my devices with devices[].device_type coresponding to motion sensor.
Within this circle I calculates a minumum difference beetwen current time and LastTrip.
As soon as this minimum difference is above threshold (I set 30 minutes for daylight time and 6 hours for night) the scene is setting my virtual status to away ON

I can share my Lua code if it will be interesting

Offline shahhim

  • Sr. Newbie
  • *
  • Posts: 26
  • Karma: +0/-0
Re: Setting a scene for away
« Reply #25 on: May 28, 2011, 08:18:16 pm »
tscott,
So all said and done what exactly did you do for your thermostats so that now  they are working. I have a virtual switch thats working but I am a little confused at to what needs to be done next. Do I need to create another scens or what ? and then do exactly what
shahhim

Offline MNB

  • Hero Member
  • *****
  • Posts: 689
  • Karma: +4/-9
Re: Setting a scene for away
« Reply #26 on: May 28, 2011, 09:15:01 pm »
@axill, yes please would be interested in seeing both of you scenes, Mike
Edge-1.7.2607, VRI06-1LX Dimr (6), VS05-1LX Sw (4), GE ZW3002 Dimr (1), HA01C Outlet (12), HA02C Sw (6), HA04C Sw (4), GE Sw (2), HA05 Sw (3), MiniMote Contr (5), HSM200/100 Sensor (2), ZW100A Sensor (8), Nest thermostat (1) & Protect Fire/CO (6) Kwikset Locks (3), F18918W (1) & IP3M-9 (6) Cam's

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Setting a scene for away
« Reply #27 on: May 29, 2011, 08:26:50 am »
[...] I have a virtual switch thats working but I am a little confused at to what needs to be done next. Do I need to create another scens or what ? and then do exactly what
In general, it's a 3 step process:

1) Create virtual switch (your Home/Away light).
2) Set up scenes with triggers to turn on/off the Home/Away light.
3) Set up scenes that are triggered by the Home/Away light being switched on/off.

Think of the virtual switch as a light that you turn on to indicate that you're home, and turn off to indicate that you're away. (Or the other way around; whatever you prefer.)

So, what you need is events/triggers to turn the light on or off. In its simplest form you could switch the light manually through the Dashboard. But you could use more advanced triggers, like motion sensors, a lock being lock/unlocked, a button on a scene controller, etc. Whatever works for your situation.

The hard part is coming up with a good set of triggers that work reliably. E.g., a motion sensor that triggered could be an indication that you're home (or a burglar?), if you have motion sensors covering all your entrances. Etc.

Once you have that sorted, the other part is using the state switches (on/off) of the light as events in scenes to do whatever you want to do when you go away or arrive home.

So if you wanted to do something with your thermostats, you'd create a scene for that and use 'a device is turned on/off' and the appropriate 'on'/'off' for the Home/Away light as the event.


Start simple /  go in iterations. You could skip step 2 and do a single, simple scene in step 3. Test the scene with the 'Run' button. Then test it by switching the Home/Away light. Then add more complicated events and scenes.
« Last Edit: May 29, 2011, 08:45:11 am by oTi@ »
Dezwaved at the moment...

Offline Henk

  • Hero Member
  • *****
  • Posts: 820
  • Karma: +3/-0
Re: Setting a scene for away
« Reply #28 on: May 29, 2011, 09:46:20 am »
[...] I have a virtual switch thats working but I am a little confused at to what needs to be done next. Do I need to create another scens or what ? and then do exactly what
In general, it's a 3 step process:

1) Create virtual switch (your Home/Away light).
2) Set up scenes with triggers to turn on/off the Home/Away light.
3) Set up scenes that are triggered by the Home/Away light being switched on/off.

Think of the virtual switch as a light that you turn on to indicate that you're home, and turn off to indicate that you're away. (Or the other way around; whatever you prefer.)

So, what you need is events/triggers to turn the light on or off. In its simplest form you could switch the light manually through the Dashboard. But you could use more advanced triggers, like motion sensors, a lock being lock/unlocked, a button on a scene controller, etc. Whatever works for your situation.

The hard part is coming up with a good set of triggers that work reliably. E.g., a motion sensor that triggered could be an indication that you're home (or a burglar?), if you have motion sensors covering all your entrances. Etc.

Once you have that sorted, the other part is using the state switches (on/off) of the light as events in scenes to do whatever you want to do when you go away or arrive home.

So if you wanted to do something with your thermostats, you'd create a scene for that and use 'a device is turned on/off' and the appropriate 'on'/'off' for the Home/Away light as the event.


Start simple /  go in iterations. You could skip step 2 and do a single, simple scene in step 3. Test the scene with the 'Run' button. Then test it by switching the Home/Away light. Then add more complicated events and scenes.

Nice description oTi@
You should go into the How To writing business ;-)
| Vera2 @ UI4 1.1.1350 / 3.20 | Vera Lite @ UI5 | Vera 3 @ UI5 | 2x Merten  504519 | 1x Duewi  064374 | 1x Everspring SM103 doorbell mod |1 Y-cam IP cam | various LUUP plugins |

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Setting a scene for away
« Reply #29 on: May 29, 2011, 11:21:04 am »
You should go into the How To writing business ;-)
Yep, I was actually thinking of throwing this onto the HowTo pages at some point. But if you and/or @huogas think it's good to go there as is, feel free.
Dezwaved at the moment...