Use a switch for changing state and change its status with inputs too

Hi! I've noticed the 2 things can't be done together, I may change the icon color by pressing button but the inputs don't have effect, viceversa I can change icon colour by inputs.. but the switch press is disabled.
I would use dashboard in a multiple input platform (Alexa, Google home, Homekit, wallbuttons etc.) and I need to keep the button functions + change the status (without the passthrough), how this is possible? Thanks

If I understand correctly

Yes use the Indicator setting , set it to "switch icon shows state of input" and wire past the switch

[{"id":"aab9e931.ec946","type":"inject","z":"190c8195.72b3be","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":170,"y":780,"wires":[["d9fc408d.0bee2","e5dc42ab.b1b0a"]]},{"id":"d9fc408d.0bee2","type":"ui_switch","z":"190c8195.72b3be","name":"","label":"switch","tooltip":"","group":"8b5cde76.edd58","order":9,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"topic","topicType":"msg","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":false,"x":340,"y":840,"wires":[["e5dc42ab.b1b0a"]]},{"id":"e5dc42ab.b1b0a","type":"debug","z":"190c8195.72b3be","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":550,"y":840,"wires":[]},{"id":"63dce983.6d3318","type":"inject","z":"190c8195.72b3be","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":160,"y":920,"wires":[["d9fc408d.0bee2","e5dc42ab.b1b0a"]]},{"id":"8b5cde76.edd58","type":"ui_group","name":"","tab":"8f03e639.85956","order":1,"disp":true,"width":"12","collapse":false},{"id":"8f03e639.85956","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

thanks for reply,
ok I got where is the problem, can you try with icon mi-lightbulb ?

Sure supply us a test flow and I would be glad to.

It's needed to give a feedback to the switch, ok solved, sorry for silly question

Try

[{"id":"aab9e931.ec946","type":"inject","z":"190c8195.72b3be","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":170,"y":780,"wires":[["d9fc408d.0bee2"]]},{"id":"d9fc408d.0bee2","type":"ui_switch","z":"190c8195.72b3be","name":"","label":"switch","tooltip":"","group":"8b5cde76.edd58","order":9,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"topic","topicType":"msg","style":"","onvalue":"true","onvalueType":"bool","onicon":"mi-lightbulb","oncolor":"green","offvalue":"false","offvalueType":"bool","officon":"mi-lightbulb","offcolor":"red","animate":true,"x":340,"y":880,"wires":[["e5dc42ab.b1b0a","9506bba0.8f3aa8"]]},{"id":"e5dc42ab.b1b0a","type":"debug","z":"190c8195.72b3be","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":550,"y":840,"wires":[]},{"id":"63dce983.6d3318","type":"inject","z":"190c8195.72b3be","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":160,"y":920,"wires":[["d9fc408d.0bee2"]]},{"id":"9506bba0.8f3aa8","type":"change","z":"190c8195.72b3be","name":"","rules":[],"action":"","property":"","from":"","to":"","reg":false,"x":335,"y":940,"wires":[["d9fc408d.0bee2"]],"l":false},{"id":"8b5cde76.edd58","type":"ui_group","name":"","tab":"8f03e639.85956","order":1,"disp":true,"width":"12","collapse":false},{"id":"8f03e639.85956","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

[edit] this looks better, there is a hidden wire that links through, move change node to see it.

[{"id":"aab9e931.ec946","type":"inject","z":"190c8195.72b3be","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":110,"y":860,"wires":[["9506bba0.8f3aa8"]]},{"id":"9506bba0.8f3aa8","type":"change","z":"190c8195.72b3be","name":"","rules":[],"action":"","property":"","from":"","to":"","reg":false,"x":235,"y":880,"wires":[["d9fc408d.0bee2","63c97a3b.1442b4"]],"l":false},{"id":"d9fc408d.0bee2","type":"ui_switch","z":"190c8195.72b3be","name":"","label":"switch","tooltip":"","group":"8b5cde76.edd58","order":9,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"topic","topicType":"msg","style":"","onvalue":"true","onvalueType":"bool","onicon":"mi-lightbulb","oncolor":"green","offvalue":"false","offvalueType":"bool","officon":"mi-lightbulb","offcolor":"red","animate":true,"x":340,"y":880,"wires":[["9506bba0.8f3aa8","63c97a3b.1442b4"]]},{"id":"63dce983.6d3318","type":"inject","z":"190c8195.72b3be","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":110,"y":920,"wires":[["9506bba0.8f3aa8"]]},{"id":"63c97a3b.1442b4","type":"rbe","z":"190c8195.72b3be","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":490,"y":880,"wires":[["e5dc42ab.b1b0a"]]},{"id":"e5dc42ab.b1b0a","type":"debug","z":"190c8195.72b3be","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":880,"wires":[]},{"id":"8b5cde76.edd58","type":"ui_group","name":"","tab":"8f03e639.85956","order":1,"disp":true,"width":"12","collapse":false},{"id":"8f03e639.85956","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

1 Like

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