Hello
For the new energy integration available in 2021.08, i need to define an energy sensor.
I use an OWL cm180i meter with 3 clamps.
Each clamp gives me a ‘Power’ information. I use the Riemann integration to transform Power in Energy.
The question is 'how to set the device_class: energy to the energy sensor provided by the Riemann integration
a) device_class: energy in the Riemann integration sensor is not allowed
b) use of customize_glob is not working
sensor.*_kWh_*:
last_reset: "1970-01-01T00:00:00+00:00"
device_class: energy
state_class: measurement
#
and the status
is this a feature request ?
or any other idea ?
Thanks for your suggestion
myle
(StePhan McKillen (Other kiwi Here))
August 6, 2021, 3:30pm
2
here what I did
added
device_class: energy
state_class: measurement
unit_of_measurement: "kWh"
to the MQTT Platform
then in the customize.yaml added
sensor.washing_energy_today:
last_reset: "2021-07-30T00:00:00+00:00"
for all the
state_class:
note it error in VSC think that update is coming
but did the config check
and restart
and I see them in the list now
koying
(Chris B)
August 6, 2021, 3:40pm
3
From the source code, if the source entity has a “power” device_class, the integrated entity will automatically have the “energy” device_class.
3 Likes
Here the source entity status: (device_class: power)
the riemann integration
platform: integration
source: sensor.chauffage_en_watt
name: Compteur Chauffage kWh
unit_prefix: k
method: left
round: 2
unit: kWh
#device_class: energy
#state_class: measurement
and the status of the integrated entity
Obviously the integrated entity does not have the energy device_class.
Do you think it’s a bug ?
Thanks
I’m running core-2021.8.1
I will wait tll tomorrow and see
What do you call a cycle ? Is it related to statistics ?
koying
(Chris B)
August 6, 2021, 4:50pm
7
Merangle:
What do you call a cycle
The “unit_time” of integration, which is “h” by default.
I’ve just checked and good news !
I have 3 different sensors with the same structure :
2 are activated and have the device_class; energy
1 (the one I was looking for) is dormant with no measure (chauffage means heater) with no device_class:energy
This solve the issue
Thanks
koying
(Chris B)
August 6, 2021, 5:00pm
9
Cool. I’ve updated my previous post. The code indeed only adds the device_class after the source entity state has been updated at least once.