Controlling ON time of a switch.

Moderator: leecollings

Post Reply
JonyBCN
Posts: 39
Joined: Tuesday 24 May 2016 22:39
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Controlling ON time of a switch.

Post by JonyBCN »

I do not know if it is possible, but I definitely have not managed to do in Blockly.
I need to control the time it takes endencido a switch.
 For example: If the switch room takes on 15 minutes, turn off the switch office.
Some help?
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Controlling ON time of a switch.

Post by Egregius »

I think you'll need to explain better.
Do you mean turn of a light if another light is on for more then 15 minutes?
JonyBCN
Posts: 39
Joined: Tuesday 24 May 2016 22:39
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Controlling ON time of a switch.

Post by JonyBCN »

something like that, yes. I want to control the time it takes on a switch to act accordingly. for example, "if X switch takes time off, then Y Z switch acts form.
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Controlling ON time of a switch.

Post by Egregius »

I do that all the time to switch off lights that were switched by a PIR, or when I leave my home etc.

Parts of my pass2php script:

Code: Select all

if(strtotime($t['pirkeuken'])<tweemin && strtotime($t['wasbak'])<tweemin && $s['pirkeuken']=='Off' && $s['wasbak']=='On' && $s['werkblad']=='Off' && $s['keuken']=='Off' && $s['kookplaat']=='Off')sw($i['wasbak'],'Off');
 

Code: Select all

$items=array('denon','bureel','tv','tvled','kristal','eettafel','zithoek','garage','terras','tuin','voordeur','keuken','werkblad','wasbak','kookplaat','sony');
foreach($items as $item) if($s[$item] != 'Off' && strtotime($t[$item]) < time-$uit) sw($i[$item],'Off');
 
I can only suggest to learn one programming language and start scripting, a whole world of possibilities will open...
JonyBCN
Posts: 39
Joined: Tuesday 24 May 2016 22:39
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Controlling ON time of a switch.

Post by JonyBCN »

I tried with LUA and I must confess that I am a useless for it. Also, I think it would be a good option to implement Blockly, it is an excellent tool for those who do not know programming.
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Controlling ON time of a switch.

Post by Egregius »

This isn't lua, it's php. Much easier.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest