It recently noticed the following error in my log:
Entity sensor.gas_netbeheerkosten_totaal (<class ‘homeassistant.components.template.sensor.SensorTemplate’>) is using state class ‘total_increasing’ which is impossible considering device class (‘monetary’) it is using; expected None or one of ‘total’
The configuration of the sensor is below. I don’t understand why monetary can’t be total increasing. I think i added device_class: monetary because otherwise it doesn’t show up in the energy dashboard. But i am not sure anymore.
- name: "Gas netbeheerkosten totaal"
unit_of_measurement: "EUR"
device_class: monetary
state_class: total_increasing
state: >-
{{ (((now().strftime('%j')|float ) + (now().year - 2023) * 365) * (states('input_number.netbeheerkosten_gas' )|float() / 365) ) | round(3) }}
Background: i use this as a fixed amount of cost for the gas/power. In Holland we have variable cost but also fixed cost per year for energy. So i added a utilitymeter that stays 0 and the above cost sensor that will increase every day. It actually works fine.