help needed with set color on rgbw  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

help needed with set color on rgbw

Post 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!
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post 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
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

Re: help needed with set color on rgbw

Post 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?
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: help needed with set color on rgbw

Post 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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

Re: help needed with set color on rgbw

Post 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!
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest