-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
[FEATURE REQUEST] Add Support for Shelly Click (shelly.click) events or Device trigger using HA #441
Comments
Hi @ashp8i, Sorry for coming late on this. ControllerX is flexible and extendible when it comes to adding new devices and integrations. In addition, it is agnostic on how the other ControllerX features work. In fact, I have been working on adding a homematic integration on this ticket: #421 For a new integration (based on event), I will need to understand how it works, so could you please answer the following:
Depending on the use case, I might build a generic integration for events. Regards, |
yes, I will try and supply some details, the devices we are targeting in my case would be Shelly 2.5 and Shelly i4 for further support of other devices e.g. shelly i3 or shelly1 others may need to provide details. please see event data for a shelly i4 from home assistant: - this: thats the data recorded from a home assistant automation for click_type, the possibilities are single_push, double_push, long_push, btn_down and btn_up see data below from https://www.home-assistant.io/integrations/shelly/ { hope this helps in capturing the correct data Kind Regards, |
when you press a button on a shelly i4 you trigger two events one is a btn_down the other is either single_push or long_push, once you let go of a button the btn_up it triggered, pressing a button twice in quick succession issues a double_push and a couple of btn_down btn_up's I treat btn_up as a release and btn_down as a hold if that helps |
Hi @ashp8i, What I understand is:
I will add a default mapping, but it seems that these controllers are custom controllers and do not have default behaviors. Regards, |
correct, I think that implementation should avoid any trip ups but I will definately test for you, beware at the moment we are implementing gen2 events which I can easily test for you the gen1 I will have to try to reconfigure my shelly 2.5 to get the output to the shelly.click event in home assistant |
I would also love love this implementation. I was looking for a way of using ControllerX with Shelly devices late last year but never got around to making an issue for it so thank you to @ashp8i for starting one. As each i3 in my case has 3 switches and each switch has 3 click types it would take 9 automations for each i3 I use which seemed excessive, I would assume in ControllerX it would be one entry for each device. I personally use Shellyforhass (available in HACS) which has a different event and I haven't noticed a btn_up event but other than that I think most of it is the same. Not sure if this would mean a different controller would be needed or if there would be a way for ControllerX to listen to events that we could configure? Here is what I see when using 1 switch in the HA events Event 2 fired 22:22: Let me know if you would prefer a different issue for the ShellyForHass integration or if you have to create a new controller and would prefer to not have to do that then I understand and would look to move back to the in-built integration. Thanks again for your efforts with this project as well, it's great and I mention it to every I know who uses HA. |
Hi @Dougiebabe, Thank you for your thoughts on this. I was, in fact, working on this integration and I was wondering about adding shellyforhass as well. However, the Also, which shelly device do you have? There are 2 things to add here: an integration, and a device (or more than one). Since event payload is different, I will go for a different integration. Although they will be very similar, and I will add them under this same ticket. Regards, |
Hi @xaviml I have a few shelly devices but not all of them are linked up to switches. I could provide events for the ones that are though. The event above was for an i3 and was channel 1, shellyforhass doesn't list the channel number in the event data but it is contained in the entity_id Event 28 fired 22:54: ^^^ This is for the same i3 device but channel 2. Event 31 fired 22:58: ^^^ This is for a shelly dimmer 2, both channels long presses. Event 33 fired 23:03: ^^^ This is for a shelly dimmer 1, both channels. I have some Shelly 2.5s but they aren't currently hooked up as I haven't got the blinds for them, once I do I could provide the event details for them. I have a Shelly1pm hooked up but I don't see an event for it, that is set to toggle switch and not momentary which might be the issue there. What I have noticed is that the events seem to happen after the button press is released which could be why I'm not sering a button_up event. Let me know if you need any more information or if I can help in any way. |
Hi @Dougiebabe ,
As you said, I see the 2 entity_ids in the logs you provided. So you each channel has its own entity_id right? If this is the case, each channel will have its own configuration, instead of mixing them both.
For all of them? This will make things complicated for hold-release actions then. I also have some shelly devices at my parent's with shellyforhass, so I will be checking the events (I've never used them). Regards, |
Hi @ashp8i and @Dougiebabe , Sorry for the delay, I added the 2 integrations (shelly, shellyforhass) and 3 devices (shelly i3 (shellyforhass), shelly 2.5 (shelly) and shelly plus i4 (shelly)). PR is still open: #469 Integration documentation can be found here, and devices here:
Please, let me know if you have any suggestions. You can try this by downloading from the PR branch, otherwise, I will be releasing a beta release soon so you guys can try it out. Regards, |
Hi @xaviml Sorry, we had a new addition to the family join us a couple of weeks ago so have been a bit pre occupied! Thanks for your time on this. I might try and spin up another Home Assistant instance when I get time and try out the in built shelly application to see if the btn_up event appears with the i3 or if it is just a limitation of the device itself. I'll also try and get test the integration above once it's released as a beta. I wrote the below last week but never got round to hitting send so will include this now. Cheers, Doug As far as I can tell the shelly devices send the 'single' event when the button is released. The dimmers seem to send a 'long' event before the button is released but the i3 devices only send it once released. I've seen no events for 'btn_up' or anything similar with any of the devices I have tried. The event only firing on release with the i3 devices is a bit annoying but looks to be a limitation with the device, this will make it hard to use with dimming applications. I also understand without the btn_up event it will be hard to use for dimming outside of the light attached to the shelly as ControllerX will never know when the button has been released and stop dimming up/down. Would I see the event anywhere else? I've just been looking in the Home Assistant developer tools - events tab. |
Hi @Dougiebabe , Thank you for coming back to me. Unfortunately, there is no much I can do for debugging the device since I do not have it. As far as I know the Developer Tools should show all the events (if it does not show up in there, it will not be picked up by ControllerX anyway). If there is no "release" action, it will be hard to use a "hold" action, so for now we will leave just click actions, but once you have it, you can play around with the Thanks, |
I just released ControllerX v4.20.0b1 which contains the shelly devices. The beta documentation can be checked up here: https://controllerx.netlify.app/ Cheers, |
Hi Xavi, Thanks for extending support in ControllerX for shelly devices I've downloaded the beta version and will test and reply with feedback if there are any issues found. Kind Regards, |
Shelly integrations and devices have been added to ControllerX v4.20.0. Cheers, |
Feature Request
In the current state of the project, how easy or hard would it be to implement support for shelly.click events either via event or Device Triggers.
Describe the solution / feature you'd like
Just like the lutron caseta and state integrations would it be possible to listen into HA for either events in general or shelly device triggers, which can then be mapped to dim/bright/toggle/on/off/colour and media etc
Describe alternatives you've considered
I have tried HA blueprints and Automations but they are not as easy to manipulate and flexible in their implementation as this project has been in terms of it's distinct purpose
Additional context
Xavi, as always appreciate you effort and support, really amazing project
The text was updated successfully, but these errors were encountered: