I use several PIR sensors to switch on lights. With a recent Domoticz update I suddenly find that the lights donot switch on any more. After a lot of searching, I am beginning to suspect that the PIR sensors send multiple signals. Domoticz recognizes the first and starts my script, where a KAKU switch is activated to switch the lights on. I think this happens while the PIR sensor is still putting out signals.
I have two questions.
1. is there a logical explanaition why this has worked OK, and now suddenly not? Has Domoticz become faster in the last update?
2. what can I do to delay the processing? I was looking for a "sleep" or "delay", but cannot find anything. Ideally I would want to specify a sleeptime in milliseconds.
Thanks in advance...
Sleep or Delay statement?
Moderator: leecollings
- Egregius
- Posts: 2592
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Sleep or Delay statement?
In PHP you have sleep() for seconds and usleep() for microseconds, but hey, this is the lua section so I didn't say anything 

-
- Posts: 749
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Sleep or Delay statement?
Yeah, well... if we had an easy way to insert Assembler into Domoticz.... but I want to stick to LUA here.Egregius wrote:In PHP you have sleep() for seconds and usleep() for microseconds, but hey, this is the lua section so I didn't say anything
Hans
-
- Posts: 32
- Joined: Saturday 25 February 2017 18:42
- Target OS: Linux
- Domoticz version: 2021.1
- Location: Milano, Italy
- Contact:
Re: Sleep or Delay statement?
You can use this simple function ....
Regards
Code: Select all
function sleep(n)
os.execute("sleep " .. tonumber(n))
end
Regards
Sorry for any spelling mistake, English is not my native language.
DomoticZ running on Ubuntu 20.04 LTS , dzVents Version: 3.1.7 , Python Version: 3.8.5
DomoticZ running on Ubuntu 20.04 LTS , dzVents Version: 3.1.7 , Python Version: 3.8.5
Who is online
Users browsing this forum: No registered users and 1 guest