RGB MQTT dimmer
-
There seems to be an example already in the 1.5 for the RGB 3D dimmer.
So if i use it - how do i connect to openhab via MQTT?Found a solution like below but that seems only for a sinble item... Maybe there is a solution on this forum i missed?
// WiFi RGB 2 Group WIFI_RGB_2 "WiFi RGB 2" (All) Color fWIFI_RGB_2 "RGB" <slider> (WIFI_RGB_2) String WIFI_RGB_2_RGB (WIFI_RGB_2) {mqtt=">[broker:/openHAB/RGB_2/Color:command:*:default]"} Switch WIFI_RGB_2_Switch1 "W1" (WIFI_RGB_2) {mqtt=">[broker:/openHAB/RGB_2/SW1:command:ON:100],>[broker:/openHAB/RGB_2/SW1:command:OFF:0]"}
And than a rule like
import org.openhab.core.library.types.* var HSBType hsbValue var int redValue var int greenValue var int blueValue var String RGBvalues rule "Set RGB 2 value" when Item fWIFI_RGB_2 changed then hsbValue = fWIFI_RGB_2.state as HSBType redValue = hsbValue.red.intValue greenValue = hsbValue.green.intValue blueValue = hsbValue.blue.intValue RGBvalues= redValue.toString + ";" + greenValue.toString + ";" + blueValue.toString sendCommand( WIFI_RGB_2_RGB, RGBvalues ) logInfo( "fWIFI_RGB_2", RGBvalues ) end```
-
Ok got it working. But now i see the main problem. When you change the colour - there is a lag so othe colours are seen. Same goes to switching off. For example we were at white light fullbrightness than switched off.
You can first see the light becoming yelow, than blue than off.How can this be fixed? If i understand correctly - you have to pass all these HSB value processing to arduino and have the controller send 3 values at once. Are there any examples?
2 out of 2
Suggested Topics
-
Update RF24 library to latest version
Bug Reports • 23 Mar 2014, 23:37 • andriej 24 Mar 2014, 22:52 -
Which device I have to use to connect with accelerometer before connecting to my pc?
General Discussion • 24 Jan 2023, 17:16 • Yada Kijsathan 15 days ago -
Meet in Malmö, Summer 2016?
General Discussion • 1 Feb 2016, 15:34 • bjacobse 28 days ago -
Running out of nodeId's
General Discussion • 3 Sept 2024, 07:33 • NielBierman 25 Jan 2025, 17:19 -
No merge into master in the last 5 years, should we use development?
General Discussion • 23 Sept 2024, 17:48 • kiesel 6 days ago -
Human presence sensors....
General Discussion • 31 Jan 2025, 10:54 • skywatch 9 Feb 2025, 19:36