Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home Assistant state class and unit of measure #3331

Closed
ykri opened this issue Oct 12, 2024 · 8 comments · Fixed by #3332
Closed

Home Assistant state class and unit of measure #3331

ykri opened this issue Oct 12, 2024 · 8 comments · Fixed by #3332
Assignees

Comments

@ykri
Copy link

ykri commented Oct 12, 2024

Issue

Since last HA update 2024.10 I am getting two repair issues for raw value.


The entity no longer has a state class

We have generated statistics for 'ElectrMeter Raw Value' (sensor.electrmeter_raw) in the past, but it no longer has a state class, therefore, we cannot track long term statistics for it anymore.

Statistics cannot be generated until this entity has a supported state class.
If the state class was previously provided by an integration, this might be a bug. Please report an issue.
If you previously set the state class yourself, please correct it. [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)
If the state class has permanently been removed, you may want to delete the long term statistics of it from your database.
Do you want to permanently delete the long term statistics of sensor.electrmeter_raw from your database?

and


The unit has changed

The unit of 'ElectrMeter Raw Value' (sensor.electrmeter_raw) changed to '' which can't be converted to the previously stored unit, 'kWh'.
If the historic statistic values have a wrong unit, you can update the units of the old values. The values will not be updated.
Otherwise you can choose to delete all historic statistic values, and start over

@caco3 caco3 self-assigned this Oct 12, 2024
@caco3
Copy link
Collaborator

caco3 commented Oct 12, 2024

I updated the HA Discover topics in #3332
This should fix the first issue. I think the 2nd issue is just a follow-up error due to the first error.

I can't test it myself since I don't see this error. So I need you to test and confirm it is ok now!
Please test the latest (most top) build from https://github.com/jomjol/AI-on-the-edge-device/actions?query=branch%3Asupport-homeassistant-2024.10

@ykri
Copy link
Author

ykri commented Oct 13, 2024

Still the same. See the HA MQTT debug info for raw

image

There is no State Class as for example I see in the main value
image

@caco3
Copy link
Collaborator

caco3 commented Oct 13, 2024

I can not reproduce this!
For me it looks ok now:
grafik

Maybe try to delete the discovery topics and let the device re-send them.

@ykri
Copy link
Author

ykri commented Oct 13, 2024

I tried to delete the discovery topics using MQTT Explorer but I am back to zero. Is there any other clever way to do this discovery topics deletion?

@caco3
Copy link
Collaborator

caco3 commented Oct 13, 2024

Did you really use a build from https://github.com/jomjol/AI-on-the-edge-device/actions/workflows/build.yaml?query=branch%3Asupport-homeassistant-2024.10?
Looking on your screenshot I see that you are not running the right firmware!

If it still does not work:
You can also delete the device in HA. It will show up again after the next sending of the discovery topics.

@ykri
Copy link
Author

ykri commented Oct 13, 2024

I guess so. I updated again using the latest here image

and this is from MQTT Explorer the post for Raw after the update. You can see that it is the same commit from development branch main image

And here is from HA

image

There must be something I am doing wrong but what?

Thanks for your patience!

@caco3
Copy link
Collaborator

caco3 commented Oct 13, 2024

You again did not use the link I showed you!
you need the latest build of the branch "support-homeassistant-2024.10", but you used "main"!

@ykri
Copy link
Author

ykri commented Oct 13, 2024

I owe you a thousand apologies. It worked. As you said it I was using the wrong update.

Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants