Is there any easy way to use timers with conditions?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
YellowSky
Posts: 65
Joined: Tuesday 12 May 2015 12:09
Target OS: Raspberry Pi / ODroid
Domoticz version: Last
Location: Belgium
Contact:

Is there any easy way to use timers with conditions?

Post by YellowSky »

Hi everyone, i found the timers extremely useful.
However, if i want to use them with a condition it becomes some complicated.
A exemple a timer lauch the switch at 16:00 only if the temperature x is over 15°C

My current solution
- I can use cron to launch a python script with the condition before using json to lauch or not the timer. It is not convenient due to it can be done by user interface.
- I can use lua time script to launch each minute a script and if the time is ok and the conditions, the command array function could be used. The same issue as previsouly and the script is executed each minute while it needs only to be lauch once a day

Is there any simpler way to achieve this aim?
Sandy
Posts: 8
Joined: Monday 11 December 2017 21:17
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10717
Location: Nijmegen (NL)
Contact:

Re: Is there any easy way to use timers with conditions?

Post by Sandy »

I'm new to domoticz so don't blame me if i'm wrong..
But couldnt you just use blockly like attached?
Attachments
Knipsel.JPG
Knipsel.JPG (21.51 KiB) Viewed 684 times
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Is there any easy way to use timers with conditions?

Post by Bikey »

You can use a dummy switch which is set on/of at e.g. 16:00 hours.
Then with blocky or LUA you can check (on "device changed" only) when the dummy switch is activated if the temperature is over 15 degrees to activate the main switch.
YellowSky
Posts: 65
Joined: Tuesday 12 May 2015 12:09
Target OS: Raspberry Pi / ODroid
Domoticz version: Last
Location: Belgium
Contact:

Re: Is there any easy way to use timers with conditions?

Post by YellowSky »

Thank you for your suggestions.
I forget to mention the first solution you have proposed.

So there is not easier solution (i find these solutions are not quick to implement compared to the timers but i understand the limitations).

Once again thank you for these suggestions.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest