Conditional timers

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
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Conditional timers

Post by emme »

...timers are useful.. they help keeping automated almost all devices...
but what if I should have conditional timers that sre not only related to date/time?

example....
I have a timer at 6.45am (scenario) that:
lights my bathroom
set temp in the bathroom
switch on my bed light

at 7.00 I have the blinds group rise up...

BUT....
In case of rain I would NOT like to rise blinds
the more... is there is none in the house, there is no need to light up stuff....

Of course there are scripts for this (blocky?)... but is this the ONLY way? can we have a timer that FIRST have a script running and return true or false as an execution flag? (if the script does not exist TRUE wil be the default)

something like: script_timer_deviceGroupScenarioName.lua

Code: Select all

If my condition then 
   return true
else
   return false
end 
Would it be evaluable as a possible implementation
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
larsosca
Posts: 2
Joined: Wednesday 04 January 2017 16:53
Target OS: Windows
Domoticz version:
Contact:

Re: Conditional timers

Post by larsosca »

I have a similar problem.

Example:
I turn on garden lights at 6:00 AM and turn them off at sunrise.
But if the sunrise is earlier than 6:00 AM the lights will stay on the whole day.

I would like to link timers so that the sunrise turn off is overruling the fixed turn on timer.

This can be done by scripting, but then you lose the control looking at timers for the event.

Does anyone know a different way, then scripting, to solve that?

//Lasse
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Conditional timers

Post by Egregius »

Scripting, scripting, the wonderful world of scripting :D
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Conditional timers

Post by freijn »

Use a Lua timer script.

In the script you can check time to exec and then do check's like if somebody is home or its raining outside.

I always take the following approach :

- Start with a simple light on lua script, if that is working,
- Then put time checks in , if that is working,
- check rain of other conditions.

yes, it will eat some free evenings and yes it will keep you awake while you should be sleeping , but hey.. its fun :-)
markjgabb
Posts: 142
Joined: Tuesday 24 January 2017 23:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Australia
Contact:

Re: Conditional timers

Post by markjgabb »

or if you really want blocky you can do this

if time<sunrise and time is 6am
do turn on
V 2020.2 RPI 3
RFlink 334 mhz
mysensors
broadlink
Mirabella Genio Globes
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Conditional timers

Post by dannybloe »

use dzVents. Allows you to do all this easily.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest