Hive Heating via Zigbee2MQTT, many features do not work

Hi @Burgess101 ,
I tried this but got nowhere… Do I need to do something with MQTT HVAC? The card I added to the dash didn’t do anything but allow a temperature to increase.

@alexcf did you ever get it working without a thermostat? I am struggling to get the relays to switch on and I’m beginning to wonder if the lack of thermostat is the reason.

I ended up having to pair everything back to Hive. The thermostat is the “thing” that kicks it on, so you might well need it. Super annoying if you want HA to control it. The only way I can see a way of doing it is disabling the schedules and having HA do “boosts” when it sees temp dropping. I need to do a proper overhaul!

Yes, you need both the receiver and the thermostat. Whilst you can ignore the thermostat (and use any temps Ensor you like), it is quite accurate and so is useful as such.

My method is to have the Hive App in ‘manual mode’ (in fact the app has been deleted) and everything is controlled via HA. To ensure this works, I have an automation that does everything including ensuing the mode is correct when HA restarts.

The following might help you. Note I have truncated sensor.hive_heating_target_temp as it is a long and not central to this point. The entire package is here if you are interested, but I have tinkered with it since to include a schedule setting that reacts to my house ‘waking up’ with a ‘pre-heat’ to warm the house before ‘waking up’).

input_select: #-----------------------------------------------------------------

  hive_heating_target_mode:
    name: Hive heating mode
    icon: mdi:radiator-disabled
    options:
      - "off"                     # Hive thermostat is in frost protect
      - "heat"                    # Hive thermostat is in manual control

template: #---------------------------------------------------------------------

  - sensor:
      # Mode as reported by HIVE thermostat: off, heat, auto (Hive schedule), emergency_heating (Hive boost)
      #         mum (SLR1c)     James SLR2c:
      # state:  climate.hive    climate.hive_heat
      - name: "Hive heating reported mode"
        unique_id: hive_heating_reported_mode
        state: "{{ states('climate.hive_heat') }}"

      - name: "Hive heating target temp"
        unique_id: hive_heating_target_temp
        device_class: temperature
        unit_of_measurement: °C
        [...]

automation:  #------------------------------------------------------------------

  # set mode and temp
  # Name of receiver is "Hive":
      # SLR1c: zigbee2mqtt/Hive/set
      # SLR2c: zigbee2mqtt/Hive/heat/set
      #     &: zigbee2mqtt/Hive/water/set 
  - alias: Hive heating
    id: "hive_heating"
    description: ''
    mode: queued
    initial_state: true                                     # ensure automation is on at startup
    trigger:
      - platform: template                                  # reset mode if out-of-sync
        value_template: "{{ states('sensor.hive_heating_reported_mode') != states('input_select.hive_heating_target_mode') }}"
      - platform: state
        entity_id: input_select.hive_heating_target_mode    # user sets sets new mode
      - platform: homeassistant
        event: start                                        # set correct mode on startup
      - platform: state
        entity_id: sensor.hive_heating_target_temp          # programme sets new temp
    action:
      - choose:
          - conditions:
              - condition: state
                entity_id: input_select.hive_heating_target_mode
                state: 'off'
            sequence:
              - service: mqtt.publish
                data:
                  topic: zigbee2mqtt/Hive/heat/set
                  payload: |-
                    {
                      "system_mode":"off",
                      "temperature_setpoint_hold":"0"
                    }
          - conditions:
              - condition: state
                entity_id: input_select.hive_heating_target_mode
                state: 'heat'
            sequence:
              - service: mqtt.publish
                data:
                  topic: zigbee2mqtt/Hive/heat/set
                  payload: |-
                    {
                      "system_mode":"heat",
                      "temperature_setpoint_hold":"1",
                      "occupied_heating_setpoint":"{{ states('sensor.hive_heating_target_temp') }}"
                    }
          - conditions:
              - condition: state
                entity_id: input_select.hive_heating_target_mode
                state: 'auto'
            sequence:
              - service: mqtt.publish
                data:
                  topic: zigbee2mqtt/Hive/heat/set
                  payload: |-
                    {
                      "system_mode":"auto",
                      "temperature_setpoint_hold":"1"
                    }
          - conditions:
              - condition: state
                entity_id: input_select.hive_heating_target_mode
                state: 'emergency_heating'
            sequence:
              - service: mqtt.publish
                data:
                  topic: zigbee2mqtt/Hive/heat/set
                  payload: |-
                    {
                      "system_mode":"emergency_heating",
                      "temperature_setpoint_hold":"1",
                      "temperature_setpoint_hold_duration":"{{ states('input_number.hive_heating_boost_time')|float *60 }}",
                      "occupied_heating_setpoint":"{{ states('sensor.hive_heating_reported_current_temp')|float + states('input_number.hive_heating_boost_temp')|float }}"
                    }

I can report greeny101 solution works, but I was using updated fix by

Please Note yaml file config_automation folder was throwing back errors because some brackets were not properly indented

I just ran it trough the https://www.yamllint.com/ to find them and fix them and everything worked after that