I have a question I’d like to seek some help with. I have been generating electricity accumulation sensors through two steps, and I used to be able to add and track them normally in the Energy panel. However, recently, when I added a new one, the generated electricity accumulation sensor already had the ‘total’ and ‘energy’ attributes, but I couldn’t find it in the list to add to the Energy panel. I would appreciate any help or suggestions!
Here is my configuration process and the parameters of the generated sensor:
sensor:
- platform: template
sensors:
dishwasher_power:
value_template: "{{ states('sensor.cuco_cp2d_ff81_electric_power')|float * 1}}"
unit_of_measurement: "W"
device_class: power
friendly_name: Dishwasher Current Power
sensor:
- platform: integration
source: sensor.dishwasher_power
name: Dishwasher Energy Spent
unit_prefix: k
round: 2
method: left
This needs: state_class: measurement. Which the legacy template sensor platform does not support. You should be using the new format for template sensors.
The reason I did this is because the original unit of this sensor was “watt”, which seemed unable to integrate in the second step I mentioned above to obtain the power consumption value. Some of my other power sensors are in kW units. I want to establish a unified template to convert to W for calculation. When the unit is kW, divide by 1000 (I remember Integration - Riemann sum integral seems to require W as the unit, I don’t know if my understanding is correct). Thank you again for your reply!
This sensor is really not very standardized, so the newbie in me only thought of this method to create a new sensor to handle it. Looks like a lot of my previous understanding was wrong, thanks for the correction!
Well, it’s a power sensor provided on a smart plug(outlet). Based on my previous knowledge, I just thought of creating a new sensor with a value *1, as you just looked at the correction.