HA 2021.9.2 with a Zigbee (ZHA) based power switch (working fine), which provides this sensor:
sensor.kitchen_coffee_pot_power_meter
State: 93.7
state_class: measurement
unit_of_measurement: W
friendly_name: Kitchen Coffee Pot Power Meter
device_class: power
Trying to use the integration platform to make a sensor to convert to kWh:
sensor:
- platform: integration
source: sensor.kitchen_coffee_pot_power_meter
name: kitchen_coffee_pot_power_energy
unit_prefix: k
round: 3
Seems simple enough based on the documentation page, but can’t figure out what I did wrong to keep getting this message each time the source sensor changes state:
2021-09-05 06:00:31 ERROR (MainThread) [homeassistant.helpers.event] Error while processing state change for sensor.kitchen_coffee_pot_power_meter
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 272, in _async_state_change_dispatcher
hass.async_run_hass_job(job, event)
File "/usr/src/homeassistant/homeassistant/core.py", line 433, in async_run_hass_job
hassjob.target(*args)
File "/usr/src/homeassistant/homeassistant/components/integration/sensor.py", line 151, in calc_integration
self._unit_of_measurement = self._unit_template.format(
AttributeError: 'IntegrationSensor' object has no attribute '_unit_template'