Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. OpenHAB
  4. Rule for dimmer and LED strip

Rule for dimmer and LED strip

Scheduled Pinned Locked Moved OpenHAB
2 Posts 2 Posters 1.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • vladimirV Offline
    vladimirV Offline
    vladimir
    wrote on last edited by
    #1

    Hello!

    I have two nodes:

    1. Dimmer (encoder with switch)
    2. 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?

    Dimmer
    Dimmer
    RGB LED strip
    RGB LED strip

    H 1 Reply Last reply
    0
    • vladimirV vladimir

      Hello!

      I have two nodes:

      1. Dimmer (encoder with switch)
      2. 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?

      Dimmer
      Dimmer
      RGB LED strip
      RGB LED strip

      H Offline
      H Offline
      hard-shovel
      wrote on last edited by
      #2

      @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) 
      end
      

      You 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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      17

      Online

      11.7k

      Users

      11.2k

      Topics

      113.1k

      Posts


      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular