Rule for dimmer and LED strip
-
-
Hello!
I have two nodes:
- Dimmer (encoder with switch)
- RGB LED strip
Please tell me how to make a rule for controlling two parameters (on / off, brightness) of an RGB LED strip using a dimmer unit.
Perhaps someone already uses this rule in OpenHAB?




@vladimir
Are you looking for something similar to the following:rule "Rule Dimmer to Color Item Brightness" // TestDimmer121 is the item name of the dimmer value // Mock_RGB_Color_x is the Item name of the color strip // Openhab sends color data as Hue, Saturation, Brightness Data when Item TestDimmer121 changed then logInfo("rules","Dimmer to Color conversion Received " +TestDimmer121.state ) var PercentType BrightnessfromDimmer= TestDimmer121.state var HSBType currentState = Mock_RGB_Color_x.state as HSBType var DecimalType CurrentHue = currentState.hue var PercentType CurrentSaturation = currentState.saturation var PercentType CurrentBrightness = currentState.brightness logInfo("rules","HSBtype " + currentState) Mock_RGB_Color_x.sendCommand(new HSBType(CurrentHue,CurrentSaturation,BrightnessfromDimmer)) logInfo("rules","HSBtype NEW " +Mock_RGB_Color_x.state.toString) endYou did not post your item names, so you need to change to suit.
I do not have a HSB lamp node to physicaly test on, so i have only been checking the openhab logs.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login