Wake Up Light DzVents  [Solved]

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

Moderator: leecollings

Mrrodz
Posts: 22
Joined: Sunday 06 December 2015 21:15
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Wake Up Light DzVents

Post by Mrrodz »

Hi, im trying to make a wake up light with DzVents. I'm new to lua, but this is my best attempt. my problem is that the variable won't increase when the timer is done. Any help would be fantastic thank you.

Code: Select all

 return {
    on = {
        timer = {'every 5 seconds'}
        },
        data = {
            Bright = { initial = 0 }
        },
    execute = function(domoticz, item)
        if (domoticz.devices.state == 'On') then -- Wake Switch is on
            domoticz.log('Start Wake UP Light')  -- Write to Log
            if ((domoticz.devices('Bridge').level <= 100) and item.isTimer) then -- If Light is 100% stop increasing
                domoticz.data.Bright = domoticz.data.Bright + 5 -- Add 5 to Varible Bright
                domoticz.devices('Bridge').dimTo(domoticz.data.Bright)-- Set Brightness to Varible Bright
                domoticz.log('Increase Brightnes by Varible is '..domoticz.data.Bright) --Log Bright Value 
            end    
        else
            domoticz.log('Wake Up Off, reset Bright Varible')
            domoticz.data.initialize('Bright')-- Reset Bright Varible
            domoticz.devices('Bridge').dimTo(domoticz.data.Bright)
        end
end
}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wake Up Light DzVents

Post by waaren »

as far as I can see the line

Code: Select all

if (domoticz.devices.state == 'On') then -- Wake Switch is on
is not complete.

it should be something like

Code: Select all

if  domoticz.devices("your Wake Switch device name").state == 'On'  then -- Wake Switch is on
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: Wake Up Light DzVents

Post by poudenes »

timer = {'every 5 seconds'}

Minimum is 1 minute. You can't do less then 1 minute
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
Boredcat
Posts: 38
Joined: Friday 17 March 2017 9:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9639
Location: Netherlands
Contact:

Re: Wake Up Light DzVents

Post by Boredcat »

I am using this script for my wake up light.

In 30 minutes it to goes from 1% to 100% brightness. Every 18 seconds the brightness is increased, using the for loop

What it creates is the following list

licht.dimTo(2).afterSec(36)
licht.dimTo(3).afterSec(54)
licht.dimTo(4).afterSec(72)
..
licht,DimTi(100).afterSec(1800)

So after 36 seconds level to 2%
After 54 seconds level to 3%

Hope this helps.







Code: Select all

return {
	active = true,
	on = {
		devices = {
			'WAKEUP LIGHT',
		}
	},
	execute = function(domoticz, device)
		local licht = domoticz.devices('Slaapkamer')
		local WK = domoticz.devices('WAKEUP LIGHT')
		if (device.state == 'On') then
		    
		    licht.switchOn()
		    -- Lightswitched on
		    licht.dimTo(1)
		    -- Dim light to 1%
		    
		
		    for i = 1,100 do
		        t = i * 18
				licht.dimTo(i).afterSec(t)
				
			end
		    
	        
	       
			domoticz.log("WAKE UP LIGHT ACTIVE")
		end
		if (device.state == 'Off') then
		    licht.switchOff()
	   	end
		
	end
}
RFXCom(E) - Yeelight Lights - KaKu / Alexa HA Bridge
Windows 2012 / Windows 2012R2 / Xpenology/ Pi 3 / Milight / Home build ESP8266 / Sonoff
Mrrodz
Posts: 22
Joined: Sunday 06 December 2015 21:15
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Wake Up Light DzVents

Post by Mrrodz »

thank you for the reply's

waaren - sorry yes that how i do i have it, missed that bit when re typing.

poudenes - ahh right, in the DzVents it had an example with 5 seconds in it. i will adjust and see what happens.

Boredcat - interesting way, i think ill try this. could you share the full script as i haven't been able to get 'for' loop to work.


many thanks
Mrrodz
Posts: 22
Joined: Sunday 06 December 2015 21:15
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Wake Up Light DzVents

Post by Mrrodz »

Ok so I've got it working. Poudenes i changed the timer to 1 min and it worked

Code: Select all

 return {
    on = {
        timer = {'every minute'}
        },
        data = {
            Bright = { initial = 0 }
        },
    execute = function(domoticz, item)
        if (domoticz.devices('Wake').state == 'On') then -- Wake Switch is on
            domoticz.log('Start Wake UP Light')  -- Write to Log
            if ((domoticz.devices('Bridge').level <= 100) and item.isTimer) then -- If Light is 100% stop increasing
                domoticz.data.Bright = domoticz.data.Bright + 20 -- Add 5 to Varible Bright
                domoticz.devices('Bridge').dimTo(domoticz.data.Bright)-- Set Brightness to Varible Bright
            end    
        else
            domoticz.log('Wake Up Off, reset Bright Varible')
            domoticz.data.initialize('Bright')-- Reset Bright Varible
            domoticz.devices('Bridge').dimTo(domoticz.data.Bright)
        end
end
}
ideally i would like to run this every 5 seconds for a gradual increase. is this possible ? otherwise i will try Boredcats method.

thanks
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Wake Up Light DzVents

Post by dannybloe »

It is not possible. Shortest event interval is one minute with domoticz. Boredcats solution is the way to go. And brilliant ;)
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Boredcat
Posts: 38
Joined: Friday 17 March 2017 9:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9639
Location: Netherlands
Contact:

Re: Wake Up Light DzVents

Post by Boredcat »

@DannyBloe : Thnx. Not mine own idea, Found the basic in a blocky script ;-). Just adapted it to a DzVents script

@Mrrodz :

here the exact script that I am using (with even the old test comments that I used), and this works.
It is running on v3.9049


Triggered with a dummy Switch name WAKEUP LIGHT
The slaapkamer is a Yeelight White light (not that the best wakeup light, 1% brightness is already to bright).

Let me know if I can help.

Code: Select all

return {
	active = true,
	on = {
		devices = {
			'WAKEUP LIGHT',
		}
	},
	execute = function(domoticz, device)
		local licht = domoticz.devices('Slaapkamer')
		local WK = domoticz.devices('WAKEUP LIGHT')
		if (device.state == 'On') then
		    -- domoticz.devices('Lamp bank links').switchOn().forSec(2).repeatAfterSec(1, 3)
		    licht.switchOn()
		    licht.dimTo(1)
		    
		    for i = 1,100 do
		        t = i * 18
				licht.dimTo(i).afterSec(t)
				-- domoticz.log('WAKE UP LIGHT timer ' ..i)
			end
		    
	        
	        -- domoticz.devices('Lamp bank links').setNightMode()
			domoticz.log("WAKE UP LIGHT ACTIVE")
		end
		if (device.state == 'Off') then
		    licht.switchOff()
	   	end
		
	end
}
RFXCom(E) - Yeelight Lights - KaKu / Alexa HA Bridge
Windows 2012 / Windows 2012R2 / Xpenology/ Pi 3 / Milight / Home build ESP8266 / Sonoff
hscholing
Posts: 9
Joined: Tuesday 25 September 2018 21:03
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Netherlands
Contact:

Re: Wake Up Light DzVents

Post by hscholing »

How can I change this to dim instead of turning up the lights? I want to dim a light from 50% to 0% in about 15 minutes. I cannot really understand the script right now or is there a more simple solution for my wishes?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wake Up Light DzVents

Post by waaren »

hscholing wrote: Tuesday 01 January 2019 23:36 How can I change this to dim instead of turning up the lights? I want to dim a light from 50% to 0% in about 15 minutes. I cannot really understand the script right now or is there a more simple solution for my wishes?
You can achieve that by changing the direction in the for loop. So no stepping up like it was (default stepsize = 1) but stepping down (stepsize -1)

Code: Select all

return {
	
	on = {
		devices = {
			'WAKEUP LIGHT',
		}
	},
	execute = function(domoticz, device)
		local licht = domoticz.devices('Slaapkamer')
		local WK = domoticz.devices('WAKEUP LIGHT')
		if (device.state == 'On') then
		    -- domoticz.devices('Lamp bank links').switchOn().forSec(2).repeatAfterSec(1, 3)
		    licht.switchOn()
		    licht.dimTo(50)            -- start at 50%
		    
		    for i = 50,0,-1 do          -- stepping down from 50 to 0
		        t = i * 18                   -- 50 steps of 18 seconds = 900 seconds = 15 minutes
				licht.dimTo(i).afterSec(900 - t)
				-- domoticz.log('WAKE UP LIGHT timer ' ..i)
			end
		    
	        
	        -- domoticz.devices('Lamp bank links').setNightMode()
			domoticz.log("WAKE UP LIGHT ACTIVE")
		end
		if (device.state == 'Off') then
		    licht.switchOff()
	   	end
		
	end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
gerbenvanasselt
Posts: 74
Joined: Friday 07 September 2018 14:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta 4.1
Location: Netherlands
Contact:

Re: Wake Up Light DzVents

Post by gerbenvanasselt »

Hi Guys,

I am trying enhancing the script for my aquarium. Switching it on works great, but the part switching it off the other way from 80% to 0% does not work. It switches off immediatly. Not taking the wanted percentage steps. Any Idea what to do?

Very nice script by the way!!!

Code: Select all

return {
	active = true,
	on = {
		devices = {
			'Aquarium Trigger',
		}
	},
	
	execute = function(domoticz, device)
		local licht = domoticz.devices('AquaLicht')
				if (device.state == 'On') then
		    	    licht.switchOn()
		            licht.dimTo(20)
		    
		    for i = 20,80 do
		        t = i * 1
				licht.dimTo(i).afterSec(t)
				
			end
		    
	        
	       	domoticz.log("Aquarium light ACTIVE")
		end
		
		    if (device.state == 'Off') then
		    		    
		    licht.dimTo(80)
		    
			for i = 80,0,-1 do
		        t = i * 1
				licht.dimTo(i).afterSec(t)
			end
		    	        
	        domoticz.log("Aquarium light Off")
	   		
		end
		
	end
}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wake Up Light DzVents

Post by waaren »

gerbenvanasselt wrote: Saturday 04 January 2020 14:51 I am trying enhancing the script for my aquarium. Switching it on works great, but the part switching it off the other way from 80% to 0% does not work. It switches off immediatly. Not taking the wanted percentage steps. Any Idea what to do?

Change line 31 from

Code: Select all

		        licht.dimTo(i).afterSec(t)
to

Code: Select all

		        licht.dimTo(i).afterSec(80 - t)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
gerbenvanasselt
Posts: 74
Joined: Friday 07 September 2018 14:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta 4.1
Location: Netherlands
Contact:

Re: Wake Up Light DzVents  [Solved]

Post by gerbenvanasselt »

@Waaren, thanks that did the trick, very happy with it.
jake
Posts: 742
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Wake Up Light DzVents

Post by jake »


waaren wrote:
hscholing wrote: Tuesday 01 January 2019 23:36 How can I change this to dim instead of turning up the lights? I want to dim a light from 50% to 0% in about 15 minutes. I cannot really understand the script right now or is there a more simple solution for my wishes?
You can achieve that by changing the direction in the for loop. So no stepping up like it was (default stepsize = 1) but stepping down (stepsize -1)

Code: Select all

		    
		    for i = 50,0,-1 do          -- stepping down from 50 to 0
		        t = i * 18                   -- 50 steps of 18 seconds = 900 seconds = 15 minutes
				licht.dimTo(i).afterSec(50 - t)
				-- domoticz.log('WAKE UP LIGHT timer ' ..i)
			end

}
Shouldn't this be changed into:

Code: Select all

licht.dimTo(i).afterSec(900 - t)
instead?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wake Up Light DzVents

Post by waaren »

jake wrote: Sunday 05 January 2020 21:33 Shouldn't this be changed into:

Code: Select all

licht.dimTo(i).afterSec(900 - t)
instead?
Thx !
You are right and I modified it now.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
gerbenvanasselt
Posts: 74
Joined: Friday 07 September 2018 14:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta 4.1
Location: Netherlands
Contact:

Re: Wake Up Light DzVents

Post by gerbenvanasselt »

Hi guys,

The script was working for a while but not in the way I would like it to work. The proces with dimming from 0 to 100 goes well. The challenge is in te 100 to 0. When it reaches 0, after a few minutes my aquarium switches on again. This is unexpected behaviour.

Hope you can help me out?

This my script:

Code: Select all


