[SOLVED] Change function of color picker item

hi,
I`m using the colorpicker item along with my ledstripes.

grafik
the button up and down switches the lights on and off. but instead of really power on/off they just send a color value (eg. 0,0,0 for power off). problem is that I have an external wall-switch which should also power on/off the lights but this doesn`t work when power is already on and color is 0,0,0.
yes, I know I could use another item for power on/off but if I could have my UI small would be nice. my wife stumples over this issue and I need to raise the WAF…
has someone an idea how to change the colorpicker item and change the button up/down to power on/off?
thanks

Unfortunately I don’t think you can.

BUT

You can use a rule:

rule "wall switch"
when
    Item WallSwitch received command
then
   if (LEDStrip.state == OFF) LEDStrip.state.sendCommand(ON) else LEDStrip.state.sendCommand(ON)
end

my statement that the colorpicker sends a color of 0,0,0 was wrong! the colorpicker buttons send ON or OFF

LED_Bad_Color changed from ON to OFF

I was gathering MQTT info back from the led strip and that reported a color 0,0,0. sure, it was switched OFF :see_no_evil:

so if anybody is interested in the config for magichome LED controller that is flashed with tasmota firmware:
items:

Switch LED_Bad "LEDlicht Bad [MAP(OnOff.map):%s]" <light> [ "Switchable" ] { mqtt=">[broker:cmnd/LED_Bad/POWER:command:*:default], 
                                          <[broker:stat/LED_Bad/POWER:state:default]"}
                   
String LED_Bad_Color   "LED Licht"                    {mqtt="<[broker:tele/LED_Bad/STATE:state:JSONPATH($.HSBColor)],
                                                                >[broker:cmnd/LED_Bad/HSBColor:state:*:default]"}

and the rule:

rule "switch off led controller"       

    when 
        Item LED_Bad_Color received command

        then
            if ( LED_Bad_Color.state.toString.contains("OFF")) sendCommand(LED_Bad,OFF)
            else sendCommand(LED_Bad,ON)
    end


1 Like