Smarthome automation is interesting, but what I always find are scenes or some kind of one time event.
What I need is the following,
Mo - Fr: between 05:00 and 23:00, switch on a pump repeatedly on for 5 minutes, off 5 minutes
Sa - Su: between 06:00 and 24:00, switch on a pump repeatedly on for 5 minutes, off 5 minutes
I haven't found anything useful yet. Anyone any idea? Very much appreciated.
Need something like loops
Moderator: leecollings
- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
Re: Need something like loops
you can setup switches that act your pump and then use timers
otherwise.... you can use a LUA script (Time Event )
otherwise.... you can use a LUA script (Time Event )
Code: Select all
dow = tonumber(os.date('%w'))
-- Day Of Week goes from 0 (Sun) to 6 (Sat)
t1 = os.date('*t')
swPump = 'place here your pump device name'
commandArray = {}
if dow == 0 or dow == 6 then
if t1.hour >= 6 then
if (t1.min % 5) == 0 then
commandArray[swPump] = 'Toggle'
end
end
elseif (t1.hour >= 5) and (t1.hour <= 23) then
if (t1.min % 5) == 0 then
commandArray[swPump] = 'Toggle'
end
end
return commandArray
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
Who is online
Users browsing this forum: No registered users and 1 guest