Turning on and off a switch every 10 minutes ?

Moderator: leecollings

Post Reply
davidmarli
Posts: 8
Joined: Tuesday 02 February 2016 10:36
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Turning on and off a switch every 10 minutes ?

Post by davidmarli »

Hi,

In order to finish the implementation of the swimming pool heater, I need to turn on a switch for 2 minutes every 12 minutes from 10:00 to 18:00 every day.
How can I do that easily with domoticz ? And Is it possible ?

Thanks a lot.
sijones
Posts: 70
Joined: Wednesday 15 October 2014 14:16
Target OS: Linux
Domoticz version: Git
Location: UK
Contact:

Re: Turning on and off a switch every 10 minutes ?

Post by sijones »

Possibly use a LUA script, checking time is between the hours, always turn on for 2 at 10:00 then if it's been 12 minutes since last update turn on for 2.
jannl
Posts: 625
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: Turning on and off a switch every 10 minutes ?

Post by jannl »

Or via a shell (perl/python/..) script and a json call.
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Turning on and off a switch every 10 minutes ?

Post by Egregius »

Isn't it better to use a water thermometer?
radem205
Posts: 7
Joined: Sunday 29 November 2015 15:31
Target OS: Linux
Domoticz version: beta
Contact:

Re: Turning on and off a switch every 10 minutes ?

Post by radem205 »

Try the code below (not tested yet). You have to save the code as "script_time_whatever.lua" and put it in the scripts/lua directory. Or you can use the new build in lua script editor (select "Time" from the dropdown list to execute this script every minute).

Code: Select all

local switch = 'Switch name'

time = os.date("*t")

commandArray = {}

if time.hour > 10 and time.hour < 18 then
	if time.min % 12 == 0 then
		commandArray[switch] = 'On FOR 2'
	end
end

return commandArray
davidmarli
Posts: 8
Joined: Tuesday 02 February 2016 10:36
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Turning on and off a switch every 10 minutes ?

Post by davidmarli »

In fact I made two years ago a solar heater system. I'm oblige to make the water go through the pipe often : when the sun is ther in summer, if I let the water still in the pipe for 15 minutes, when I open it, the water exit the pipe at 70°C !!!
Once we left in hollidays, and I switch off the pump. When we came back, the pipe has melted !!!!

So I know it would be better to test the swimming pool water temperature and then decide if I have the turn on the pump of the heater, but I have no choice ...

What could I do, is to put a ds18b20 temperaure sensor INTO the pipe to have the real inside water temperature but ....

I will test the script.
Last edited by davidmarli on Wednesday 03 February 2016 16:50, edited 1 time in total.
oliviers
Posts: 73
Joined: Wednesday 16 September 2015 22:10
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Paris area, France
Contact:

Re: Turning on and off a switch every 10 minutes ?

Post by oliviers »

Hi,
Can't you just enter the 30 on/off commands in the switch planning ?
Oliviers
Paris area
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests