I have also been annoyed by the lack of an option to avoid switching the relay when the button is long pushed.
My Shelly Plus 1 has a longpush webhook to turn a lamp across the room on/off, however whenever i perform a longpush with the button in momentary mode the lights connected to the relay turn off, then after the long push has registered I have to perform another short push to turn the relay lights back on. This is really annoying.
As a workaround I have set the button to "Detached" mode and then used a script to toggle the relay whenever a short push is received. This has worked ok, however there is still a short delay between the time when the button is pushed and the relay toggles.
Here is the script I am using, I adapted it from the script in this forum post
// add an evenHandler for single push button events
Shelly.addEventHandler(
function (event, user_data) {
if (typeof event.info.event !== 'undefined') {
if (event.info.event === 'single_push') {
//print("short press toggle light");
Shelly.call( "switch.toggle", {id: 0} ) ;
} else {
return true;
}
} else {
return true;
}
},
);
Alles anzeigen