sensor:
- name: "Geyser Power"
icon: mdi:water-boiler
unit_of_measurement: W
device_class: power
state: >-
{# the geyser is the only device on the non-essential circuit #}
{% set geyser = states('sensor.load_power_non_essential') | int(0) %}
{{ geyser if geyser > 0 else 0 }}
This is the energy sensor:
- platform: integration
name: "Geyser Energy"
source: sensor.geyser_power
unit_prefix: k
unit_time: h
method: left
round: 3
Your source power sensor is missing a state class.
sensor:
- name: "Geyser Power"
icon: mdi:water-boiler
unit_of_measurement: W
device_class: power
state_class: measurement ### <---- This
state: >
{# the geyser is the only device on the non-essential circuit #}
{% set geyser = states('sensor.load_power_non_essential') | int(0) %}
{{ geyser if geyser > 0 else 0 }}
After restarting you may have to go to Developer Tools → Statistics to fix an issue.
Bugger, I was wondering whether it could have to do with the state class — of the energy sensor, not the power sensor, but the energy sensor has one.
The error message is a little misleading.
Do you know why the underlying source sensor’s state class affects it in this way, because the energy sensor has everything it needs? Unless, it doesn’t like the state class of total or sees some mismatch of sorts.
I’ll implement your suggestion over the weekend and report back. (I’m going to be out of commission for a few days.)