Set RGB Color using MQTT

I am trying to set a color for a RGB light using MQTT. I know that I need to use the cmnd/Topic/Color command but I cant seem to get the message formatting correct. Here is my current flow

You can see that the message comes out as an object whereas I believe it needs to come out in this format: (68, 106, 255) which should then go in to the MQTT in node.

[The Delete a node removes one of the variable from the color picker which has r,g,b and a values whereas I believe the Tasmota is just expecting (r, g, b) ]

and here is my rather crude (and unsuccesful) attempt at using a change node to try and format correctly


Can someone help please.

the colour picker can send a string instead of an object - that may be easier to reformat as you want.

yes closer...although the a-value is still there. How can I remove it?

I have set the colorpicker to output format hex8, you can send this direct to tasmota.
Sample:

[{"id":"4326fda3.47d38c","type":"ui_colour_picker","z":"8bfffa9d.89ecf8","name":"Lijsterbes Color","label":"","group":"29493404.770ebc","format":"hex8","outformat":"string","showSwatch":true,"showPicker":false,"showValue":false,"showHue":false,"showAlpha":false,"showLightness":true,"square":"false","dynOutput":"false","order":3,"width":"2","height":"1","passthru":false,"topic":"/vm/cmnd/RgbSpotTuin1/color","x":880,"y":1160,"wires":[["6dcfca58.95d30c"]]},{"id":"6dcfca58.95d30c","type":"mqtt out","z":"8bfffa9d.89ecf8","name":"Set Kleur Lijsterbes","topic":"","qos":"0","retain":"","broker":"2db287b.addf978","x":1190,"y":1160,"wires":[]},{"id":"29493404.770ebc","type":"ui_group","z":"","name":"Tuin","tab":"209f7863.40989","order":5,"disp":true,"width":"6","collapse":false},{"id":"2db287b.addf978","type":"mqtt-broker","z":"","name":"Mosquitto1","broker":"192.168.1.127","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"/vm/mqtt/birth","birthQos":"0","birthPayload":"birth","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"209f7863.40989","type":"ui_tab","z":"","name":"Verlichting","icon":"lightbulb_outline","order":1}]
1 Like

Work perfectly...thanks!

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