-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: fire events for every completed service run #16
Conversation
Nice idea 👍 |
Firing events after services allows other automations and templates to respond to saved state and variable changes. The call_service event doesn't guarantee that the update is completed.
To be honest I'm still a bit unsure about this functionality. Can you describe automations/scripts that can utilize this feature? |
The variables, in particular, might be relevant to multiple automations. You might want to update a device's state whenever a variable changes, or create a variable on that other automations depend in other ways, as some cached/lazy version of some sort of calculation, etc.
This is only what I can spontaneously think of. There is a specific use case where this was necessary in my setup, it's not up at the moment so I could check. |
Isn't it achievable using built-in |
It captures state changes, not state saves, restores as a subset of changes, or any variable changes. I think the restore events might also be relevant for automations that are supposed to be triggered during startup and which rely on states being restored already. If it's really important, I can look up my use case eventually and explain it as well. It might have involved template sensors. |
All things that are "stored" in saver are also visible as attributes of I think that I these custom events can be added as well though |
Fair enough, but isn't it all cramped into the same entity? It might be difficult to match a specific variable without additional complexity. I'm just guessing here. Cause I'm positive that I've exhausted these other methods before going this route. I'll know more when I get my HA running again so that I can conveniently access by backed up database. |
Yes, it is. That's why I think that custom events are acceptable after all |
Thanks @matfax! |
Firing events after services allows other automations and templates to respond to saved state and variable changes. The call_service event doesn't guarantee that the update is completed.