[Utility Meter] changing source for an existing select object

Hi.

I’ve modified a utility_meter source which used to be in Wh to one that is in kWh ; unfortunately, while somehow the energy screen seems to understand it’s now in kWh and treat it as such for calculating the pricing;

the sensor card shows the kWh value with a unit of Wh.

How can I fix that ?
Thanks

What sensor card?

Well, whatever the name of that thing is:

so all those values are in kWh, yet the unit shown is Wh.

Give it 24 hours for the history to clear then look again.

Hmmm. I’ve changed the source of my utility meter over 2 days ago already.

I meant a

- type: entity
  entity: sensor.daily_purchased_energy_total

card

Have you tried clearing your web bro cache?

Just did. Makes no difference.

Also, not related to this but how do you clear the cache in the HA iPhone app?

In case it wasn’t clear. Wh used to be the unit used by the source. But now it is kWh

Mobile App Settings → Debugging → Clear frontend cache. Then pull down on the display (in a dashboard view) to refresh.

Go to Developer Tools → Statistics. Are there and issues listed that you can fix there?

nope. There were heaps about long term stats not being linked to a sensor (I’ve deleted a few this week). But nothing.

I’ve cleared the cache on the mobile app.
Restarted HA many many times.

Still in Wh

This is the definition of my utility_meter

daily_exported_energy:
  source: sensor.eagle_200_total_meter_energy_received
  name: Daily Exported Energy
  unique_id: daily_exported_energy
  cycle: daily

daily_purchased_energy:
  source: sensor.eagle_200_total_meter_energy_delivered
  name: Daily Purchased Energy
  unique_id: daily_purchased_energy
  cycle: daily
  tariffs:
    - peak
    - offpeak

and sensor.eagle_200_total_meter_energy_delivered
shows as:

unit_of_measurement: kWh
device_class: energy
friendly_name: Eagle-200 Total Meter Energy Delivered

the sensor created by the utility_meter:
sensor.daily_purchased_energy_offpeak

state_class: total_increasing
unit_of_measurement: Wh
device_class: energy
icon: mdi:counter
friendly_name: Daily Purchased Energy offpeak
source: sensor.eagle_200_total_meter_energy_delivered
status: collecting
last_period: '58.334000'
last_valid_state: '17566.575000'
meter_period: daily
cron pattern: 0 0 * * *
tariff: offpeak
last_reset: '2023-05-25T14:00:00.121941+00:00'

so it is in Wh; but the source is in kWh so I’m confused.

I ended up wiping core.restore_state

And nuking the database, the energy dashboard was all screwed up anyway as HA really doesn’t handle roll over well at all. Had massive values in there screwing up all the stats

Well, I’m a bit of a loss. I deleted the database (had been wanting to migrate from mysql back to sqlite for a while)
Deleted .storage/core.restore_state and .storage/core.entity_registry

Now all my utility_meter sensor entities are now in kWh, but one. Which is the only one that isn’t used for calculating peak/off-peak tariff:

daily_exported_energy:
  source: sensor.eagle_200_total_meter_energy_received
  name: Daily Exported Energy
  unique_id: daily_exported_energy
  cycle: daily

sensor.eagle_200_total_meter_energy_received has the following attributes:

state_class: total_increasing
unit_of_measurement: kWh
device_class: energy
friendly_name: Eagle-200 Total Meter Energy Received

yet sensor.daily_exported_energy is unit-less

state_class: total_increasing
source: sensor.eagle_200_total_meter_energy_received
status: collecting
last_period: '0'
last_valid_state: '2436.589000'
meter_period: daily
cron pattern: 0 0 * * *
last_reset: '2023-05-27T14:00:00.019888+00:00'
icon: mdi:counter
friendly_name: Daily Exported Energy

I keep trying to change the state, either by manually editing core.restore_state or setting it in the developer tools; but on the next time there’s an update, it gets removed.

and in the statics page i see:
" Daily Exported Energy The unit of this entity changed from ‘kWh’ to ‘’.

What’s going on!???

I created Attributes aren't carried across with some utility_meter entities. · Issue #93770 · home-assistant/core · GitHub