No announcement yet.

Question about updating hubitat created device in HS3 not mirrored back to Hubitat

  • Filter
  • Time
  • Show
Clear All
new posts

    Question about updating hubitat created device in HS3 not mirrored back to Hubitat

    I created a device in hubitat using the Virtual Temperature device. I connected it to HS3 fine. When I update the temp value in Hubitat it updates the device in HS3. When I update the value of the device in HS3 it does not update in Hubitat. Am I missing something here? Thanks.

    The plugin debug file contains the disclosure of what commands Hubitat accepts for the device and for what command was send by the pluign. Cannot do much without the data.


      Sorry - should have been clearer. I don't see anything in the debug file when I update the device in HS3. Here is what I see when I update the device in Hubitat:

      {"name":"Home Office Temperature (Virtual)","label":"Home Office Temperature (Virtual)","type":"Virtual Temperature Sensor","id":"897","date":"2021-02-06T01:31:54+0000","model":null,"manufacturer":null,"capabili ties":["TemperatureMeasurement"],"attributes":{"temperature":"75","dataType":"NUMBER","value s":null},"commands":[{"command":"setTemperature"}]}

      I am updating the HS3 device with the following command: &hs.SetDeviceValueByRef(3938, hs.Devicevalue(3123), True)
      3938 is the hubitat device.

      Is there anything else I can provide to help diagnose this? Thanks.


        I did a little more experimenting. I created a virtual thermostat in hubitat and then shared that with homeseer.

        When I update the Ambient Temperature in Hubitat through the SetTemperature button the new temperature reflects in Homeseer in the TemperatureMeasurement device within the thermostat in Homeseer.

        When I update the TemperatureMeasurement device value directly in homeseer then it does not update in Hubitat. So essentially the same thing that happened with the Virtual Temperature device.

        When I update the SetTemperature in Hubitat I get this information in the debug:

        2/6/2021 7:59:08 AM 41221476 | Message received: { "source":"DEVICE","name":"temperature","displayName" : "Home Office Heat", "value" : "70", "unit":"°F","deviceId":898,"hubId":0,"installedAppId":0,"des criptionText" : "Home Office Heat temperature is 70 \u00B0F"}

        When I update the TemperatureMeasurement device in Homeseer there is no entry in the debug.

        This is what I see in the debug for the virtual thermostat:

        {"name":"Home Office Heat","label":"Home Office Heat","type":"Virtual Thermostat","id":"898","date":"2021-02-06T12:41:08+0000","model":null,"manufacturer":null,"capabili ties":["Actuator","TemperatureMeasurement","Thermostat","Sensor "],"attributes":{"thermostatFanMode":"auto","dataType":"NUM BER ","values":null,"supportedThermostatFanModes":"[auto, circulate, on]","supportedThermostatModes":"[auto, cool, emergency heat, heat, off]","coolingSetpoint":"75.0","thermostatMode":"off","sched ule" :null,"temperature":"68.0","thermostatSetpoint":"68.0","heat ingSetpoint":"68.0","thermostatOperatingState":"idle","hyste resis":"0.5"},"commands":[{"command":"setSupportedThermostatFanModes"},{"command":" hea t"},{"command":"auto"},{"command":"setThermostatMode"},{" com mand":"setThermostatOperatingState"},{"command":"setThermost atFanMode"},{"command":"cool"},{"command":"emergencyHeat"},{ "command":"fanCirculate"},{"command":"fanAuto"},{"comman d":" off"},{"command":"setCoolingSetpoint"},{"command":"setHeati n gSetpoint"},{"command":"setSupportedThermostatModes"},{"comm and":"setThermostatSetpoint"},{"command":"setSchedule"},{"c o mmand":"fanOn"},{"command":"setTemperature"}]},



          The plugin did not have a setTemperture command implemented for a temperature measurement. It is in at

          Click image for larger version

Name:	Capture.PNG
Views:	65
Size:	16.8 KB
ID:	1454586

          The easiest way to get the control, after updating the plugin, is to use the Config page setting to mark the existing virtual temperature sensor to exclude. This will remove the child device and leave the root device.. Uncheck it and use the Connect - Rescan button. This will recreate the child device and it will have the submit control.


            Thanks - that did the trick. Next question - how do I copy a value into the device and set the temperature?

            I am trying to take the value out of another sensor and set the temperature with this value. I was using the following to copy the values - &hs.SetDeviceValueByRef(3938, hs.Devicevalue(3123), True) - this does update the device value but doesn't set the temperature so doesn't reflect in hubitat.

            Is this something I have to do through scripting? And if so what is the syntax? Thanks.


              I suspect the easiest way to do it is with event that triggers when your source temperature changes and the an action that sets the Hubitat device using the $$DVR(xxx): or similar replacement variable. I have not done it myself, but the HS3Help.pdf should have examples for replacement variables. If you do it via scripting the it is CAPI control that is needed to command the Hubitat device.


                Thanks, I am assuming I need to dig into CAPI control as very little is exposed through the event creation. When I look at the TemperatureMeasurement field all I have is the ability to select from a dropdown list. Also, the other thermostat elements do not appear in the "Control a Device" dropdown - such as HeatingSetPoint, ThermostatMode etc. so assuming I can't control any of them without CAPI control? Thanks.

                Click image for larger version

Name:	Screen Shot 2021-02-07 at 9.21.32 AM.png
Views:	60
Size:	69.6 KB
ID:	1454686


                  This is a quirk of how HS handles values in events. While the device is setup to be a text box entry, the event UI is always a selector. Same in HS4.

                  I believe the CAPI control for this would be as below. Not tested, but should give you the idea.

                  Dim oCAPI as CAPIControl = hs.CAPIGetSingleControlByUse(refOfHubitatTemperatureDevice,HomeSeerAPI.ePairControlUse.Not_Specified)
                  oCAPI.ControlValue = hs.DeviceValue(refOfOtherDevice)


                    Thanks - I used this and information from tenscriptaid and I can indeed update the devices through scripts.