-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Handling complex click events on Shelly1, Shelly2.5, Shelly dimmer and Shelly dimmer2 with fw 1.8.x and above #438
base: master
Are you sure you want to change the base?
Conversation
Tried this on a Shelly dimmer (first model, firmware 1.8) with a momentary switch, but I get no |
@gerard33 Yes, RTFM ;-) -> Sensors in https://github.com/StyraHem/ShellyForHASS#sensor-global-and-per-device Or add
I searched also a lot ;-), happy to help... |
@thecem My config contains the part you are mentioning
The |
Oh this would be nice! Do you receive only the |
I tested it with HA 115.0, Shelly Dimmer and
|
Undocumented feature: I get also the info without this config in HA 115 but I have exactly to search for |
@gerard33, @thecem |
Ah that makes sense 👍 |
@g-kiss But for me this is working fine like this as well. Will do some more testing, but it seems really reliable and get's up to 5-clicks 👍 Below an example for a triple click.
|
@gerard33
and gives
|
Is it possible to set the variable global in yaml? |
@g-kiss I didn't have that device_id in the |
@gerard33 |
Hi, there is any estimation date when it will be merged to the master? Thanks in advance |
Where can I look for the events when they are fired? In some log file? |
@jacobhallgren |
@hakana Please add this to master |
are single, long and double clicks already supported? Seeing this now https://github.com/StyraHem/ShellyForHASS#events |
@hakana Do you have any plan with this PR? |
I have tried this but it is not stable when testing. So I need to investigate more around this. |
Works great for me, use it every day for 2 months. No problems. |
For what it's worth, it's working fine for me for several months as well. Double and triple clicks for all Shelly devices easily available now. |
Hi @wauswaus, I will thinking about it |
Would be awesome to have this on master! |
@g-kiss I would like to be part of the testing...how can I install your change? |
What's the outcome? I'm running the native integration nowadays . Would be nice to have your nice work in there as well |
Hi @wauswaus, see this PR: home-assistant/core#58436 |
@g-kiss Have migrated to the native HA integration since a couple of weeks and added your code and that works like a charm! Thanks for sharing it 👍🏻 |
Overwiev
I created a new event to handle complex events on fw 1.8.x and above. I tested it on Shelly1, Shelly2.5, Shelly dimmer and Shelly dimmer2. With a new "momentary_button" yaml parameter defines which button is connected to Shelly.
If the clicking speed is slow or fast or very fast this event works very well (its accurate is 100%).
These events allows to:
See the examples below.
This PR needs the (StyraHem/pyShelly#42) PR too.
1. Momentary button
1.1 If a momentary button is attached to Shelly, then the
momentary_button
parameter in yaml must be set to true.click_events
contains a complex event, like this:This event will be send after last release of button.
1.2 In case of long push, it also sends another event, when the long push starting (LSTART) or stopping (LSTOP), like this:
"LSTART" and "LSTOP" can be used when the long push is the last action. With "LSTART" event can start executing the action before releasing the long push.
1.3 The time diagram of events

2. Toggle button
If a toggle button is attached to Shelly, then the
momentary_button
parameter in yaml must be false (this is the default) and in shelly settings (web interfacae) thelong push time
must be set to 10 ms. In this case theclick_count
contains number of clicks, like this:3. Examples
3.1 Shelly1 with momentary, detached button:
3.2 Shelly dimmmer with momentary, detached button:
3.3 Control Shelly dimmmer with a switch of Shelly1