Skip to content

What is the binary_sensor node doing to set the state according to the device_class #1729

Answered by zachowj
celloza asked this question in Q&A
Discussion options

You must be logged in to vote

I haven't tested it but when updating the state of an entity via the REST API, you need to include the attributes in the payload; otherwise, it might overwrite the existing attributes with a blank set.

To verify this, you can:

  1. Use the REST API to update the entity state.
  2. Go to Developer Tools > States in Home Assistant.
  3. Check if attributes.device_class or any other expected attributes still exist for the entity.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by celloza
Comment options

You must be logged in to vote
1 reply
@celloza
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants