JaccoR/hass-entso-e

using state class 'measurement' which is impossible considering device class ('monetary')

Closed this issue · 9 comments

Hi Jacco: FYI.

Logger: homeassistant.components.sensor
Source: components/sensor/init.py:570
integration: Sensor (documentation, issues)
First occurred: May 19, 2024 at 10:40:52 PM (10 occurrences)
Last logged: May 19, 2024 at 10:40:53 PM

Entity sensor.entso_highest_energy_price_today (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues
Entity sensor.entso_average_electricity_price_today (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues
Entity sensor.entso_current_percentage_of_highest_electricity_price_today (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues
Entity sensor.entso_time_of_highest_price_today (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('timestamp') it is using; expected None; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues
Entity sensor.entso_time_of_lowest_price_today (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('timestamp') it is using; expected None; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues

Seeing the same thing here since yesterday.

2024-06-08 10:28:17.342 DEBUG (MainThread) [custom_components.entsoe.coordinator] Fetching ENTSO-e data
2024-06-08 10:28:17.342 DEBUG (MainThread) [custom_components.entsoe.coordinator] NL
2024-06-08 10:28:18.210 DEBUG (MainThread) [custom_components.entsoe.coordinator] Finished fetching ENTSO-e coordinator data in 0.869 seconds (success: True)
2024-06-08 10:28:18.216 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.entso_current_electricity_market_price (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues
2024-06-08 10:28:18.223 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.entso_next_hour_electricity_market_price (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues
2024-06-08 10:28:18.229 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.entso_lowest_energy_price_today (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues
2024-06-08 10:28:18.234 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.entso_highest_energy_price_today (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues
2024-06-08 10:28:18.273 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.entso_average_electricity_price_today (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues
2024-06-08 10:28:18.282 WARNING (MainThread) [custom_components.entsoe.sensor] Unable to update entity due to data processing error: None and error: min() iterable argument is empty
2024-06-08 10:28:18.283 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.entso_current_percentage_of_highest_electricity_price_today (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues
2024-06-08 10:28:18.294 WARNING (MainThread) [custom_components.entsoe.sensor] Unable to update entity due to data processing error: None and error: min() iterable argument is empty
2024-06-08 10:28:18.294 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.entso_time_of_highest_price_today (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('timestamp') it is using; expected None; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues
2024-06-08 10:28:18.303 WARNING (MainThread) [custom_components.entsoe.sensor] Unable to update entity due to data processing error: None and error: min() iterable argument is empty
2024-06-08 10:28:18.303 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.entso_time_of_lowest_price_today (<class 'custom_components.entsoe.sensor.EntsoeSensor'>) is using state class 'measurement' which is impossible considering device class ('timestamp') it is using; expected None; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/JaccoR/hass-entso-e/issues

Yesterday there was indeed no data to be had so it makes sense that the entities would be empty, but as of an hour ago the platform has filled in the missing data and we now do get the correct prices, so the entities should be properly populated again.

I figured out a workaround:
the file config/.storage/core.restore_state contains all the old values for the entso integration.
Removing all the objects that mention the current entso-e sensors while HA is stopped makes the integration work again.

It is important that HA is not running at the time, or it will reinsert your removed entities again on the next reboot.

It is important that HA is not running at the time, or it will reinsert your removed entities again on the next reboot.

Weird question, but how do you manage to do that? Is there a way to shutdown HA while still being able to edit files? I'm logged in through SSH but I don't see an option to shutdown HA while not shutting down the system

Edit: Ah I see, using Developer tools > Services > "Home Assistant Core Integration: Stop".
Unfortunately, this workaround didn't fix my issue

Edit2: I should read better, "Removing all the objects that mention the current entso-e sensors"

This has fixed my problems. Thanks for sharing @DutchessNicole !

@DutchessNicole and @Fidelity88 thanks both. this solved it for me.

I use SSH as well, and in the HA command line you can just issue the ha core stop command to stop the HA core container. Then you can edit the files, since SSH will still run.

@DutchessNicole Thanks, this fixed it for me too.

I use SSH as well, and in the HA command line you can just issue the ha core stop command to stop the HA core container. Then you can edit the files, since SSH will still run.

Thanks this worked for me!

A Pointer to others struggling with this:

I only needed to remove the object that is used in the graphs, which in my case was called sensor.[whatever name you use for your ensoe config]_average_electricity_price_today. It included all the old today and tomorrow prices (all nested in this object).

All other objects with sensor.[whatever name you use for your ensoe config]_* I did not remove.

After a restart ha core start the prices and graphs came back to life, almost immediately.

It would be nice if the cause of this was fixed.

Thanks! This is an excellent procedure. Only removing the object _average_electricity_price_today and leaving all other entsoe objects intact worked for me as well.

Agree that a true fix is still required.

v0.4.0 is released this version contains fixes that solve a lot of warnings and known issues. This issue is probably also solved.
Please update to the latest version.
Closing this issue for now. If you still have issue please feel free to open a new issue.