[How-To] Map a thermostat from Home Assistant to Vera
-
I've recently moved my Nest Thermostats from Vera to Home Assistant, using the official integration. This is a how-to migrate it completely on Home Assistant, thus retaining control and status in your Vera (i.e.: because you have code/scenes/Reactor rules/whatever to maintain - in my case it was all the above and more).
Prerequisite: goto https://github.com/dbochicchio/vera-VirtualDevices and install the virtual heater/thermostats files. Follow instructions, if in doubt.
First, go to your Vera, enter your thermostat Advanced Settings, under Params be sure to remove the plugin, by setting its value to 0. Then
- change device_file to D_VirtualThermostat1.xml
- change impl_file to I_VirtualHeater1.xml
- change device_json to D_VirtualThermostat1.json
- change subcategory_num to 1 (if necessary)
Repeat for other thermostats - you could use the first as master, so look for the doc for more info on this point. Be sure to remove the plugin from humidity sensors as well.
After the luup reload, hard refresh (CTRL+F5) your browser and then set all these variables to skip (we will not execute actions on setpoint/mode changes, we'll just save variables).
- SetPowerURL
- SetPowerOffURL
- SetSetpointURL
At this point, the actions to change mode/setpoint will write your desired value to SetpointTarget and ModeTarget variables. We will use them in MSR to get the actions and execute them in Home Assistant.
Under MSR, be sure to write two rules.
One rule is watching for SetpointTarget and ModeTarget variables under the Vera Virtual Thermostat, to execute the actions on your thermostat.You'll need to translate the values from Vera's mode (Off, HeatOn, CoolOn) to HASS one (off, heat, cool). Since this thermostat is heating only, I'm just translating the ones I have. Repeat these steps for every device you have.
Then, you'll need to write a rule looking for temperature, setpoints, mode and so on. I have a unique rule to synchronize all of them, so I'm looking for humidity entity, temperature entity, and thermostat to update the Vera's variable. I have a set of expressions to translate to Vera's friendly variables:
You'll need to just set the variables like this:
Variables involved:
Service Variables Value urn:upnp-org:serviceId:TemperatureSensor1 CurrentTemperature ${{temperature}} urn:micasaverde-com:serviceId:HumiditySensor1 CurrentLevel ${{humidity}} urn:upnp-org:serviceId:TemperatureSetpoint1 CurrentSetpoint ${{setpoint}} urn:upnp-org:serviceId:TemperatureSetpoint1_Heat CurrentSetpoint ${{setpoint}} urn:upnp-org:serviceId:TemperatureSetpoint1 SetpointAchieved ${{setpointachieved}} urn:upnp-org:serviceId:TemperatureSetpoint1_Heat SetpointAchieved ${{setpointachieved}} urn:upnp-org:serviceId:HVAC_UserOperatingMode1 ModeStatus ${{modestatus}} urn:micasaverde-com:serviceId:HVAC_OperatingState1 ModeState ${{modestate}} urn:upnp-org:serviceId:HVAC_UserOperatingMode1 EnergyModeStatus ${{energymodestatus}} Just repeat these steps for every thermostat and you should be good to go. It could be adapted for a different mix of devices/systems, of course. I hope this will help someone else achieving the same results! Now we can control the thermostat from both point and everything is in sync!