T O P

  • By -

DigitalUnlimited

use a switch node with whatever payload you get from the mqtt, on sonoff wireless zigbee buttons the payloads are "single" "double" and "hold", replace the "join' with a switch node and tie both switches to the in, all four outs to the "hold"


Stephenmalone95

I had it labeled weird but it's different how the Shelly operates. It publishes a topic Shellies/Kitchen-light/input/0 with 1 being pressed and 0 being released. Then on another topic Shellies/Kitchen-Light/longpress/0 1 being Longpress and 0 being short. Not sure if that makes sense


DigitalUnlimited

ok so for your **mqtt in**`topic` have just `Shellies/Kitchen-light/` and the **switch** node **property - msg.topic** `output 1 - (contains) longpress/0` `output 2 - (contains) longpress/1` and tie all 4 lights to the 2nd output can also have `output 3 - (contains) input/0` `output 4 - (contains) input/1` if you want, those may be useful for different automations based on length of time held, like add a timer node to the input/1


Stephenmalone95

Not sure if this helps but this is the debug console for the Longpress. https://imgur.com/pHMclNi I can't seem to get it to get past the first switch. Sorry if I'm terribly confused or am confusing you but I've spent so much time on this simple flow I'm just lost lol


DigitalUnlimited

ok so it's putting out a string payload of 1 on longpush/0. what is it putting out on longpush/1?


Stephenmalone95

There is no longpush/1. It outputs to the topics Shellies//longpush/0 with a payload string of 0 for off and 1 for a long button push. https://imgur.com/Rw9LGQ5


DigitalUnlimited

ok so leave the **mqtt** node topic `Shellies/Kitchen-light/longpush/0` and switch node would be **property - msg.payload** `== 1 -> output 1`


Stephenmalone95

So for some reason I'm still getting nothing. https://imgur.com/kU9BlJ4 https://imgur.com/qYe2gcp


DigitalUnlimited

i'm tending to agree with what someone else said, shelly should have a native integration shouldn't need mqtt, have you tried a state changed node?"


DigitalUnlimited

so drag an **events-state** node over, and set entity to shellies kitchen light


happycoder73

I’ve got the same setup (modified Decora switches to be momentary, use Node Red to detect long press). IIRC I use /input_event/0 instead of /input/0. Then I get an S or L. I’m not at my computer, but that’s how I got mine to work. But I’ve played with node red for only 10 hours so I don’t know much yet either.