Repeating set on for X minutes

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
elRedeo
Posts: 9
Joined: Thursday 15 October 2015 23:44
Target OS: Linux
Domoticz version: newest
Location: Germeny
Contact:

Repeating set on for X minutes

Post by elRedeo »

Hello friends,

in blockly, I can use the sentence "set Device = On for 2 minutes".
This is working very well, but for example :
On timestamp 0 I trigger the lamp on for two minutes
On timestamp 60 seconds, I trigger again the lamp on for 2 minutes
On timestamp 120 seconds, the light is off :(

It would be nice, the light will go off at 180 seconds, because at timestamp 60 seconds I fired it again on for 120 seconds.

So I would request this functionalty for blockly :)

Thanks
elRedeo
Regards
Dominic
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Repeating set on for X minutes

Post by Egregius »

Don't use on for...
Set your switch on and use a time script to switch them on depending on one or multiple tast update times.
elRedeo
Posts: 9
Joined: Thursday 15 October 2015 23:44
Target OS: Linux
Domoticz version: newest
Location: Germeny
Contact:

Re: Repeating set on for X minutes

Post by elRedeo »

Thank you for the quick answer.
I am a lua noob, so the question is, are there example scripts?
I searched the wiki without succes. A helping hand would be graceful.
Regards
Dominic
elRedeo
Posts: 9
Joined: Thursday 15 October 2015 23:44
Target OS: Linux
Domoticz version: newest
Location: Germeny
Contact:

Re: Repeating set on for X minutes

Post by elRedeo »

OK, I searched the wron words on the wrong side :)

Will try this : http://www.domoticz.com/forum/viewtopic ... pir#p14415
Regards
Dominic
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Repeating set on for X minutes

Post by Egregius »

You can also use other languages if you don't know lua. I do everything in PHP.

In my pass2php script that looks like this:

Code: Select all

    if($s['pirgarage']=='Off'&&strtotime($t['pirgarage'])<driemin&&strtotime($t['poort'])<driemin&&strtotime($t['garage'])<driemin&&$s['garage']=='On'&&$s['lichten_auto']=='On')sw($i['garage'],'Off','licht garage');
So the light is switched of when the pir is off for more than 3 minutes, the port is more than 3 minutes opened/closed, the light is more than 3 minutes on and the virtual switch 'auto lights' is on.
elRedeo
Posts: 9
Joined: Thursday 15 October 2015 23:44
Target OS: Linux
Domoticz version: newest
Location: Germeny
Contact:

Re: Repeating set on for X minutes

Post by elRedeo »

OK, simple and much easier in blockly :
Set your switch on without any shut off condition
create a second blckly script for your lighting area with the condition if switch on then switch off after n seconds.

Each time the the PIR triggers the switch on command the countdown timer do branigan begin again :)

Just for know to each other with the same problem .....
Regards
Dominic
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest