We have moved at community.getvera.com

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

Offline Henk

  • Hero Member
  • *****
  • Posts: 820
  • Karma: +3/-0
Re: Setting a scene for away
« Reply #30 on: May 29, 2011, 11:26: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.

Does it need maturing and more steps/examples added?
Do you have enough information to fill out this example?

example
| 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 RastusB2

  • Jr. Member
  • **
  • Posts: 59
  • Karma: +0/-1
  • I KNEW I shouldn't have stomped those grapes!
Re: Setting a scene for away
« Reply #31 on: July 08, 2011, 06:05:23 pm »
I have set up my virtual switch and can toggle it on & off using a pin code from my Schlage lock
I entered the following code in my Trane thermostat 3:00 scene: ((I have -4- scenes for differant times))

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

if (away_home == "1") then
luup.variable_set("urn:upnp-org:serviceId:SwitchPower1","Status",0,53)
else
luup.variable_set("urn:upnp-org:serviceId:SwitchPower1","Status",1,53)
end
So far the only thing that works is the virtual switch.
When I click the Energy button on the TRANE GUI, it will switch to the ESM settings.
When I click the Normal button, it will go to the Normal set points.
But the LuuP code won't change the ESM to Normal or vice versa.
Also, how do you get the ESM scene to put the fan on auto and the normal scene to run the fan constant?
GE/Jassco Duplex Outlets -16-, GE 3 Way Dimmer -6-, GE 2 Way Dimmers
-8-, GE Lamp Modules -6-. GE Appliance Module -8-, Leviton VRI06-1L  Vizia RF + 600W Incandescent Scene Capable Dimmer-VRI06-1LX, Schlage Dead Bolt, Schlage/Trane Thermostat, Schlage IP wired Camera -3,-Vera 3 UI5 v1.5.408

Offline rogerl

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +0/-0
Re: Setting a scene for away
« Reply #32 on: August 16, 2011, 02:16:51 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. ;)

I guess I have a substandard batwing. I have a virtual switch as well, using the same code, that works using a Luup test as above. However, when the state of the virtual switch changes, the scene that should be triggered from the switch is not triggered (I guess - at least the state of the relevant device does not change). Screen shots below. What am I missing?

Offline JOD

  • Hero Member
  • *****
  • Posts: 1973
  • Karma: +4/-0
Re: Setting a scene for away
« Reply #33 on: August 16, 2011, 03:08:19 pm »
@rogerl,

Did you boil the batwing?

Your scene setup is correct for turning the living room lights on if the Virtual Device is turned on.
What did you want the scene to accomplish?
Are you using a timer?
Can you post your code?
Did you change the device number in your code to match your VD #14?

JOD.
I'm sorry, my responses are limited. You must ask the right questions.

Offline rogerl

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +0/-0
Re: Setting a scene for away
« Reply #34 on: August 16, 2011, 09:41:50 pm »
All I wanted the scene to accomplish was to turn the living room lights on when the virtual device is switched on. What I posted is all the code related to these two things - except for the code for the virtual device itself, which came from Henk yesterday. The test code that actuates the virtual device works correctly (and yes, I did change the device number in that code to 14); it is copied from the code higher up in this thread. But whichever method I use to turn the virtual device on or off seems to have no effect on the LR light setting.

Is there some way I can actually tell if the scene (the one imaginatively named New Scene in the above screen shots) fires or not? (I don't see how it could be firing - when I run it by pressing the "Run" button, the LR light turns on).
« Last Edit: August 16, 2011, 09:58:15 pm by rogerl »

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Setting a scene for away
« Reply #35 on: August 16, 2011, 11:51:34 pm »
[...] I have a virtual switch as well, using the same code, [...]
Did you download the virtual switch code from this location?
Dezwaved at the moment...

Offline rogerl

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +0/-0
Re: Setting a scene for away
« Reply #36 on: August 17, 2011, 12:04:11 am »
@oTi, no, from this one: http://forum.micasaverde.com/index.php?topic=6650.15, which was posted yesterday.

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Setting a scene for away
« Reply #37 on: August 17, 2011, 07:01:12 am »
@oTi, no, from this one: http://forum.micasaverde.com/index.php?topic=6650.15[...]
OK; that is the same set.

Could you try unpacking that archive and uploading the files to Vera one more time? The symptom you're describing sounds like you may not have the correct files somehow.
Dezwaved at the moment...

Offline rogerl

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +0/-0
Re: Setting a scene for away
« Reply #38 on: August 17, 2011, 08:37:58 am »
@oTi, I will, but perhaps you can also tell me:
1. When I unpack that archive there are only two files there: I_... and D_... . I could have sworn that there was also a D_BinaryLight1.json file before.
2. I currently have two separate D_BinaryLight1.json files on my Vera. How can I remove one of them (at least), and where should I find the correct file to use?

Offline rogerl

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +0/-0
Re: Setting a scene for away
« Reply #39 on: August 17, 2011, 08:42:11 am »
Wow, that solved the problem. I guess in the end it was user error, but I am (of course) certain I did just now exactly what I did before. Thanks.

Offline rogerl

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +0/-0
Re: Setting a scene for away
« Reply #40 on: August 17, 2011, 05:00:59 pm »
One last (I hope) question. Now that I have a virtual home/away switch, I'd like to build a second virtual switch, for "is it winter weather". I don't particularly want to use the calendar to determine that; I'd rather click it on and off myself. What do I have to change in the D_ and I_StateDevice files? My thinking is that in D_StateDevice I need to change the Service List section,

    <serviceList>
      <service>
        <serviceType>urn:schemas-upnp-org:service:SwitchPower:1</serviceType>
        <serviceId>urn:upnp-org:serviceId:SwitchPower1</serviceId>
        <controlURL>/upnp/control/SwitchPower1</controlURL>
        <eventSubURL>/upnp/event/SwitchPower1</eventSubURL>
        <SCPDURL>S_SwitchPower1.xml</SCPDURL>
      </service>
    </serviceList>
to read

    <serviceList>
      <service>
        <serviceType>urn:schemas-upnp-org:service:SwitchPower:1</serviceType>
        <serviceId>urn:upnp-org:serviceId:SwitchPower2</serviceId>
        <controlURL>/upnp/control/SwitchPower2</controlURL>
        <eventSubURL>/upnp/event/SwitchPower2</eventSubURL>
        <SCPDURL>S_SwitchPower1.xml</SCPDURL>
      </service>
    </serviceList>
and change all the references to SwitchPower1 in the implementation file to refer instead to SwitchPower2 (and of course upload it to Vera as a different file). Make sense?

Roger

Offline JOD

  • Hero Member
  • *****
  • Posts: 1973
  • Karma: +4/-0
Re: Setting a scene for away
« Reply #41 on: August 17, 2011, 09:27:19 pm »
Mios developers => Create device, add D_StateDevice.xml to the UpnpDevFilename area.
Click Create device.

You should now have another State Device.

JOD.
I'm sorry, my responses are limited. You must ask the right questions.