Moin,
so für alle die es ähnlich machen wollen:
Tassmota per MQTT cmnd.color braucht einen HEX String ohne Semikolon. Also FFFFFF ist weiß oder 00FFFF ist knall gelb. Um vom Colorpicker zum Hexstring zu kommen braucht ihr diese rule:
Code
rule "MKLEDStripControl1"
when
Item EssZLEDStripColor changed
then
hsbValue = EssZLEDStripColor.state as HSBType
redintValue = hsbValue.red.intValue
redintValue = redintValue * 255 / 100
redValue= Integer.toHexString(redintValue)
if (redValue.length==1) {
redValue = "0" + redValue
}
greenintValue = hsbValue.green.intValue
greenintValue = greenintValue * 255 / 100
greenValue= Integer.toHexString(greenintValue)
if (greenValue.length==1) {
greenValue = "0" + greenValue
}
blueintValue = hsbValue.blue.intValue
blueintValue = blueintValue * 255 / 100
blueValue= Integer.toHexString(blueintValue)
if (blueValue.length==1) {
blueValue = "0" + blueValue
}
RGBvalues= blueValue + redValue + greenValue
sendCommand(EssZLEDStripString, RGBvalues)
end
Alles anzeigen
mit items:
Code
Color EssZLEDStripColor "Esszimmer LED Strip" <colorpicker> (LEDStripGroup)
String EssZLEDStripString (LEDStripGroup) {mqtt=">[broker:/haus/Esszimmer/schnapsschrank/cmnd/Color:command:*:default]"}
Gruß Chrischi