Page 1 of 1

help needed with set color on rgbw

Posted: Monday 10 February 2020 21:14
by snellejellep
Hi all,

i need some help, i have a wifi led strip flashed with tasmota that supports rgbw. it has a rgb led and a white led.
i want to set it to only turn on the white led with a dzvents script but the script below turns the rgb leds to a blue ish white and does not turn on the white channel.
in the domoticz interface there is a seperate slider for white, see picture:
Image
but how to control this?
the below script with rgb value does not work and i cannot seem to find any rgbw options in the dzvents wiki.

Code: Select all

return {
	on = {
		devices = {
			'Knop Renske'
		}
	},
	execute = function(dz, device)
		local knop          = dz.devices("Knop Renske")
		local led           = dz.devices("Ledstrip Renske")
		
		if (knop.state == "Click" or knop.state == "Long Click") and led.state == "Off" then
		    led.switchOn()
		    led.dimTo(100)
		    led.setHex(255,255,255)
		elseif (knop.state == "Click" or knop.state == "Long Click") and led.state ~= "Off" then
		    led.switchOff()
		elseif knop.state == "Double Click" then
		    led.dimTo(100)
		    led.setHex(255,255,255)
		end
	end
}
any help is greatly appreciated!

Re: help needed with set color on rgbw  [Solved]

Posted: Monday 10 February 2020 22:49
by waaren
snellejellep wrote: Monday 10 February 2020 21:14 I need some help, i have a wifi led strip flashed with tasmota that supports rgbw. it has a rgb led and a white led.
I want to set it to only turn on the white led with a dzvents script but the script below turns the rgb leds to a blue ish white and does not turn on the white channel.
I don't know this device but you could try.

Code: Select all

return {
    on = {
        devices = {
            'Knop Renske'
        }
    },
    
    logging = 
    {
        level = domoticz.LOG_DEBUG,
        marker = 'led control',
    },
    
    execute = function(dz, device)
        local knop          = dz.devices("Knop Renske")
        local led           = dz.devices("Ledstrip Renske")
        
        if (knop.state == "Click" or knop.state == "Long Click") and led.state == "Off" then
            led.switchOn()
            led.dimTo(100)
            led.setColor(0, 0, 0, 100, 255, 255, 1, 0)
        elseif (knop.state == "Click" or knop.state == "Long Click") and led.state ~= "Off" then
            led.switchOff()
        elseif knop.state == "Double Click" then
            led.dimTo(100)
            led.setColor(0, 0, 0, 100, 255, 255, 1, 0)
        end
    end
}

Re: help needed with set color on rgbw

Posted: Tuesday 11 February 2020 17:37
by snellejellep
That is exactly what i was looking for but i could not figure out that color code, is that somewhere listed on the wiki how to create that?

Re: help needed with set color on rgbw

Posted: Tuesday 11 February 2020 17:54
by waaren
snellejellep wrote: Tuesday 11 February 2020 17:37 That is exactly what i was looking for but i could not figure out that color code, is that somewhere listed on the wiki how to create that?
I have not found this on a wiki but if you choose a color on the GUI and goto the developer tools (CTRL shift I in chrome) you see the command send to domoticz in the network tab). You can use the values found there in the setcolor command in dzVents.

Re: help needed with set color on rgbw

Posted: Wednesday 12 February 2020 20:55
by snellejellep
waaren wrote: Tuesday 11 February 2020 17:54 I have not found this on a wiki but if you choose a color on the GUI and goto the developer tools (CTRL shift I in chrome) you see the command send to domoticz in the network tab). You can use the values found there in the setcolor command in dzVents.
i will try that in the future. thanks!