Page 1 of 1

Some example DZ vents

Posted: Sunday 23 September 2018 19:14
by Derik
Dear all..
Is there someone that have a example for me in dzvents: a switch X on for x minutes
And in that option when switch X is off then on
And the other option when switch Y is of then turn on X for x minutes

The thing i am searching for, is when my solarpanels are working my dummy Y is on, then i need X is on.
Only when my solarpanels stop working so Y is OFF, i need a timer that set the X switch on for x minutes.

With this option i can set a lot of devices to ON when my pannels are working.
Only if the pannels are not working, i need to set some devices to ON for charging etc etc

Hope there is ...

Re: Some example DZ vents

Posted: Sunday 23 September 2018 21:32
by hoeby
Why do you need it whit DZ vents?
You could make that with blocky

Blocky gives the oppertunity when dummy Y = ON --> switch X = ON
Also blocky give the oppertunity when dummy Y = OFF --> switch X OFF after ? seconds

Re: Some example DZ vents

Posted: Sunday 23 September 2018 21:36
by Derik
In blockley i do have less options for a timer when the other switch is off

Re: Some example DZ vents

Posted: Sunday 23 September 2018 21:46
by hoeby
Give you an advice to read the wiki about DZvents.
You also asked for something about day in month. Also that information could be found in de wiki.


Just copied these example scripts out of the wiki.
They need to be modified to what you need. They are not complete, so do not copy them and paste them in dzvents, it will not work

Code: Select all

-- switch on for 2 minutes after 10 seconds
device.switchOn().afterSec(10).forMin(2)

-- switch on for 2 minutes after a randomized delay of 1-10 minutes
device.switchOff().withinMin(10).forMin(2)
device.close().forMin(15)
device.open().afterSec(20)
device.open().afterMin(2)

Code: Select all

if (light.active) then
   light.switchOff().afterMin(5)
else
   light.switchOn().forMin(5)
end

Code: Select all

on = {
       timer = {
		'on 23/11',                  -- (2.4.0) on 23rd of november (dd/mm)
 end
      },
   }