[return {
	active = true,
	on = {
		devices = {
			'Aquarium Trigger',
		}
	},
	
	execute = function(domoticz, device)
		local licht = domoticz.devices('AquaLichtT')
				if (device.state == 'On') then
		    	    licht.switchOn()
		            licht.dimTo(20)
		    
		    for i = 20,100 do
		        t = i * 6
				licht.dimTo(i).afterSec(t)
				
			end
		    
	        
	       	domoticz.log("Aquarium light ACTIVE")
		end
		
		    if (device.state == 'Off') then
		    		    
		        licht.dimTo(100)
		    
			for i = 100,0,-1 do
		        t = i * 6
				licht.dimTo(i).afterSec (600-t)
				
			domoticz.log("Aquarium light Off")
			
		end
		    	        
	        
	   	
	end
		
	end
}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wake Up Light DzVents

Post by waaren »

gerbenvanasselt wrote: Friday 26 June 2020 14:59 The script was working for a while but not in the way I would like it to work. The proces with dimming from 0 to 100 goes well. The challenge is in te 100 to 0. When it reaches 0, after a few minutes my aquarium switches on again. This is unexpected behaviour.
I don't see any code in this script that does this. Can you specify 'a few minutes' more precise?
It could also help to find what is causing this to look at the log.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
gerbenvanasselt
Posts: 74
Joined: Friday 07 September 2018 14:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta 4.1
Location: Netherlands
Contact:

Re: Wake Up Light DzVents

Post by gerbenvanasselt »

Hi there,

Think i found the problem. I restored a backup on another pi with all the scripts on it. That one interfered with my main domoticz setup. So the scripts competed with each other. That's why it messed up my setup!
IceBlackz
Posts: 12
Joined: Friday 29 March 2019 19:22
Target OS: Linux
Domoticz version:
Location: Wadenoijen
Contact:

Re: Wake Up Light DzVents

Post by IceBlackz »

Sorry for reviving this old topic, but it has a nice solution in making a wake up light. However, when using the method mentioned underneath it will generate a couple of lines with the .afterSec option. I also want to be able to cancel them all, is there a command to do such a thing? Like, cancel all outstanding/upcoming orders to a device to stop the dimming process at the current values?

Code: Select all

return {
	on = {
		scenes = {
			'WakeUpLight'
		}
	},
	execute = function(domoticz, scene)
	    --WakeUpLight scene idx = 3, somehow it won't take text
	    --local WULschakelaar = domoticz.devices('Dummy_switch_for_wakeuplight')
	    --local WULscene = domoticz.scenes('WakeUpLight')
	    local WULschakelaar = scene
	    local licht = domoticz.devices('Bed Ledstrip')
		domoticz.log('Scene ' .. scene.name .. ' was changed', domoticz.LOG_INFO)
		if WULschakelaar.state == 'On' then
		    domoticz.log ('The state of the scene is detected as ON, starting')
		    --licht.dimTo(30)
		    --licht.setColor(0,0,0,2,255,0,4,0)
		    local i = 1
		    local j = 0
		    local br = 100
		    local cw = 0
		    local ww = 0
		    local timestep = 1
		    local donewithloop = 0
		    
		    while donewithloop == 0 do
		        if WULschakelaar.state == 'Off' then
		            donewithloop = 1
		        elseif cw <= 25 then
		            cw = cw + 1
		        elseif ww <= 50 then
		            ww = ww + 1
		        elseif ww <= 254 then
		            ww = ww + 1
		            if j == 4 then
		                cw = cw + 1
		                j = 0
		            end
		            j = j + 1
		        elseif cw <= 254 then
		            cw = cw + 1
		        else
		            donewithloop = 1
		        end
		        licht.setColor(0,0,0,br,cw,ww,4,0).afterSec(timestep*i)
		        i = i + 1
		    end
		        
		elseif WULschakelaar.state == 'Off' then
		    domoticz.log('The state of the scene is detected as OFF')
		    --licht.dimTo(50)
		    licht.switchOff()
		else
		    domoticz.log('The state of the scene is unknown!')
		end
		domoticz.log(licht.color)
	end
}
FYI; I'm controlling an H801 flashed with Tasmota, and also noticed the following jump from white=100 to white=77 at a certain hex value:

Code: Select all

21:27:03 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":96,"Color":"0000003BB9","HSBColor":"0,0,0","White":96,"CT":416,"Channel":[0,0,0,23,73]}
21:27:04 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":96,"Color":"0000003BBA","HSBColor":"0,0,0","White":96,"CT":416,"Channel":[0,0,0,23,73]}
21:27:05 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":96,"Color":"0000003BBB","HSBColor":"0,0,0","White":96,"CT":417,"Channel":[0,0,0,23,73]}
21:27:06 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":97,"Color":"0000003CBC","HSBColor":"0,0,0","White":97,"CT":416,"Channel":[0,0,0,24,74]}
21:27:07 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":98,"Color":"0000003CBD","HSBColor":"0,0,0","White":98,"CT":416,"Channel":[0,0,0,24,74]}
21:27:08 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":98,"Color":"0000003CBE","HSBColor":"0,0,0","White":98,"CT":417,"Channel":[0,0,0,24,75]}
21:27:09 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":98,"Color":"0000003CBF","HSBColor":"0,0,0","White":98,"CT":417,"Channel":[0,0,0,24,75]}
21:27:10 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":99,"Color":"0000003DC0","HSBColor":"0,0,0","White":99,"CT":416,"Channel":[0,0,0,24,75]}
21:27:11 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":100,"Color":"0000003DC1","HSBColor":"0,0,0","White":100,"CT":417,"Channel":[0,0,0,24,76]}
21:27:12 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":100,"Color":"0000003DC2","HSBColor":"0,0,0","White":100,"CT":417,"Channel":[0,0,0,24,76]}
21:27:13 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":100,"Color":"0000003DC2","HSBColor":"0,0,0","White":100,"CT":417,"Channel":[0,0,0,24,76]}
21:27:14 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":77,"Color":"0000003EC4","HSBColor":"0,0,0","White":77,"CT":417,"Channel":[0,0,0,24,77]}
21:27:15 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":77,"Color":"0000003EC5","HSBColor":"0,0,0","White":77,"CT":417,"Channel":[0,0,0,24,77]}
21:27:16 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":78,"Color":"0000003EC6","HSBColor":"0,0,0","White":78,"CT":417,"Channel":[0,0,0,24,78]}
21:27:17 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":78,"Color":"0000003EC7","HSBColor":"0,0,0","White":78,"CT":418,"Channel":[0,0,0,24,78]}
21:27:18 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":78,"Color":"0000003FC8","HSBColor":"0,0,0","White":78,"CT":417,"Channel":[0,0,0,25,78]}
21:27:19 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":79,"Color":"0000003FC9","HSBColor":"0,0,0","White":79,"CT":417,"Channel":[0,0,0,25,79]}
21:27:20 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":79,"Color":"0000003FCA","HSBColor":"0,0,0","White":79,"CT":418,"Channel":[0,0,0,25,79]}
21:27:21 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":80,"Color":"0000003FCB","HSBColor":"0,0,0","White":80,"CT":418,"Channel":[0,0,0,25,80]}
21:27:22 MQT: stat/tasmota_CF13F8/RESULT = {"POWER":"ON","Dimmer":80,"Color":"00000040CC","HSBColor":"0,0,0","White":80,"CT":417,"Channel":[0,0,0,25,80]}
This is sadly enough also visible with the eye, suddenly the warmth of the white changes.. Does anyone have any tip how to solve this? I guess it's a setting in Tasmota, but I don't know which :(


Edit: I tried licht.cancelQueuedCommands(), but that doesn't work. Is this a bug? Because that should be the function I'm looking for..
Last edited by IceBlackz on Tuesday 03 November 2020 21:46, edited 1 time in total.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wake Up Light DzVents

Post by waaren »

IceBlackz wrote: Tuesday 03 November 2020 21:15 when using the method mentioned underneath it will generate a couple of lines with the .afterSec option. I also want to be able to cancel them all, is there a command to do such a thing?
The dzVents setColor method uses an openURL API call to do the job. Unfortunately there is no possibility for this method to cancel commands already sent to core domoticz like there is for native eventSystem commands as dimTo(), switchOn(), etc.. For these native type of commands you can use cancelQueuedCommansds() to empty the commands queue for a device.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests