Hi Nico,
these are my items for a Arilux RGB-Controller with Tasmota firmware:
Color EG_Kitchen_Arilux_Color "Licht EG Küche RGB" (gRGB)
String EG_Kitchen_Arilux_RGB "Licht EG Küche RGB [%s]" (gRGB) {mqtt="<[mosquitto:stat/ariluxegkitchen/RESULT:state:JSONPATH($.Color)]"}
Switch EG_Kitchen_Arilux_Power "Licht EG Küche RGB [%s]" (gRGB, gLightEG) {mqtt=">[mosquitto:cmnd/ariluxegkitchen/POWER:command:*:default], <[mosquitto:tele/ariluxegkitchen/STATE:state:JSONPATH($.POWER)"}
Dimmer EG_Kitchen_Arilux_Dim "Licht EG Küche RGB dimm [%.0f %%]" (gEGKitchen, gLightsDim) {mqtt=">[mosquitto:cmnd/ariluxegkitchen/DIMMER:command:*:default], <[mosquitto:stat/ariluxegkitchen/RESULT:state:JSONPATH($.Dimmer)"}
Number EG_Kitchen_Arilux_RSSI "Arilux EG Küche RSSI [%d %%]" (gChartRSSI, gRSSI) {mqtt="<[mosquitto:tele/ariluxegkitchen/STATE:state:JSONPATH($.Wifi.RSSI)"}
String EG_Kitchen_Arilux_VerboseInfo "Arilux EG Küche Info [%s]" // {mqtt="<[mosquitto:tele/ariluxegkitchen/INFO1:state:JSONPATH($)], <[mosquitto:stat/ariluxegkitchen/STATUS2:state:JSONPATH($)], <[mosquitto:stat/ariluxegkitchen/RESULT:state:JSONPATH($)]" }
String EG_Kitchen_Arilux_Firmware_Version "Arilux EG Küche FW Version [%s]" {mqtt="<[mosquitto:stat/ariluxegkitchen/STATUS2:state:JSONPATH($.StatusFWR.Version)]"}
Number EG_Kitchen_Arilux_Uptime "Arilux EG Küche Uptime [%d hrs]" (gUptime) {mqtt="<[mosquitto:tele/ariluxegkitchen/STATE:state:JSONPATH($.Uptime)]"}
Number EG_Kitchen_Arilux_Bootcount "Arilux EG Küche Bootcount [%d]" (gBootcount) {mqtt="<[mosquitto:stat/ariluxegkitchen/STATUS1:state:JSONPATH($.StatusPRM.BootCount)]"}
And this is the rule to set the color via the ColorPicker:
rule "Set RGB value EG Kitchen"
when
Item EG_Kitchen_Arilux_Color changed
then
var HSBType hsb = EG_Kitchen_Arilux_Color.state as HSBType
var Color color = Color::getHSBColor(hsb.hue.floatValue / 360, hsb.saturation.floatValue / 100, hsb.brightness.floatValue / 100)
var String rgb = String::format("%1$02x%2$02x%3$02x", color.red, color.green, color.blue)
publish("mosquitto", "cmnd/ariluxegkitchen/color", rgb)
EG_Kitchen_Arilux_RGB.postUpdate(rgb)
end
Then I have some rules to cyclicly get status and color info from Arilux, if the color is changed via direct command without openhab. The commands are:
publish("mosquitto", "cmnd/" + device_id + "/status", "2")
publish("mosquitto", "cmnd/" + device_id + "/status", "1")
publish("mosquitto", "cmnd/" + device_id + "/color", "")
publish("mosquitto", "cmnd/" + device_id + "/dimmer", "")
with device_id as name of the RGB controller within the MQTT topic. It’s like the example from Tasmota wiki to get the information about the firmware versions from all Tasmota-Devices…
Hope this helps…
By the way:
If you set the color to “AAAAAA” then you have a dimmed white color. If you set to “FF0000” you should get a bright red, “800000” should set a dimmed red. “00FF00” should set a green, and so on…
If you set color to “FF8040” (Red bright, green darker, and a little bit of blue) and you set dimmer to 50, the color should recalculated to “804020” (The same color with less brightness).
Andreas