I would like to get an average temperature of a TRV that has the following state attributes:
- 'off'
- heat
min_temp: 5
max_temp: 30
target_temp_step: 0.5
preset_modes:
- none
- auto
- manual
- holiday
current_temperature: 15.8
temperature: 17
preset_mode: manual
battery_low: false
boost_timeset_countdown: 0
child_lock: UNLOCK
comfort_temperature: 19
current_heating_setpoint: 17
eco_temperature: 17
error_status: 0
fault_alarm: 0
frost_protection: 'OFF'
heating_stop: 'OFF'
holiday_start_stop: 2021/01/01 01:01 | 2021/01/01 01:01
holiday_temperature: 17
last_seen: '2022-12-03T14:14:17+01:00'
linkquality: 25
local_temperature: 15.8
local_temperature_calibration: 0
online: 'ON'
open_window: 'OFF'
open_window_temperature: 19
preset: manual
schedule_friday: 06:00/17 12:00/21 14:00/17 17:00/21 24:00/17
schedule_monday: 06:00/17 12:00/21 14:00/17 17:00/21 24:00/17
schedule_saturday: 06:00/17 12:00/21 14:00/17 17:00/21 24:00/17
schedule_sunday: 06:00/17 12:00/21 14:00/17 17:00/21 24:00/17
schedule_thursday: 06:00/17 12:00/21 14:00/17 17:00/21 24:00/17
schedule_tuesday: 06:00/17 12:00/21 14:00/17 17:00/21 24:00/17
schedule_wednesday: 06:00/17 12:00/21 14:00/17 17:00/21 24:00/17
system_mode: heat
update:
installed_version: unknown
state: idle
update_available: false
working_day: mon_sun
friendly_name: Radiator
supported_features: 17
I’m trying to get an average temperature from that sensor, but can’t get it to work with either the statistics or the history_stat platform. Since it’s state is heat I’m getting an unknow in the statistics platform and can’t figure out how the single out the state attribute in that platform. The history_stat platform isn’t suitable for this since it’s used for counting the time of a certain state.
What I’m trying to achieve is to get a weekly or monthly average of my TRV temperature and of my Aquara sensor, the difference between the two will my “local_temperature_calibration”-value in the TRV.