Dzvents as sprinkler controler
Moderator: leecollings
Dzvents as sprinkler controler
hello,
i would like to control my sprinkler system (4 valves visible as switches in domoticz)
what would be best approach to create dummy switch controlled with dzvents
i want to run (on switch)
1 valve (x min on then switch off)
2 valve (x min on then switch off)
3 valve (x min on then switch off)
4 valve (x min on then switch off)
it even possible to run script for so long?
problem is that i want to be able switch off at anytime and interrupt program and disable valves anytime....?
i would like to control my sprinkler system (4 valves visible as switches in domoticz)
what would be best approach to create dummy switch controlled with dzvents
i want to run (on switch)
1 valve (x min on then switch off)
2 valve (x min on then switch off)
3 valve (x min on then switch off)
4 valve (x min on then switch off)
it even possible to run script for so long?
problem is that i want to be able switch off at anytime and interrupt program and disable valves anytime....?
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Dzvents as sprinkler controler
@devros,
I am not sure I completely understand you requirements but this might be a start.
Create a virtual selector switch with level 0 = Off and other levels are the names of your Valve switches.
If you choose a valve it will be switched to On for 30 seconds by the script or until you manually switch it to Off
I am not sure I completely understand you requirements but this might be a start.
Create a virtual selector switch with level 0 = Off and other levels are the names of your Valve switches.
If you choose a valve it will be switched to On for 30 seconds by the script or until you manually switch it to Off
- Spoiler: show
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: Dzvents as sprinkler controler
Wow thanks so simple 
this should be as example how dzvents is powerful
thats even better then i wanted...
now only figure out how to add another choice to switch, to run all 4 valves consecutive
and maybe create dummy text variable with time (for easy change)

this should be as example how dzvents is powerful
thats even better then i wanted...
now only figure out how to add another choice to switch, to run all 4 valves consecutive
and maybe create dummy text variable with time (for easy change)

- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Dzvents as sprinkler controler
Add another level to selector with name "All" and add requested time in the description field in seconds like
SprinklerTime: 40
or modify the script a little bit to get different times per valve; you got the idea
SprinklerTime: 40
or modify the script a little bit to get different times per valve; you got the idea

- Spoiler: show
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: Dzvents as sprinkler controler
great 
last question how to handle stop when i run 4 valves consecutive switch
my idea is add next switch selector with stop and use cancelQueuedCommands() function and then disable all valves, or is more elegant way how to interrupt for loop?

last question how to handle stop when i run 4 valves consecutive switch
my idea is add next switch selector with stop and use cancelQueuedCommands() function and then disable all valves, or is more elegant way how to interrupt for loop?
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Dzvents as sprinkler controler
Just press the Off selection button; the script will react to that even if the Off was already selected
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: Dzvents as sprinkler controler
ooh thanks, will have to study your code
-
- Posts: 90
- Joined: Sunday 20 March 2016 18:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: LA, Ca USA
- Contact:
Re: Dzvents as sprinkler controler
FWIW, I implemented a sprinkler controller with Dzvents, and I'm pleased with it.
I use ESP's running ESPEasy to actually control the relays which turn on the sprinkler valves. I have a front and back, so I have two ESP's (Wemos D1 mini's) to handle this.
Dzvents is used to send the commands to turn on and off the sprinklers.
Randy
I use ESP's running ESPEasy to actually control the relays which turn on the sprinkler valves. I have a front and back, so I have two ESP's (Wemos D1 mini's) to handle this.
Dzvents is used to send the commands to turn on and off the sprinklers.
Randy
Re: Dzvents as sprinkler controler
Yes im also using esp easy - used rflink relay, but esp easy is better 

Re: Dzvents as sprinkler controler
all works great
BTW nice trick with description value

edit: one thing in program (all) are trigered all switches in same time (i want to triger them one after the other)
somehow to modify for loop, dam time to start study Lua

tried this but thats not working
Code: Select all
for k,v in ipairs(myValves) do
dz.devices(v).switchOn().forSec(sprinklerTime).switchOff().afterSec(sprinklerTime)
end
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Dzvents as sprinkler controler
can you try (not tested)
Code: Select all
local delay = 1
for k,v in ipairs(myValves) do
dz.devices(v).switchOn().afterSec(delay).forSec(sprinklerTime)
delay = delay + 1
end
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: No registered users and 1 guest