Closed bnordli closed 1 year ago
Note: It might be more useful to instead activate a device trigger (on the "Plejd Scene" device), but I have never implemented a device trigger before, so this is what I made for now.
I agree that a device trigger would make more sense. I've never implemented them either, but I have a WPH-01 in the mail so when that arrives I intend to learn anyway...
I gave the device triggers a shot, but I couldn't find a good way to hook them up. Have you made any more attempts towards this?
If not, I suggest triggering an event like this as a temporary solution.
I suggest triggering an event like this as a temporary solution
I think this is the right way to go. Make sure the event solution is stable and work fine before you dive into Device Triggers. They are basically just a way to simplify for users in automations. A more user-fiendly way to identify events.
I'm trying to keep the pyplejd package somwehat freestanding from Home Assistant, so I think I would prefer some form of callback and trigger the hass event from the integration rather than from PlejdDevice.
Sounds reasonable. Changed to callback!
Hey there! Are we any closer to getting events implemented?😊
We definitely are. The pyplejd package has just been updated to make this easier.
There should now be event
entities for each scene.
There should now be
event
entities for each scene.
I can confirm it works. Got an entity for my scene and an event when I triggered it using the button:
I think this PR can be closed.
Fire an HA event ("plejd_scene_event") when the Plejd mesh initiates a scene. This applies both to normal scenes and timer triggered scenes ("hiddenFromSceneList"). (The latter are still not added as a HA button.)
Example event: