We have moved at community.getvera.com

Author Topic: Zwave, Thermostat Coding question  (Read 2641 times)

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Zwave, Thermostat Coding question
« on: June 03, 2011, 08:12:35 pm »
I am writing code to talk to thermostats....I notices that there are some feautures that Vera doesn't make available for whatever reason. Is there any way to access Zwave output commands using Luup code or HTTP?
Regards
Tim Alls
« Last Edit: June 04, 2011, 12:47:32 pm by TimAlls »

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Zwave, Thermostat Coding question
« Reply #1 on: June 04, 2011, 12:52:47 pm »
I am new to this so be patient!
If I want to know what commands are available for a device I don't have....in this case a thermostat, should I look at the D_HVAC_ZoneThermostat1.xml. file.....goto this section:

and gather the list of accepted commands? Is this the best place?
Thanks
Tim

</serviceList><sceneList>
{
   "group_1":{
      "cmd_1":
      {
         "label": "OFF",
         "serviceId": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
         "action": "SetModeTarget",
         "arguments":
         {
            "NewModeTarget": "Off"
         }
      },
      "cmd_2":
      {
         "label": "COOL",
         "serviceId": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
         "action": "SetModeTarget",
         "arguments":
         {
            "NewModeTarget": "CoolOn"
         }
      },
      "cmd_3":
      {
         "label": "HEAT",
         "serviceId": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
         "action": "SetModeTarget",
         "arguments":
         {
            "NewModeTarget": "HeatOn"
         }
      },
      "cmd_4":
      {
         "label": "AUTO",
         "serviceId": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
         "action": "SetModeTarget",
         "arguments":
         {
            "NewModeTarget": "AutoChangeOver"
         }
      }
   },
   "group_2":{
      "cmd_1":
      {
         "label": "Set Heat Setpoint",
         "serviceId": "urn:upnp-org:serviceId:TemperatureSetpoint1_Heat",
         "action": "SetCurrentSetpoint",
         "argumentList":
         {
            "argument_1" :
            {
               "dataType": "ui1",
               "defaultValue": "",
               "allowedValueRange" :
               {
                  "minimum": "0",
                  "maximum": "100"
               },
               "prefix": "to",
               "suffix": "°",
               "name": "NewCurrentSetpoint"
            }
         }
      }
   },
   "group_3":{
      "cmd_1":
      {
         "label": "Set Cool Setpoint",
         "serviceId": "urn:upnp-org:serviceId:TemperatureSetpoint1_Cool",
         "action": "SetCurrentSetpoint",
         "argumentList":
         {
            "argument_1" :
            {
               "dataType": "ui1",
               "defaultValue": "",
               "allowedValueRange" :
               {
                  "minimum": "0",
                  "maximum": "100"
               },
               "prefix": "to",
               "suffix": "°",
               "name": "NewCurrentSetpoint"
            }
         }
      }
   },
   "group_4":{
      "cmd_1":
      {
         "label": "Set Fan On",
         "serviceId": "urn:upnp-org:serviceId:HVAC_FanOperatingMode1",
         "action": "SetMode",
         "arguments":
         {
            "NewMode": "ContinuousOn"
         }
      },
      "cmd_2":
      {
         "label": "Set Fan Auto",
         "serviceId": "urn:upnp-org:serviceId:HVAC_FanOperatingMode1",
         "action": "SetMode",
         "arguments":
         {
            "NewMode": "Auto"
         }
      }
   },
   "group_5":{
      "cmd_1":
      {
         "label": "Normal",
         "serviceId": "urn:upnp-org:serviceId:SwitchPower1",
         "action": "SetTarget",
         "arguments":
         {
            "newTargetValue": "1"
         }
      },
      "cmd_2":
      {
         "label": "Energy Save",
         "serviceId": "urn:upnp-org:serviceId:SwitchPower1",
         "action": "SetTarget",
         "arguments":
         {
            "newTargetValue": "0"
         }
      }
   }
}   
 

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Zwave, Thermostat Coding question
« Reply #2 on: June 04, 2011, 08:48:19 pm »
Never mind......it must be right because it all works!
I am still curious about Zwave commands though....anyone know?
Tim

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Zwave, Thermostat Coding question
« Reply #3 on: June 04, 2011, 09:44:22 pm »
I am still curious about Zwave commands though....anyone know?
The ZWave Protocol spec isn't available to mere mortals, and requires a signed NDA, etc, etc to get.

I suspect if you had that, you could use things like the SendData method defined in S_ZWaveNetwork1.xml, likely against deviceId 0 (or 1, who knows) to send the "right" data out.

As it's all undocumented (to us), and there are no examples, I've avoided the temptation to call it with values...

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Zwave, Thermostat Coding question
« Reply #4 on: June 04, 2011, 10:18:25 pm »
I am still curious about Zwave commands though....anyone know?
The ZWave Protocol spec isn't available to mere mortals, and requires a signed NDA, etc, etc to get.

I suspect if you had that, you could use things like the SendData method defined in S_ZWaveNetwork1.xml, likely against deviceId 0 (or 1, who knows) to send the "right" data out.

As it's all undocumented (to us), and there are no examples, I've avoided the temptation to call it with values...
I thought that might be the case....oh well.
I am figuring it out.....baby steps!
Here is what I am up to.....

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Zwave, Thermostat Coding question
« Reply #5 on: June 04, 2011, 10:22:20 pm »
Cool, looks like it's nice and warm down there.  It's cold and wet up in NorCal at the mo...

What does the Buffer parameter represent?

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Zwave, Thermostat Coding question
« Reply #6 on: June 04, 2011, 10:33:03 pm »
Cool, looks like it's nice and warm down there.  It's cold and wet up in NorCal at the mo...

What does the Buffer parameter represent?

It shows the number of samples taken....the graph will be more informative after it runs a while. I have it set to sample once a minute with a max buffer size set to 24 hours.
I am thinking about doing similar graphs for lights as well......history charts can be quite informative.

Stay Warm
Tim