hass-plejd
hass-plejd copied to clipboard
Reload of integration triggers all events
When I manually reload the integration (to get updated information from Plejd) all scenario and button events are triggered.
This is quite unfortunate, as this leads to all hooks for those events being triggered in HA.
This is a snapshot of my logbook just during the reload:
the logbook continues with all button press events being fired, then all (Plejd) scenario events being fired, then all button press events being fired (again!), then lights turning unknown (this is expected), then lights going to their actual state (also expected).
This is issue for me aswell, using a Plejd scenario to control my screens up and down with double click of a button. Reloading integration makes my screens move.
I had this problem too , in automation in trigger I had to add "not_from" , "not_to"
platform: state
entity_id: event.bedroom_low_light_activated
not_from:
- unknown
- unavailable
not_to:
- unknown
- unavailable
You can refer to this topic: https://community.home-assistant.io/t/help-with-triggering-an-automation-only-when-date-is-changed-in-the-state/630111/9
I Hope I understood your problem and my comments are relevant
This is a very helpful trick! I think it is impossible for this integration to get around this, since I assume HA sets all entities belonging to any integration as "unavailable" while the integration is reloading.
That's exactly right.
I've raised this issue with the core team, and while there's no good ideas right now, at least there's hope.