Author Topic: Can I control VeraLite from my cloud-based program  (Read 4070 times)

ljcljc

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Can I control VeraLite from my cloud-based program
« on: June 08, 2012, 10:09:33 pm »
I want to control VeraLite from my cloud-based program through the Internet. For example, I want to turn off the lighting switch or read sensor data through VeraLite.

Does anyone know how to do that? How to connect through http request or TCP request?

Thanks a lot

strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3673
  • Karma: +33/-1
  • Vera 1,3 & V light
Re: Can I control VeraLite from my cloud-based program
« Reply #1 on: June 08, 2012, 10:15:45 pm »
I believe what you require is here:

http://wiki.micasaverde.com/index.php/UI_Simple
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

ljcljc

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Re: Can I control VeraLite from my cloud-based program
« Reply #2 on: June 09, 2012, 09:22:45 am »
Thanks! That's helpful.

ljcljc

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Re: Can I control VeraLite from my cloud-based program
« Reply #3 on: June 14, 2012, 03:56:41 pm »
I met some problem in controlling the thermostat. I used VeraLite and z-wave thermostat from 2gig.

I want to send http request through VeraLite to the thermostat to set the cooling setpoint, but I failed.

According to the UI Simple wiki page, I tried the following command
"http://192.168.81.1:3480/data_request?id=action&output_format=xml&DeviceNum=4&serviceId=urn:upnp-org:serviceId:TemperatureSetpoint1_Cool&action=SetCurrentSetpoint&newCurrentSetpointValue=72"

Then it replied "ERROR: Device does not handle service/action".

Does it mean I cannot control the device through servece/action? Is there any other way to control the thermostat by sending http request?

Thanks

I believe what you require is here:

http://wiki.micasaverde.com/index.php/UI_Simple


ljcljc

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Re: Can I control VeraLite from my cloud-based program
« Reply #5 on: June 14, 2012, 06:31:15 pm »
Hi, Garrett

Thanks so much for your reply.

I have tried the commands. The status in VeraLite does changed, but the setting on the thermostat does not change at all. I guess it just edit the record value in VeraLite, not send control signal to the device.

The status look like this:

<state id="49" service="urn:upnp-org:serviceId:TemperatureSetpoint1_Cool" variable="SetpointTarget" value="72"/>
<state id="50" service="urn:upnp-org:serviceId:TemperatureSetpoint1_Cool" variable="CurrentSetpoint" value="72"/>

Any other ideas?

Thanks!!

Try this:

http://192.168.81.1:3480/data_request?id=lu_action&output_format=json&serviceId=urn:upnp-org:serviceId:TemperatureSetpoint1_Cool&DeviceNum=4&action=SetCurrentSetpoint&NewCurrentSetpoint=72

- Garrett

garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 5889
  • Karma: +178/-21
  • Vera 3, Lite, ISY994
Re: Can I control VeraLite from my cloud-based program
« Reply #6 on: June 15, 2012, 01:55:57 am »
Not sure why it is not updating the thermostat. This is what I use in my Android app to control the thermostats. Can you confirm that a change from the Vera Web interface updates the thermostat?

- Garrett

ljcljc

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Re: Can I control VeraLite from my cloud-based program
« Reply #7 on: June 15, 2012, 08:45:59 am »
Thanks Garrett

It's working now! I am not sure why it didn't work before, but now I tried it again and it's working!

Not sure why it is not updating the thermostat. This is what I use in my Android app to control the thermostats. Can you confirm that a change from the Vera Web interface updates the thermostat?

- Garrett

ljcljc

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Re: Can I control VeraLite from my cloud-based program
« Reply #8 on: June 15, 2012, 08:08:53 pm »
One more question.

When I change the setpoint of thermostat manually, I didn't see the corresponding change in VeraLite. Even I wait for several minutes, the parameter does not change in VeraLite.

The time interval of polling is set to be 60 seconds, so it is supposed to update the device status every 60 seconds.

Can anyone help me?

Thanks a lot

mcvflorin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1718
  • Karma: +5/-0
Re: Can I control VeraLite from my cloud-based program
« Reply #9 on: June 18, 2012, 03:46:33 am »
By default Vera polls a device every 30 seconds, and a device cannot be polled more than once every 60 seconds. If you have 1 Z-Wave device it will be polled once every 90 seconds, if you have 10 Z-Wave devices it will be polled once every 330 seconds. So if you have many Z-Wave devices it can take several minutes for a device to be updated.

oTi@

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3811
  • Karma: +16/-3
Re: Can I control VeraLite from my cloud-based program
« Reply #10 on: June 18, 2012, 04:32:39 am »
See also the wiki page on polling.

ljcljc

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Re: Can I control VeraLite from my cloud-based program
« Reply #11 on: June 18, 2012, 07:24:18 pm »
Hi, mcvflorin

I don't quite understand this part. Could you explain to me how you get 330 seconds for 10 devices?

