dzVents only updating 1 switch/light

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

Moderator: leecollings

Post Reply
mischa
Posts: 74
Joined: Tuesday 07 April 2015 20:32
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8872
Location: Heerhugowaard, The Netherlands
Contact:

dzVents only updating 1 switch/light

Post by mischa »

Perhaps I'm doing something wrong or is this not supposed to happen?

I have a script made that dim my garden light to 80 % when the door is opened and it is dark outside, works fine. But only the first device is activated.

Code: Select all

return {
    active = true,
    on = {'Achterdeur'},
    execute = function(domoticz, Achterdeur)
	    if (Achterdeur.state == 'Open' and domoticz.variables['DarkOutside'].value == 'True')
	    	then 
	    	domoticz.devices['Tuin Verlichting'].dimTo(80).for_min(2) 
	    	domoticz.devices['Lamp Achterdeur'].dimTo(80).for_min(2)
	    end
    end
}
Attachments
Knipsel2.PNG
Knipsel2.PNG (29.18 KiB) Viewed 1025 times
Pi 2 - Pi 1 - Razzbery 2.0 - Fibaro FGD-211 - Fibaro FGD-212 - Fibaro FGRGBWM-441 (RGBW Module) - Fibaro FGBS321 (Universal Switch) - FGWPF-102 - TBK Home TZ67-G - Synology DS1515+ - Esp Easy (with wemos D1 mini)
mischa
Posts: 74
Joined: Tuesday 07 April 2015 20:32
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8872
Location: Heerhugowaard, The Netherlands
Contact:

Re: dzVents only updating 1 switch/light

Post by mischa »

figured out that dimTo() does not support duration, but this seems not to be the problem.
Only the level of [1] = Tuin Verlichting gets set. and [2] = Lamp Achterdeur does nothing.

Anybody an idea?
Pi 2 - Pi 1 - Razzbery 2.0 - Fibaro FGD-211 - Fibaro FGD-212 - Fibaro FGRGBWM-441 (RGBW Module) - Fibaro FGBS321 (Universal Switch) - FGWPF-102 - TBK Home TZ67-G - Synology DS1515+ - Esp Easy (with wemos D1 mini)
elmortero
Posts: 248
Joined: Sunday 29 November 2015 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9639
Location: Spain
Contact:

Re: dzVents only updating 1 switch/light

Post by elmortero »

And if your remove for both the .for_min(2) ? Does the second one work then?
Duration does not work, that is correct. But you can still add an extra command for both, switchOff().after_min(2) to switch them back off
mischa
Posts: 74
Joined: Tuesday 07 April 2015 20:32
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8872
Location: Heerhugowaard, The Netherlands
Contact:

Re: dzVents only updating 1 switch/light

Post by mischa »

I tried that, but no success. Still, only one switch gets updated.
And I don't want to switch them off, but dim them back to the previous level (5%)

Thinking about setting a user variable and make a time script that compares the last update time with the minutes past since the last update.
Pi 2 - Pi 1 - Razzbery 2.0 - Fibaro FGD-211 - Fibaro FGD-212 - Fibaro FGRGBWM-441 (RGBW Module) - Fibaro FGBS321 (Universal Switch) - FGWPF-102 - TBK Home TZ67-G - Synology DS1515+ - Esp Easy (with wemos D1 mini)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest