core: Reimann sum missing units

The problem

Hello everyone,

I am using the Riemann sum to calculates energy consumption. Dir some reason, HA does not seem to assign the correct unit to all of them (see Screenshot).

If youlook at Boiler 1, 2 and 3 you can see that although the respective information is always coming from sensor.shellyx_power_0 , not all are assigned the unit Wh (all sensors are originally in Watts). So three identical Shelly 1PM.

This also applies to some of the other sensors.

As it stands, the new energy integration cannot recognize them.

What is version of Home Assistant Core has the issue?

current

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Riemann sum

Link to integration documentation on our website

No response

Example YAML snippet

The Riemann sum YAML is always identical for all devices. The only thing I varied is the name and sensor. No other options chosen. `sensor: #Gosund/Tasmota

  • platform: integration source: sensor.plasma_energy_power name: energy_plasma_riemann method: left

  • platform: integration source: sensor.travel_energy_power name: energy_travel_riemann method: left

  • platform: integration source: sensor.tasmota_energy_power_3 name: energy_sonyxf9005_riemann method: left

  • platform: integration source: sensor.tasmota_energy_power name: energy_fridge_riemann method: left

#Shelly

  • platform: integration source: sensor.shelly_2_5_4e_power_0 name: energy_ambient_dr_0_riemann method: left

  • platform: integration source: sensor.shelly_2_5_4e_power_1 name: energy_ambient_dr_1_riemann method: left

  • platform: integration source: sensor.shelly_2_5_4d_power_0 name: energy_lightswitch_dr_0_riemann method: left

  • platform: integration source: sensor.shelly_2_5_4d_power_1 name: energy_lightswitch_dr_1_riemann method: left

  • platform: integration source: sensor.shelly_2_5_d_power_0 name: energy_lightswitch_lr_0_riemann method: left

  • platform: integration source: sensor.shelly_2_5_d_power_1 name: energy_lightswitch_lr_1_riemann method: left

  • platform: integration source: sensor.shelly_1pm_1_power_0 name: energy_boiler_1_riemann method: left

  • platform: integration source: sensor.shelly_1pm_2_power_0 name: energy_boiler_2_riemann method: left

  • platform: integration source: sensor.shelly_1pm_3_power_0 name: energy_boiler_3_riemann method: left`

Anything in the logs that might be useful for us?

No response

Additional information

Shelly with stock firmware and connected to HA via MQTT. Gosund sockets running Tasmota and connected via MQTT.

As you can see, it is not device dependent. Boiler 1, Boiler 2 and Boiler 3 are all Shelly 1 PM. However, Boiler 3, so the third phase of the three phase boiler, is only active when you trigger the water heater manually. So almost never. But it has happened and I did so just two days ago. Just to see that HA is working (before noticing that HA does not know the unit).

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

Looking at the code, this is actually the expect behavior. 😊 unit_of_measurement and decice_class is not set until it gets its first update, which will happen after sometime. I am not sure how much time is needed to elapse before this happens. â˜šī¸