Skip to content

greeeny101/Hive-Thermostat-Zigbee2MQTT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hive Thermostat Zigbee2MQTT

Configuration for a Hive thermostat that aims to recreate the actions found on the hive remote

Introduction

The climate integration in HA sends MQTT messages to a topic that is incompatible with what is expected from Zigbee2MQTT. This results in the thermostat receiving an unrecognised command. This causes the thermostat to set the occupied heating setpoint to 1 degrees

zigbee2mqtt/heating/set/system_mode  'auto' <-- Climate Integration

zigbee2mqtt/heating/set  {"system_mode": "auto"} <-- Zigbee2MQTT

The same problem can also be seen if you attempt to set a temperature less than 5 degrees. Because temperatures of less than 5 degrees are not supported by the thermostat an error is generated and the same temperature is returned.

The end result of all this is that when you attempt to set a temperature it always jumps back to 1 degrees

How this gets around the problem

I have created a 'Proxy thermostat' using the MQTT HVAC integration. Once connected to a climate component, we can catch the original request and re-publish the request to a new MQTT topic in the correct format. We can then subscribe to this in an automation. When the automation picks this up, we have more control of what actions to take, what needs to be set, when we set this before finally publishing to the thermostat via the MQTT publish service.

We could publish directly to the thermostat, but as I've found out the ordering of the attributes that we publish to the thermostat isn't guaranteed, so it is difficult to issue the correct commands to recreate the actions of the hive remote in HA

i.e. if your thermostat is 'off' and you change the temperature manually, your thermostat shows 'manual'. I want to be able to do the same thing in HA

Requirements

HA Zigbee2MQTT minimum version 1.34.0-1

MQTT HVAC integration

Input number and text Helpers

Simple Thermostat. You can probably use others and adjust the button config accordingly.

alt text

A few things This Does

  • Aims to emulate the actions provided by the thermostat. In particular, schedules set in the thermostat are replicated in the climate component
  • Maximum and Minimum temperature values set to 12 and 32 degrees respectively
  • Frost prevention temperature between 5 and 16 degrees via an input number. Initial 12 degrees
  • Boost temperature between 12 and 32 degrees via an input number. Initial set to 25 degrees
  • Boost duration between 5 and 45 minutes via an input number. Initial set to 25 degrees
  • Uses the cool system mode to emulate the boost function provided by the thermostat Requires a mapping between the cool and boost mode in the heating component to work
  • Prevents 1 degrees temperatures from being set in the component. Where applicable sets the frost prevention temperature instead

Note that initial values will be reloaded when you restart the server. If you don't want this then remove the initial value to preserve the current value following a restart

Simple Thermostat Config (Heating Only (SLR1))

type: custom:simple-thermostat
entity: climate.heating_proxy
hide:
  temperature: true
  state: true
sensors:
  - entity: sensor.heating_local_temperature
    icon: mdi:home-thermometer-outline
    unit: ' °C'
  - entity: sensor.heating_running_state
    icon: mdi:fire
layout:
  mode:
    headings: false
    icons: true
    names: true
control:
  hvac:
    auto:
      name: Schedule
    cool:
      name: Boost
      icon: mdi:heat-wave
header:
  name: Heating


Simple Thermostat Config (Heating & Water (SLR2))

type: custom:simple-thermostat
entity: climate.heating_proxy
hide:
  temperature: true
  state: true
sensors:
  - entity: sensor.heating_local_temperature
    icon: mdi:home-thermometer-outline
    unit: ' °C'
  - entity: sensor.heating_running_state
    icon: mdi:fire
  - entity: sensor.heating_running_state_water
    icon: mdi:water-thermometer
  - entity: sensor.thermostat_battery
    icon: mdi:battery
layout:
  step: row
  mode:
    headings: false
    icons: true
    names: false
control:
  hvac:
    auto:
      name: Schedule
    cool:
      name: Boost
      icon: mdi:heat-wave
    dry: null
  swing:
    auto:
      name: Schedule
    heat:
      name: Water
      icon: mdi:thermometer-water
  name: Heating
header: false