Hello,
I would like to run a Shelly 1L in detached mode to control a Hue smart bulb. Does anyone know if it is possible to detect when a long press is released, in detached mode, so that I could the use the switch as a dimmer for the bulb,
Thanks.
Hello,
I would like to run a Shelly 1L in detached mode to control a Hue smart bulb. Does anyone know if it is possible to detect when a long press is released, in detached mode, so that I could the use the switch as a dimmer for the bulb,
Thanks.
Don’t have 1L but other Shelly models.
I see no reason why it wouldn’t report longpress in detached mode. However the time of longpress is fixed (no option to set it to different value).
If you are using NodeRed you can use great Button Events node, which can identify various sequences of input signals allowing you to configure timing of those input patterns.
Note it’s not available in default NR installation. It must be added via NR palette.
I am able to detect that a long press has bee initiated, which I could use to commence the dimming but I am unable to detect when the switch has been released, which would allow me to stop dimming.
Shelly devices reports their inputs as well as relays state. Also press and longpress. It seems you are using one of them.
I suggest to use inputs. input event changes its state on press and release the button. Interpretting it should be easy.
I’m using mqtt which goves me access to all data provided by shelly devices. What integration with HA are you using?
Think I may have sussed it. I am using MQTT and I could see that input_event sets the “event” data item to “L” when a long press is detected but it did not change when the button was released. However I also noticed that there is an “event” topic that is set to “1” when a button is pressed and “0” when released so I think that by using a combination of both I should be able to detect a long press and release.
Thanks for your help.
You don’t need to combine anything. There is just input/0
topic which directly reflects state of the input switch/button. Then measure time of this topic being in 1 state.
Instead of that you can use longpush/0
topic. However in that case longpush is recognized by 1L, which is comfortable, but not configurable (as said in my first post).
See reference docs
https://shelly-api-docs.shelly.cloud/#shelly1l-mqtt
Thanks, that makes it a lot easier.