Closed EddyK69 closed 9 months ago
Hey there @dgomes, mind taking a look at this issue as it has been labeled with an integration (utility_meter
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
utility_meter documentation utility_meter source (message by IssueLinks)
Hi,
I have more or less the same issue and perhaps even stranger. I have one source sensor for the watts, which I use in an integration to give me the kWh similar to what you have done in your description. After that I use the Utility Meter integration on 4 levels: hourly, daily, monthly and yearly cycle. The monthly and yearly give device_class: energy and unit_of_measurement: 'kWh', exactly as expected. The other 2, hourly and daily don't do that. The numeric value though is correct for all of them..
state_class: total_increasing
source: sensor.cum_kwh_heat_pump
status: collecting
last_period: 0
last_valid_state: 0.040
meter_period: monthly
cron pattern: 0 0 1 * *
last_reset: 2023-07-05T21:46:05.274063+00:00
unit_of_measurement: kWh
device_class: energy
icon: mdi:counter
friendly_name: kWh Heat Pump MTD
vs
state_class: total_increasing
source: sensor.cum_kwh_heat_pump
status: collecting
last_period: 0
last_valid_state: 0.040
meter_period: daily
cron pattern: 0 0 * * *
last_reset: 2023-07-07T23:00:00.046418+00:00
icon: mdi:flash
friendly_name: Heat Pump Energy
I have multiple set-ups for other 'consumers' working flawlessly. I can't find any typo's, I have searched and searched, modified and tried but so far no results.. I have no clue. A true bug perhaps?
I have the same problem with the daily sensor, not showing unit of measurement. All others (hourly, weekly, monthly, quarterly, yearly) are fine.
I just created this sensors yesterday, because the utility meter I created some weeks/month ago, showed the wrong unit of measurement, namely Wh instead of kWh.
The underlying sensor is a homematic (measuring switch) energy counter and it's energy_counter-reading, which is usually in kWh.
Is there a way to set the unit of measurement for such helpers derived from other sensors after they have been created?
idem if I create it with a certain name it gives me the unit of measurement as I change the name it disappears and in any case the problem is with daily, tried today with yearly reset same problem
Same here, although it's inconsistent.
Natural Gas Daily
, Natural Gas Monthly
, and Water Monthly
have units, but Water Daily
does not.
My config:
utility_meter:
natural_gas_daily:
unique_id: d0740580-f30f-4b61-9ecc-4d3b30ddd18a
source: sensor.meter_gas
name: Natural Gas Daily
cycle: daily
natural_gas_monthly:
unique_id: eccfa12d-4d46-4615-95d6-2c2f789f8f39
source: sensor.meter_gas
name: Natural Gas Monthly
## reset manually; read date is inconsistent
# cycle: monthly
water_daily:
unique_id: 8289b887-cddc-4e14-98fe-6d8ac2673779
source: sensor.meter_water
name: Water Daily
cycle: daily
water_monthly:
unique_id: 10353dfd-449f-45ab-8f47-e17f87e4e158
source: sensor.meter_water
name: Water Monthly
## reset manually; read date is inconsistent
# cycle: monthly
The attributes on sensor.meter_gas
show
state_class: total_increasing
Message Type: SCM
ID: 46510694
Type: 12
TamperPhy: 0
TamperEnc: 0
Consumption: 813780
ChecksumVal: 60701
unit_of_measurement: ft³
device_class: gas
icon: mdi:meter-gas
friendly_name: Gas Meter
and sensor.meter_water
:
state_class: total_increasing
Message Type: SCM
ID: 29947133
Type: 13
TamperPhy: 0
TamperEnc: 0
Consumption: 88429
ChecksumVal: 33263
unit_of_measurement: ft³
device_class: water
icon: mdi:gauge
friendly_name: Water Meter
Same problem here. I have 4 identical sensors for my meter readings (import low and high and export low and high). For all of them i created utility sensors. Two are working correctly and showing kWh. The other 2 dont.
The problem
I made an (hourly reset) Utility Meter of a sensor with unit_of_measurement 'mm' (Rain), but the new sensor doesn't show any unit_of_measurement. If I change the sensors attributes with a manually added unit_of_measurement, it drops it when the reset occures.
What version of Home Assistant Core has the issue?
2023.6.3
What was the last working version of Home Assistant Core?
?
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Utility Meter
Link to integration documentation on our website
https://www.home-assistant.io/integrations/utility_meter/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
The unit of sensor.regen_dit_uur (mm) cannot be converted to the unit of previously compiled statistics (None). Generation of long term statistics will be suppressed unless the unit changes back to None or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
…bit the sensor is not visible there
Additional information
The original sensor sensor.sonoff_th16_schuur_rain:
The Utility Meter sensor.regen_dit_uur: