We have moved at community.getvera.com

Author Topic: Turn on lights via http url??  (Read 4143 times)

Offline waynebrady

  • Full Member
  • ***
  • Posts: 110
  • Karma: +0/-0
Turn on lights via http url??
« on: November 03, 2011, 02:43:55 pm »
Is it possible to create a bookmark with a url that would turn on light switch via http?

I ask because when I am home, I absolutely hate fumbling into the interface to do a simple task. I just want to make an icon on my iPhone that would turn on the lights.

Possible?

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Turn on lights via http url??
« Reply #1 on: November 03, 2011, 04:45:05 pm »
You can use this to turn a binary light on:

Remotely:

https://fwd2.mios.com/john/tokyo/10266/data_request?id=lu_action&DeviceNum=<devId>&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1

You will need to know what forward server you are on e.g. fwd1 or fwd2 for UI4 firmware.

change the following:

john = your mios username
tokyo = your mios password
10266 = your vera unit number
<devId> =  change this to the device number of the light you want to turn on
TargetValue=1    1 = on   0 = off

For local access:

http://<veraIP>:3480/data_request?id=lu_action&DeviceNum=<devId>&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1

Change the following:

<veraIP> = the ip address of vera
<devId> =  change this to the device number of the light you want to turn on
TargetValue=1    1 = on   0 = off

To toggle a device on/off depending on their state:

remotely:

https://fwd2.mios.com/john/tokyo/10266/data_request?id=lu_action&output_format=xml&DeviceNum=<devId>&serviceId=urn:micasaverde-com:serviceId:HaDevice1&action=ToggleState

john = your mios username
tokyo = your mios password
10266 = your vera unit number
<devId> =  change this to the device number of the light you want to turn on

local:

http://<veraIP>:3480/data_request?id=lu_action&output_format=xml&DeviceNum=<devId>&serviceId=urn:micasaverde-com:serviceId:HaDevice1&action=ToggleState

Change the following:

<veraIP> = the ip address of vera
<devId>  = the device to change the toggle state

- Garrett

Offline waynebrady

  • Full Member
  • ***
  • Posts: 110
  • Karma: +0/-0
Re: Turn on lights via http url??
« Reply #2 on: November 03, 2011, 05:11:04 pm »
Thanks Garrett! This would be handy when it comes to creating custom UI controls!

What if I am port forwarding my Vera? Is is possible to do this?
http://my.static.ip:port/data_request?id=lu_action&DeviceNum=3&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1

I realize that it says "File not found." is the data_request in a different folder?

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Turn on lights via http url??
« Reply #3 on: November 03, 2011, 08:22:48 pm »
What if I am port forwarding my Vera? Is is possible to do this?
If you forward an external port to Vera's port 3480, it should work.

<Insert usual warning about port forwarding here. I'd go through the cp.mios.com tunnel as indicated by @garrettwp, or your own VPN, etc.>
« Last Edit: November 03, 2011, 09:20:52 pm by oTi@ »
Dezwaved at the moment...