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

On a Helper Sensor: Entities no longer have a state class #127669

Open
M4RCCR4FT opened this issue Oct 5, 2024 · 6 comments
Open

On a Helper Sensor: Entities no longer have a state class #127669

M4RCCR4FT opened this issue Oct 5, 2024 · 6 comments

Comments

@M4RCCR4FT
Copy link

The problem

Splitted issue from #127363 on request

After upgrading to 2024.10.1 I get "Entities no longer have a state class" messages. To be precise I've 8 of those messages and those 8 sensors are made by hand as helpers.

The messages
image

The helpers
image

Four sensors get their data pushed from a small python script on a raspberry pi's. The other four from two pi zero's with a little script.

What I observed is that after a reboot, before a RPi pushed a new value, there are no errors. After a push the error apears.

If I open the settings of such a sensor I see a State class "meting" (Measure in dutch). Resending/updating doesn't make any difference.

image

What version of Home Assistant Core has the issue?

2024.10.1

What was the last working version of Home Assistant Core?

2024.9.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Helper template sensors

Link to integration documentation on our website

https://www.home-assistant.io/integrations/template/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Oct 5, 2024

Hey there @PhracturedBlue, @tetienne, @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (template) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of template can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign template Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


template documentation
template source
(message by IssueLinks)

@joostlek
Copy link
Member

joostlek commented Oct 5, 2024

How does your device push new state?

@M4RCCR4FT
Copy link
Author

headers  = {"Authorization": f"Bearer {bearertoken}", "content-type": "application/json"}
url      = f"http://{ip}:{port}/api/states/{tempsensor}"
data     = {"state": dhttemp, "attributes": {"unit_of_measurement": "C", "icon": "mdi:thermometer"}}
response = post(url, headers=headers, json=data)

url      = f"http://{ip}:{port}/api/states/{vochtsensor}"
data     = {"state": dhtvocht, "attributes":
{"unit_of_measurement": "%", "icon": "mdi:water-percent"}}
response = post(url, headers=headers, json=data)

@joostlek
Copy link
Member

joostlek commented Oct 5, 2024

I think that one of the attributes you have to send is the state class as well, can you maybe give that a shot to add as well?

@NateEaton
Copy link

I have this same issue as of 2024.10.1 (I had skipped 2024.10). The error is reported on a sensor group that I created through the Helper UI earlier this year. It consists of a set of battery level sensors.

I have not tried to delete it although it appears I could delete it (assuming 127363 doesn't interfere) and recreate it with YAML and explicitly specify a state class but as this is being tracked as an issue I'm inclined to watch this thread to see what its resolution will be.

@joostlek
Copy link
Member

joostlek commented Oct 5, 2024

That sounds like the bug with the group integration, I think there is an issue open for that one as well which is more interesting to follow

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

No branches or pull requests

3 participants