OK, so I use Hive also. Firstly, I calibrate my Hue motion sensors. I put them all together once a year and work out the differences between them and my Hive thermostat (which I consider to be the most accurate. Then I create template sensors as follows:
template:
- sensor:
# last calibration on 2022-11-07
# float() set to give 15 ℃ after calibration offset
# Offset & round-off Hue temperature sensors -----------------------------------
- name: "Hallway temp"
unique_id: hallway_temp
device_class: temperature
unit_of_measurement: °C
state: "{{ ( states('sensor.hallway_motion_temperature') | float(13.8) +1.2 ) | round(1) }}"
- name: "Living room temp"
unique_id: living_room_temp
device_class: temperature
unit_of_measurement: °C
state: "{{ ( states('sensor.livingroom_motion_temperature') | float(13.7) +1.3 ) | round(1) }}"
- name: "Study temp"
unique_id: study_temp
device_class: temperature
unit_of_measurement: °C
state: "{{ ( states('sensor.study_motion_temperature') | float(14.1) +0.9 ) | round(1) }}"
- name: "Landing temp"
unique_id: landing_temp
device_class: temperature
unit_of_measurement: °C
state: "{{ ( states('sensor.landing_motion_temperature') | float(13.8) +1.2 ) | round(1) }}"
- name: "Bedroom 1 temp"
unique_id: bedroom_1_temp
device_class: temperature
unit_of_measurement: °C
state: "{{ ( states('sensor.bedroom_1_motion_temperature') | float(13.7) +1.3 ) | round(1) }}"
- name: "Bedroom 2 temp"
unique_id: bedroom_2_temp
device_class: temperature
unit_of_measurement: °C
state: "{{ ( states('sensor.bedroom_2_motion_temperature') | float(13.7) +1.3 ) | round(1) }}"
- name: "Bedroom 3 temp"
unique_id: bedroom_3_temp
device_class: temperature
unit_of_measurement: °C
state: "{{ ( states('sensor.bedroom_3_motion_temperature') | float(13.7) +1.3 ) | round(1) }}"
- name: "Front temp"
unique_id: front_temp
device_class: temperature
unit_of_measurement: °C
state: "{{ states('sensor.front_motion_temperature') | float(15.0) |round(1) }}"
- name: "Patio temp"
unique_id: patio_temp
device_class: temperature
unit_of_measurement: °C
state: "{{ states('sensor.patio_motion_temperature') | float(15.0) |round(1) }}"
# others -----------------------------------------------------------------------
- name: "Hottest temp"
unique_id: hottest_temp
device_class: temperature
unit_of_measurement: °C
state: >
{% set sensors = expand(
'sensor.hive_heating_reported_current_temp',
'sensor.hallway_temp',
'sensor.living_room_temp',
'sensor.study_temp',
'sensor.landing_temp',
'sensor.bedroom_1_temp',
'sensor.bedroom_2_temp',
'sensor.bedroom_3_temp')
%}
{{ sensors
| rejectattr('state','in',['unavailable','unknown'])
| map(attribute='state')
| map('float')
| max
}}
- name: "Coldest temp"
unique_id: coldest_temp
device_class: temperature
unit_of_measurement: °C
state: >
{% set sensors = expand(
'sensor.hive_heating_reported_current_temp',
'sensor.hallway_temp',
'sensor.living_room_temp',
'sensor.study_temp',
'sensor.landing_temp',
'sensor.bedroom_1_temp',
'sensor.bedroom_2_temp',
'sensor.bedroom_3_temp')
%}
{{ sensors
| rejectattr('state','in',['unavailable','unknown'])
| map(attribute='state')
| map('float')
| min
}}
If you want to average 3 temp sensors, you can create another sensor:
- name: "average thermostat temp"
unique_id: average_thermostat
device_class: temperature
unit_of_measurement: °C
state: {{ (
states('sensor.temp1')|float()
+ states('sensor.temp2')|float()
+ states('sensor.temp3')|float()
) / 3 }}
I split it out on multiple lines to make it easier to read. It’ll work on multiple lines or a single line.
you can then set the Hive target temp as follows:
- service: climate.set_temperature
data_template:
temperature: "{{ states('sensor.average_thermostat_temp') |float(15) }}"
entity_id: climate.thermostat
or simply turn the hive on or off dependant on whether that average_thermostat_temp
sensor has hit the target you want. So you could create an input number:
input_number:
hive_heating_target_temp:
name: "Hive target"
unit_of_measurement: °C
min: 5
max: 15
step: 0.5
icon: mdi:thermostat
…and then have an automation that turns the Hive on and off dependent on where sensor.average_thermostat_temp
is relative to the input_number. hive_heating_target_temp
I (sort of) do this as a have completely replaced my Hive app with logic in HA. However, I have not replaced the Hive thermostat with my Hue motion sensors.
My Hive thermostat is mobile (I honestly thought they all were), so I simply put it in the room that I want given the time of year (in your case, one of the bedrooms). If yours is fixed, perhaps changing over to the mobile one would be the easiest route?
[edited for typos and clarity]