-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Read single entities #511
Comments
After facing the same issue I went looking into the code and found an (undocumented) command that can be used for this: {
"id": 1,
"type": "subscribe_entities",
"entity_ids": [
"light.my_light"
]
} This will create an subscription to that entity, but will also send the current state. You can use Unsubscribing from events to unsubscribe. Sources:
Other notable sources: |
Thank you for this answer. But I don't understand the code well enough to understand your answer. Can you give me an example? To which function do you supply this data? |
I figured it out! But I don't understand typescript so i cannot make a pull request. This is what I changed:
collection.js:
So maybe someone can implement in case this project is still maintained? |
Use case:
An app is using a small set of entities, On startup, the current entity state should be read from HA to initialize the app with current/valid states.
The app can listen to entity state changed, but this will only update if the state changes on HA (event
state_changed
).The app can read all entities (message
get_states
).But it's not possible to read single entity states. Did I miss that or is it not implemented yet?
The text was updated successfully, but these errors were encountered: