Hi,
I’m trying to configure a Shelly 2PM to work with a Hue bulb (This is to allow some rooms house to have hue bulbs for colour etc, while maintaining the same wall switches as my current shellys used which are mainly dimmer 2’s).
My current setup is using a 3 way momentary switch.
The functionality I want is:
- Press up → Turn Light(s) on (turning on the relay if needed)
- Press Down → Turn Light(s) off
- Long Press Up → Increase brightness (and turn on if needed)
- Long Press → Decrease brightness.
I’m using pyscript to do this, and I’ve managed to achieve the first two objectives, but struggling to work out a good way to achieve the last two.
I found this topic which I thought would provide a solution, however the problem I’ve run into is given this setup I can’t check the state of the button (there is no binary sensor exposed for the input channel states), from this issue `Home Assistant doesn’t allow creating binary sensors for momentary input events.
Is there any good way to work around this issue? The only other way I can see to tackle this is to change the inputs to switches, and then calculate is it’s a long press / short press based on the binary sensor state change which is achievable, just a pain to have to reimplement and maintain functionality that’s already available in the Shelly integration, also things like double press will require some thought.