Hi,
I have been playing with domoticz for 3 months now. Most of stuff is working as i would like it to do. There is only one thing which i gess is a simpel thing, but i just cannot find the right setting:
I have a simple blocky(starting to learn lua) script to turn on a light when the lux is less then 20 after 19:00. This works fine, but when i go to bed and i want to turn off the light it keeps turning to light on. Is there a way to say it only turns the light one ones a day or stop running the script after xx:xx time? I have been trying to find the answer in old topics, but no succes in finding the answer.
prevent a blocky script from running over and over again
Moderator: leecollings
- Egregius
- Posts: 2589
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: prevent a blocky script from running over and over again
Create 2 virtual switches: "away" and "sleep".
Let the script look at the status of those 2.
Only thing you have to do is activate 'sleep' when going to sleep.
Then you can also use the same switch to power off other devices, lower the heating,... Anything you can think off.
Let the script look at the status of those 2.
Only thing you have to do is activate 'sleep' when going to sleep.
Then you can also use the same switch to power off other devices, lower the heating,... Anything you can think off.
Re: prevent a blocky script from running over and over again
You could use a variable. Set variable to 0. Then: if lux < 20 and time > 19:00 and variable = 0, then turn on light and set variable to 1. When you turn off the light, the variable will still be1 and the light will not turn on again. Set the variable to 0 to let the script turn on the light again when lux < 20. For example, set the variable to 0 at a specific time (07:00), or when lux > 20.
-
- Posts: 20
- Joined: Thursday 19 May 2016 9:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: prevent a blocky script from running over and over again
Thx for your tips going to play with it in the weekend.
Who is online
Users browsing this forum: No registered users and 1 guest