Closed gerritjonker closed 2 years ago
I see the same issue for the following sensors:
sensor.toon_p1_power_use_low De state class "" van deze entiteit wordt niet ondersteund.
sensor.toon_p1_power_use_high De state class "" van deze entiteit wordt niet ondersteund.
sensor.toon_p1_power_prod_low De state class "" van deze entiteit wordt niet ondersteund.
sensor.toon_p1_power_prod_high De state class "" van deze entiteit wordt niet ondersteund.
The state class of this entity, is not supported.
Statistics can not be generated until this entity has a supported state class.
If this state class was provided by an integration, this is a bug. Please report an issue.
The different state classes and when to use which can be found in the developer documentation.
[https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics]()
I've modified the following: Added STATE_CLASS_MEASUREMENT in the folowing sections:
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
STATE_CLASS_TOTAL_INCREASING,
STATE_CLASS_MEASUREMENT,
SensorEntity,
SensorEntityDescription,
)
SensorEntityDescription(
key="elecusageflowlow",
name="P1 Power Use Low",
icon="mdi:flash",
native_unit_of_measurement=POWER_WATT,
device_class=DEVICE_CLASS_POWER,
state_class=STATE_CLASS_MEASUREMENT,
),
SensorEntityDescription(
key="elecusageflowhigh",
name="P1 Power Use High",
icon="mdi:flash",
native_unit_of_measurement=POWER_WATT,
device_class=DEVICE_CLASS_POWER,
state_class=STATE_CLASS_MEASUREMENT,
),
SensorEntityDescription(
key="elecprodflowlow",
name="P1 Power Prod Low",
icon="mdi:flash",
native_unit_of_measurement=POWER_WATT,
device_class=DEVICE_CLASS_POWER,
state_class=STATE_CLASS_MEASUREMENT,
),
SensorEntityDescription(
key="elecprodflowhigh",
name="P1 Power Prod High",
icon="mdi:flash",
native_unit_of_measurement=POWER_WATT,
device_class=DEVICE_CLASS_POWER,
state_class=STATE_CLASS_MEASUREMENT,
),
And that seems to make HA happy
@Ysbrand thanks, can you try release 1.0.20?
Thanks Ron, looks ok as far as I can determine.
I encounter this error with release 1.0.20: Logger: homeassistant.components.sensor.recorder Source: components/sensor/recorder.py:314 Integration: Sensor (documentation, issues) First occurred: November 29, 2021, 19:15:10 (1 occurrences) Last logged: November 29, 2021, 19:15:10 Entity sensor.toon_gas_used_last_hour from integration toon_smartmeter has state class total_increasing, but its state is not strictly increasing. Triggered by state 1.375 with last_updated set to 2021-11-29T18:12:00.213004+00:00. Please report it to the custom component author.
Don't really know how to get this fixed (yet)
Well, I did see this occurring once in my logs today as well, and I would say that total increasing is indeed not correct as this number will go up and down during the day.
Closed for now, reopen if still an issue
In my log today, so apparently still an issue.
Entity sensor.toon_gas_used_last_hour from integration toon_smartmeter has state class total_increasing, but its state is not strictly increasing. Triggered by state 1.586 with last_updated set to 2022-02-01T10:02:24.952853+00:00. Please report it to the custom component author.
In my log today, so apparently still an issue.
Entity sensor.toon_gas_used_last_hour from integration toon_smartmeter has state class total_increasing, but its state is not strictly increasing. Triggered by state 1.586 with last_updated set to 2022-02-01T10:02:24.952853+00:00. Please report it to the custom component author.
Which version are you running of the component and HA ? Don't see the error in my setup. I am running 1.0.20
HA 2021.12.10 / Toon Smartmeter 1.0.20
could it be that you have set a manual customization for the state class in your configuration.yaml of customization.yaml ?
https://www.home-assistant.io/docs/configuration/customizing-devices/#unit_of_measurement
homeassistant:
customize_glob:
sensor.*_total:
last_reset: '1970-01-01T00:00:00+00:00'
state_class: total_increasing
I am unable to find any customization on the sensor. Here are the sensor attributes:
state_class: total_increasing unit_of_measurement: m³ device_class: gas icon: mdi:gas-cylinder friendly_name: Toon Gas Used Last Hour
Mine is exactly the same, where do you see the error ?
state_class: total_increasing unit_of_measurement: m³ device_class: gas icon: mdi:gas-cylinder friendly_name: Toon Gas Used Last Hour
a last hour
sensor should not have a total_increasing
state_class
value.
/config/logs
Logger: homeassistant.components.sensor.recorder
Source: components/sensor/recorder.py:319
Integration: Sensor (documentation, issues)
First occurred: 11:05:10 AM (1 occurrences)
Last logged: 11:05:10 AM
Entity sensor.toon_gas_used_last_hour from integration toon_smartmeter has state class total_increasing, but its state is not strictly increasing. Triggered by state 1.586 with last_updated set to 2022-02-01T10:02:24.952853+00:00. Please report it to the custom component author.
i see, makes sense but strange i don't get the warning. This is all i can do for now, maybe @cyberjunky knows the answer to this one
Can you try version 1.0.21?
Looks good
state_class: measurement
unit_of_measurement: m³
device_class: gas
icon: mdi:gas-cylinder
friendly_name: Toon Gas Used Last Hour
Last reset missing The following entities have state class 'measurement' but 'last_reset' is missing: sensor.toon_gas_used_last_hour
installed version 1.0.21
state_class: measurement unit_of_measurement: m³ device_class: gas icon: mdi:gas-cylinder friendly_name: Toon Gas Used Last Hour
add: Customize is also no longer in the UI so I don't know how to add last reset now.
Last_reset? I thought his was legacy for a long time, HA is getting annoying again.. Which version of HA do you run?
Since the last update of smartmeter (1.0.21) I don't see any error message.
Running the latest supervisor-2022.01.1
Since the last update of smartmeter (1.0.21) I don't see any error message.
Running the latest supervisor-2022.01.1
Maybe you already have the last_reset?
No I don't. Like Ron said: it is deprecated. Are you sure you are running one of the latest versions? In my case it is core-2022.2.0 and supervisor-2022.01.1
Then I don't know what is going on with mine, since I updated yesterday energy has not registered any gas.
Only thing is that it says last reset missing.
Added a new sensor and that's without error message because it uses total increasing.
@Dutchy-79 If i understood your message correctly you fixed it by removing and creating new sensor, did that workaround fixed it for your friend too?
As I said last_reset was removed from HA and my integration long ago, it looks to me a bug in HA to be honest, something with old attrubutes sticking to older devices.
Iemand op de Facebook pagina gaf een tijd geleden deze oplossing aan toen het door een eerdere update niet meer werkte, echter daarna kwam jij met de echte fix.
Probeer het volgende eens dmv nieuwe sensoren maken gebaseerd op je toon sensor.
sensor:
platform: template sensors: gas_verbruik: value_template: >- {{ sensor.toon_gas_used_cnt }} unit_of_measurement: "m³" device_class: gas
platform: integration name: Gasverbruik source: sensor. gas_verbruik method: left round: 2
Oh, en als het goed is moet na een herstart je sensor.Gasverbruik kunnen selecteren in de configuratie van het energy dashboard.
Ik heb en wil geen facebook account.
Ik heb nog eens gekeken, ik heb gewoon dit en dat werkt gewoon al een hele tijd en zonder yaml code en met laatste versies... Dat bovenstaande is dus niet nodig, en maakt het alleen maar gecompliceerder. Geen idee wat er aan de hand is, behalve dat er oude code gerunt word (zonder dat men dit door heeft)
Jij kan last hour en gas used cnt kiezen, ik alleen last hour en die doet het juist niet.
Is dit issue nog van toepassing? Ik heb wat tijd om eea op te schonen en te fixen... Ik neem aan dat je gas cnt in je toon_smartmeter config yaml hebt staan?
Kan me niet meer herinneren wat er veranderd is maar bij mij werkt het weer.
Thanks!
Geen enkel probleem meer. Thanks.
In pull request #37 the state_class total_increasing was removed but I have the following error:
Unsupported state class The state class of this entity, is not supported. Statistics can not be generated until this entity has a supported state class.
I think the state_class measurement should be added.
Value entities - entities not representing a total amount
Home Assistant tracks the min, max and mean value during the statistics period. The state_class property must be set to measurement, and the device_class must not be either of energy, gas, or monetary
https://developers.home-assistant.io/docs/core/entity/sensor/#available-state-classes