Thanks a lot

By default Vera polls a device every 30 seconds, and a device cannot be polled more than once every 60 seconds. If you have 1 Z-Wave device it will be polled once every 90 seconds, if you have 10 Z-Wave devices it will be polled once every 330 seconds. So if you have many Z-Wave devices it can take several minutes for a device to be updated.

ljcljc

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Re: Can I control VeraLite from my cloud-based program
« Reply #12 on: June 18, 2012, 09:39:04 pm »
Hi, all

Here is the strange thing.

I am sure the poll is successful, but the setpoint shown on Vera is different from the actual setpoint on thermostat. After I set the setpoint on thermostat manually, I wait for long time but the setpoint in Vera did not change. Even if I press the button 'Poll Now' in the web UI, the setpoint does not change. It seems there is some problem with the poll function.

Can anyone help me?

Thanks so much!

mcvflorin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1718
  • Karma: +5/-0
Re: Can I control VeraLite from my cloud-based program
« Reply #13 on: June 19, 2012, 01:18:19 am »
I don't quite understand this part. Could you explain to me how you get 330 seconds for 10 devices?

If Vera polls a device every 30 seconds then a polling cycle takes 30 seconds * 10 devices = 300 seconds. The next polling cycle begins 30 seconds after the previous polling cycle ended, so 300 seconds + 30 seconds = 330 seconds until the first device in the new polling cycle is polled. I'm not that good at explaining things. :)

Quote
Even if I press the button 'Poll Now' in the web UI, the setpoint does not change. It seems there is some problem with the poll function.

You should SSH into Vera and look in the LuaUPnP.log file.

1. First you must enable verbose logging with the command:
VerboseLogging.sh enable

2. Then watch the logs for lines starting with 06:
tail -f /var/log/cmh/LuaUPnP.log | grep '^06'

After you issue a poll command from the UI you should see something like this in the log file:
Quote
06      04/23/12 6:08:18.545    Device_Variable::m_szValue_set device: 47 service: urn:upnp-org:serviceId:TemperatureSetpoint1_Heat variable: CurrentSetpoint was: 60 now: 61
- or -
Quote
06      04/23/12 6:08:18.545    Device_Variable::m_szValue_set device: 47 service: urn:upnp-org:serviceId:TemperatureSetpoint1_Cool variable: CurrentSetpoint was: 80 now: 79

3. After you're done watching the logs you should disable verbose logging:
VerboseLogging.sh disable

ljcljc

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Re: Can I control VeraLite from my cloud-based program
« Reply #14 on: June 19, 2012, 02:21:20 pm »
Thanks!! mcvflorin

That's really helpful. My log information are as follows

Quote
06      01/04/-30 20:26:50.424  Device_Variable::m_szValue_set device: 4 service: urn:upnp-org:serviceId:TemperatureSensor1 variable: CurrentTemperature was: 72 now: 72 #hooks: 0 upnp: 0 v:0x9e3e80/NONE duplicate:1 <0x2b6b9680>
06      01/04/-30 20:26:56.864  Device_Variable::m_szValue_set device: 4 service: urn:upnp-org:serviceId:HVAC_FanOperatingMode1 variable: Mode was: ContinuousOn now: ContinuousOn #hooks: 0 upnp: 0 v:0x9cd710/NONE duplicate:1 <0x2b6b9680>

It seems that the problems is VeraLite does not poll the setpoint, only polls the temperature and fan mode. Do you have any idea to make it poll the setpoint?

Thanks a lot!!

I don't quite understand this part. Could you explain to me how you get 330 seconds for 10 devices?

If Vera polls a device every 30 seconds then a polling cycle takes 30 seconds * 10 devices = 300 seconds. The next polling cycle begins 30 seconds after the previous polling cycle ended, so 300 seconds + 30 seconds = 330 seconds until the first device in the new polling cycle is polled. I'm not that good at explaining things. :)

Quote
Even if I press the button 'Poll Now' in the web UI, the setpoint does not change. It seems there is some problem with the poll function.

You should SSH into Vera and look in the LuaUPnP.log file.

1. First you must enable verbose logging with the command:
VerboseLogging.sh enable

2. Then watch the logs for lines starting with 06:
tail -f /var/log/cmh/LuaUPnP.log | grep '^06'

After you issue a poll command from the UI you should see something like this in the log file:
Quote
06      04/23/12 6:08:18.545    Device_Variable::m_szValue_set device: 47 service: urn:upnp-org:serviceId:TemperatureSetpoint1_Heat variable: CurrentSetpoint was: 60 now: 61
- or -
Quote
06      04/23/12 6:08:18.545    Device_Variable::m_szValue_set device: 47 service: urn:upnp-org:serviceId:TemperatureSetpoint1_Cool variable: CurrentSetpoint was: 80 now: 79

3. After you're done watching the logs you should disable verbose logging:
VerboseLogging.sh disable