#I m having trouble using state class

1 messages · Page 1 of 1 (latest)

delicate edge
#

in my sensors.yaml I have this:

- platform: template sensors: ups_power_usage: friendly_name: "UPS Power Usage" unit_of_measurement: "kWh" value_template: "{{ (states('sensor.ups_load_2') | float / 100) * 900 / 1000 }}" state_class: total_increasing device_class: energy

twin egret
#

That's indeed the legacy format, which doesn't support state class

delicate edge
#

copy that... if I create a templates.yaml and !include it, do I have to move every template entity over, or can I just create this new one and any new ones going foward?

twin egret
#

You can use them besides each other

delicate edge
#

super helpful, thanks. Last question, will quick reload load new/updated template entities or do I need to do a full bound?

#

bounce

twin egret
#

You might need a restart if you didn't use the template integration before

delicate edge
#

got it! Thanks again!

#

this worked... but the device still isn't available to the energy dashboard .... thought I'd emulated other engergy meter devices successfully

twin egret
#

What are the current attributes for your new sensor?

delicate edge
#

state_class: measurement
unit_of_measurement: kWh
device_class: energy
icon: mdi:server
friendly_name: UPS Power Usage

#

the current state is 0.0.667

#

oops 0.667

twin egret
#

Check in devtools > statistics for issues with the sensor