Author Topic: Pausing scenes?  (Read 4915 times)

Offline Pyroplantfreak

  • Sr. Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
Pausing scenes?
« on: October 27, 2011, 08:41:12 am »
I am new to this...Finding it hard not to z wave my winter coat.....

How do I pause scenes?

Scenario.

I have an "away" setting for my two thermostats.

I don't want the "evening" scene to kick on.

How do I pause scenes?  Now I feel I need to delete them....I know that is not the case.

Thank you in advance.

Offline mysticjay

  • Full Member
  • ***
  • Posts: 184
  • Karma: +1/-1
Re: Pausing scenes?
« Reply #1 on: October 27, 2011, 08:02:03 pm »
Interesting question..I'm assuming something like this might work - Credits this post:

http://forum.micasaverde.com/index.php/topic,8023.msg51862.html#msg51862


1. Install a State Device

2. In your AWAY scene Lua Tab, set the State Device status to ON ..like this

Code: [Select]
local serviceVar = "urn:upnp-org:serviceId:SwitchPower1"
local StateDeviceID = 40
luup.variable_set(serviceVar, "Status", '1', StateDeviceID )

3. In your Evening scene simply dont run the scene like this by adding this in Lua tab

Code: [Select]
local serviceVar = "urn:upnp-org:serviceId:SwitchPower1"
local StateDeviceID = 40
skip = luup.variable_get(serviceVar ,"Status",StateDeviceID )
if(skip=="1")then
  return false
end





Vera 2 (1.1.1338), Trane TZEMT400BB3,ML IWD600S(2), ML IWS1000S(2) , FI8905W, Aeon DSB04100-ZWUS, GE 45609(2), GE 45606(2), GE 45608, GE 45614 (5), LFM-20(2), Kwikset 99100-011 (5) , Hawking HRMD1, Droid X and Xoom as Remotes, Harmony Link

Offline DeltaNu1142

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +40/-67
Re: Pausing scenes?
« Reply #2 on: October 28, 2011, 02:44:15 pm »
Interesting question..I'm assuming something like this might work - Credits this post:
http://forum.micasaverde.com/index.php/topic,8023.msg51862.html#msg51862
...
FWIW, this is exactly what I did as a solution to exactly the same scenario you describe.

LINK TO SCREEN SHOT

The "State Device" in my case is called "Away Mode".  When "Away Mode" is on, my thermostat timers don't kick in.  I also have and another state device I called "Guest Mode" which prevents my thermostats from shutting off on weekday mornings.
Vera 3 @ UI5 | HomeWave | PLEG

Offline Pyroplantfreak

  • Sr. Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
Re: Pausing scenes?
« Reply #3 on: November 07, 2011, 07:34:56 pm »
Interesting question..I'm assuming something like this might work - Credits this post:

http://forum.micasaverde.com/index.php/topic,8023.msg51862.html#msg51862


1. Install a State Device

2. In your AWAY scene Lua Tab, set the State Device status to ON ..like this

Code: [Select]
local serviceVar = "urn:upnp-org:serviceId:SwitchPower1"
local StateDeviceID = 40
luup.variable_set(serviceVar, "Status", '1', StateDeviceID )

3. In your Evening scene simply dont run the scene like this by adding this in Lua tab

Code: [Select]
local serviceVar = "urn:upnp-org:serviceId:SwitchPower1"
local StateDeviceID = 40
skip = luup.variable_get(serviceVar ,"Status",StateDeviceID )
if(skip=="1")then
  return false
end

The

"local StateDeviceID = 40"

is where you "insert" the virtual switch device id.  In my case the virtual switch id is 23.

I made the "local StateDeviceID" = 23.  I installed

Code: [Select]
local serviceVar = "urn:upnp-org:serviceId:SwitchPower1"
local StateDeviceID = 23
luup.variable_set(serviceVar, "Status", '1', StateDeviceID )
 

into every scene luup tab  that would change the thermostats.

Thank you to all that have helped.

This is fun.
« Last Edit: November 07, 2011, 10:19:57 pm by Pyroplantfreak »

Offline mmthorn1

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: Pausing scenes?
« Reply #4 on: December 15, 2011, 10:34:46 pm »
I followed this tutorial and was able to disable my thermostat timer when the "away" scene (ID 1) was enabled.  Everything seemed to be working but now my thermostat timer doesn't activate when the other scenes are enabled.  Seems like there should be an equivalent code to change the status to something other than "1" for scenes other than "away"?  Any ideas?  Thanks for the help.

Offline DeltaNu1142

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +40/-67
Re: Pausing scenes?
« Reply #5 on: December 16, 2011, 07:02:28 am »
I followed this tutorial and was able to disable my thermostat timer when the "away" scene (ID 1) was enabled.  Everything seemed to be working but now my thermostat timer doesn't activate when the other scenes are enabled.  Seems like there should be an equivalent code to change the status to something other than "1" for scenes other than "away"?  Any ideas?  Thanks for the help.
The great thing about binary is that the only thing "other than 1" is "0"...  What other scenes?  I have a scene that sets the temperatures when I'm ready to leave, and another one that sets the temperatures just before I get home.  Those scenes will run every day that either my "Away Mode" or my "Guest Mode" are not set (meaning, their state is "0").

This is the code I use to dictate that behavior:
Code: [Select]
local AwayModeDevice=6
local GuestModeDevice=7

local AwayMode = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", AwayModeDevice)
local GuestMode = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", GuestModeDevice)

if (AwayMode == "1") or (GuestMode == "1") then
    return false
else
    return true
end
I recently used similar code in a scene that makes my home appear occupied when I'm not there...  I used only the "Away" device (removed all references to "Guest"), and reversed "false" and "true".
Vera 3 @ UI5 | HomeWave | PLEG

Offline mmthorn1

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: Pausing scenes?
« Reply #6 on: December 16, 2011, 10:05:55 pm »
I think I understand this code except for one detail.  If looks like when one of your scenes gets activated the status is set to 1.  What scene sets the status back to 0 so that the timer can operate again.  Thanks,

Offline DeltaNu1142

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +40/-67
Re: Pausing scenes?
« Reply #7 on: December 17, 2011, 06:07:17 am »
I think I understand this code except for one detail.  If looks like when one of your scenes gets activated the status is set to 1.  What scene sets the status back to 0 so that the timer can operate again.  Thanks,
Read back through the posts referenced above.  I understand your question as asking, "when your scene gets activated, the state of this device changes to..."  No, that's not correct.  The device is a virtual device, and let's call it "AWAY MODE".  Let's avoid confusion and say that the state of "AWAY MODE" is something you set manually.  The code above is placed in a scene.  That scene will check the status of "AWAY MODE" and either run or not run, based on the status of "AWAY MODE".  The state of that device does not change with the scene in which it's placed (for the purposes of getting it working); it just either allows the scene to run, or it doesn't...  see what I mean?
Vera 3 @ UI5 | HomeWave | PLEG

Offline mmthorn1

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: Pausing scenes?
« Reply #8 on: December 17, 2011, 06:50:29 pm »
I am still not getting it.  What if I have a third scene called Home Mode that sets the temp to 68F and then expects the various timers to kick in.....Do I need to set the Away Mode and Guest Mode to "0" within Home Mode?  I don't see how Away Mode and Guest Mode ever get changed from anything other than "1".  As you can probably tell.....I am not a programmer.

Offline DeltaNu1142

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +40/-67
Re: Pausing scenes?
« Reply #9 on: December 18, 2011, 11:15:47 am »
I am still not getting it.  What if I have a third scene called Home Mode that sets the temp to 68F and then expects the various timers to kick in.....Do I need to set the Away Mode and Guest Mode to "0" within Home Mode?  I don't see how Away Mode and Guest Mode ever get changed from anything other than "1".  As you can probably tell.....I am not a programmer.
I like to make things as simple as possible, and then get complicated from there.

Let's start with two items: a virtual device called "AWAY MODE" and a scene called "THINGS THAT HAPPEN WHEN I'M NOT AWAY".

"THINGS THAT HAPPEN WHEN I'M NOT AWAY" is your scene that does everything routine; it sets your desired temperature, it might turn lights on & off, all the day-to-day things that happen when you're in town.

"AWAY MODE" is a virtual device and--for the sake of simplicity--you set it manually.  "AWAY MODE" is a "1" when you are out of town, and "0" the rest of the time.  When you're ready to go out of town, and you want to disable your scene "THINGS THAT HAPPEN WHEN I'M NOT AWAY", you set "AWAY MODE" to a "1".  Manually.  Click "ON" in the UI, or on iVera, or whatever you're using.

That's it.  With the code above in the Luup tab of your "THINGS THAT HAPPEN WHEN I'M NOT AWAY", it will NOT run whenever you have "AWAY MODE" on.

You can then get more complicated by automatically setting "AWAY MODE", or when "AWAY MODE" is shut off, it acts as a trigger to run whichever scene prepares your home for your return.

I'm not a programmer, either.  But with the snippets of code available on this site & other resources, I've been able do everything I've been able to think to so far.
Vera 3 @ UI5 | HomeWave | PLEG

Offline mmthorn1

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: Pausing scenes?
« Reply #10 on: December 19, 2011, 10:29:32 pm »
Thanks for the help.  Is SwitchPower1 a virtual switch and you turn on and off as shown in your screen shot....or do you use a different virtual switch?

Offline DeltaNu1142

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +40/-67
Re: Pausing scenes?
« Reply #11 on: December 20, 2011, 10:06:39 am »
Thanks for the help.  Is SwitchPower1 a virtual switch and you turn on and off as shown in your screen shot....or do you use a different virtual switch?
I don't understand the question.

I just turn on/enable Away Mode manually.  Among other things, it prevents scenes from running that have the code above in the Luup tab.  It's that easy.  Away Mode = ON means scenes with that code in the Luup tab don't run.
Vera 3 @ UI5 | HomeWave | PLEG