Average platform problem

Anyone having a problem with the “platform: average” since 2023.11?
I use it for 4 power sensors to get average power today and then energy today through a template sensor. The chain stopped working after i did the 2023.11 update, with the average being the problem as I see it.
In addition, checking the config file throws 4 instances of the error

Platform error sensor.average - No module named 'homeassistant.util.temperature'

Googling tells me that that that module was deprecated a year ago, so I’m guessing it was finally removed in 2023.11 and that’s why the average platform no longer works!

For the record, here is one of my 4 ‘chains’…

sensor:
  - platform: average
    name: 'Desk Average Power'
    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    end: '{{ now() }}'
    entities: sensor.study_socket_power_left
  - platform: template
    sensors:
      desk_energy_today:
        value_template: "{{ '%0.2f'|format(states('sensor.desk_average_power')|float / 1000 * (now().hour + now().minute/60)) }} " 
        unit_of_measurement: "kWh"
        device_class: energy

``
1 Like

Solved. I needed to update the HACS Average module to v2.3.1. I’d forgotten it was even a HACS thing!

3 Likes

Thanks for posting this solution. I also ran into this after updating this morning, and forgot it was a hacs thing!