(solved) Shelly Bulb via MQTT: RGB Werte anstatt Prozentangabe
Verfasst: 5. Dez 2022 11:56
Moinsen.
Versuche gerade eine Shelly BULB via MQTT zu steuern. Hilfe gab es hier:
https://community.openhab.org/t/shelly- ... 4/64176/25
und hier:
https://shelly-api-docs.shelly.cloud/ge ... -bulb-mqtt
Stumpf was zusammenkopiert, daraus sind folgende Things und Items entstanden:
thing:
item:
Sieht so aus:
Habe jetzt in der Sitemap mehrere Schieberegler für die Grundfarben, welche von 0-100% dargestellt werden, würde gerne die RGB Werte 0-255 darstellen. mit der state presentation habe ich schon rumgespielt, brachte nicht den gewünschten Erfolg.
Jemand eine idee?
Ein Colorpicker wäre auch was feines
, ist aber eine spätere Evolutionsstufe. 
Versuche gerade eine Shelly BULB via MQTT zu steuern. Hilfe gab es hier:
https://community.openhab.org/t/shelly- ... 4/64176/25
und hier:
https://shelly-api-docs.shelly.cloud/ge ... -bulb-mqtt
Stumpf was zusammenkopiert, daraus sind folgende Things und Items entstanden:
thing:
Code: Alles auswählen
Thing topic ShellyBulb01 "Shelly Bulb WRGB" @ "Shelly"{
Channels:
Type switch : switch "Switch" [ stateTopic="shellies/ShellyBulb01/color/0/", transformationPattern="JS:shelly_dimmer-status.js",
commandTopic="shellies/ShellyBulb01/color/0/command", on="on", off="off" ]
Type dimmer : white_dim "Brightness" [ stateTopic="shellies/ShellyBulb01/color/0/status", transformationPattern="JSONPATH:$.brightness",
commandTopic="shellies/ShellyBulb01/color/0/set", formatBeforePublish="{ \"mode\": \"white\", \"brightness\" : %.0f }"]
Type dimmer : white_temp "White Temperature" [ stateTopic="shellies/ShellyBulb01/color/0/status", transformationPattern="JSONPATH:$.temp",
commandTopic="shellies/ShellyBulb01/color/0/set", min=3000, max=6400, step=10, formatBeforePublish="{ \"mode\": \"white\", \"temp\" : %s }"]
Type dimmer : color_gain "Color Brightness" [ stateTopic="shellies/ShellyBulb01/color/0/status", transformationPattern="JSONPATH:$.gain",
commandTopic="shellies/ShellyBulb01/color/0/set", formatBeforePublish="{ \"mode\": \"color\", \"gain\" : %.0f }"]
Type dimmer : color_green "Green" [ stateTopic="shellies/ShellyBulb01/color/0/status", transformationPattern="JSONPATH:$.green",
commandTopic="shellies/ShellyBulb01/color/0/set", min=0, max=255, formatBeforePublish="{ \"mode\": \"color\", \"green\" : %.0f }"]
Type dimmer : color_red "Red" [ stateTopic="shellies/ShellyBulb01/color/0/status", transformationPattern="JSONPATH:$.red",
commandTopic="shellies/ShellyBulb01/color/0/set", min=0, max=255, formatBeforePublish="{ \"mode\": \"color\", \"red\" : %.0f }"]
Type dimmer : color_blue "Blue" [ stateTopic="shellies/ShellyBulb01/color/0/status", transformationPattern="JSONPATH:$.blue",
commandTopic="shellies/ShellyBulb01/color/0/set", min=0, max=255, formatBeforePublish="{ \"mode\": \"color\", \"blue\" : %.0f }"]
Type string : color_mode "Color Mode" [ stateTopic="shellies/ShellyBulb01/color/0/status", transformationPattern="JSONPATH:$.mode"]
Type string : status "Status" [ stateTopic="shellies/ShellyBulb01/color/0/status", commandTopic="shellies/ShellyBulb01/color/0/set" ]
Type number : power "Leistung" [ stateTopic="shellies/ShellyBulb01/light/0/power" ]
Type number : energy "Energie" [ stateTopic="shellies/ShellyBulb01/light/0/energy", transformationPattern="JS:shelly_convertkwh.js" ]
}
Code: Alles auswählen
//ShellyBulb01
Switch ShellyBulb01_switch "Switch" <switch> (gShellyBulb01, gLight) ["Switch", "Switchable"] {channel="mqtt:topic:openhab:ShellyBulb01:switch"}
Dimmer ShellyBulb01_white_dim "Weiss dimmen" <light> (gShellyBulb01) ["Dimmer"] {channel="mqtt:topic:openhab:ShellyBulb01:white_dim"}
Dimmer ShellyBulb01_white_temp "Farbtemperatur" <light> (gShellyBulb01) ["Dimmer"] {channel="mqtt:topic:openhab:ShellyBulb01:white_temp"}
Dimmer ShellyBulb01_color_gain "Farbhelligkeit" <light> (gShellyBulb01) ["Dimmer"] {channel="mqtt:topic:openhab:ShellyBulb01:color_gain"}
Dimmer ShellyBulb01_color_green "Green" <light> (gShellyBulb01) ["Dimmer"] {channel="mqtt:topic:openhab:ShellyBulb01:color_green"}
Dimmer ShellyBulb01_color_red "Red" <light> (gShellyBulb01) ["Dimmer"] {channel="mqtt:topic:openhab:ShellyBulb01:color_red"}
Dimmer ShellyBulb01_color_blue "Blue" <light> (gShellyBulb01) ["Dimmer"] {channel="mqtt:topic:openhab:ShellyBulb01:color_blue"}
String ShellyBulb01_color_mode "Farbmodus" <light> (gShellyBulb01) ["Status"] {channel="mqtt:topic:openhab:ShellyBulb01:color_mode"}
Number ShellyBulb01_power "Leistung [%.1f W]" <energy> (gShellyBulb01) ["Status"] {channel="mqtt:topic:openhab:ShellyBulb01:power"}
Number ShellyBulb01_energy "Verbrauch [%.3f kWh]" <energy> (gShellyBulb01) ["Status"] {channel="mqtt:topic:openhab:ShellyBulb01:energy"}
//String ShellyBulb01_status "Status" <light> (gShellyBulb01) ["Status"] {channel="mqtt:topic:openhab:ShellyBulb01:status"}
Jemand eine idee?
Ein Colorpicker wäre auch was feines

