Change Inject Node To Dashboard Button For HTTP

I found this flow that controls my Sonoff Mini from the palette using inject nodes. But how do I do that using dashboard buttons instead?

[{"id":"38075045.5bd73","type":"inject","z":"6bbeac55.3f39d4","name":"on","topic":"","payload":"{\"deviceid\": \"1000a5098b\",\"data\": {\"switch\": \"on\" }} ","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":157.10000610351562,"y":100,"wires":[["2101dfac.b2134"]]},{"id":"2101dfac.b2134","type":"http request","z":"6bbeac55.3f39d4","name":"","method":"POST","ret":"obj","url":"http://192.168.1.27:8081/zeroconf/switch","tls":"","x":396.10003662109375,"y":154.1999969482422,"wires":[[]]},{"id":"ef5051b5.77645","type":"inject","z":"6bbeac55.3f39d4","name":"off","topic":"","payload":"{\"deviceid\":\"1000a5098b\",\"data\":{\"switch\":\"off\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":159,"y":147.00000286102295,"wires":[["2101dfac.b2134"]]}]

I would rather use a dashboard switch node.

r-2

The configuration for the ui_switch could be like the one below.

Edit: corrected (but anyway not tested)

That worked for executing on/off from the dashboard. Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.