Page 1 of 1
Problem with timers
Posted: Sunday 03 August 2025 10:09
by harrykausl
Hello,
I use timers on switches and on setpoint devices. I use after sunset, before sundown and exact timers. I often have the problem (2025.1) that timers don't work. I see it in the protocol of the device. Then I change the timers and perhaps they work again. I also use a time lua script, which works every minute. Perhaps there's a problem between these timers? Any suggestions how to fix this. Perhaps there's something fixed in a beta version of domoticz?
Re: Problem with timers
Posted: Monday 04 August 2025 19:58
by harrykausl
I think, the problem is, that a device timer does not start, when a time script is running. Is this correct?
Re: Problem with timers
Posted: Monday 04 August 2025 20:55
by waltervl
As the short lua script runs every minute this should not hamper normal timers.
It could perhaps be that when that lua script is running an external command longer than 1 minute and blocking Domoticz for this, it also blocks the device timer.
So in scripts use the asynchronous external commands or openurl functions to prevent that.
Re: Problem with timers
Posted: Tuesday 05 August 2025 8:41
by harrykausl
So I included a print at start and one at the end of the time script, This are only some seconds between. But in some subroutines called by the time script I handle some url's and json outputs. I see in the protocol of the switches, that the timer wasn't startet. May there is a problem, when the timer script and a timer start at the same time?
Re: Problem with timers
Posted: Tuesday 05 August 2025 9:14
by waltervl
Can you see Domoticz doing something else at the time a device timer should have been triggered?
By the way, for testing device timers you should plan those test actions minimum 2 minutes ahead in time to be able to have Domoticz load it into the event system.
Re: Problem with timers
Posted: Tuesday 05 August 2025 11:54
by harrykausl
I have always more than 2 minutes. I see, that some timers don't work (in protocol of the switch). Sometimes they work. As I use timers for some automations this is not good. When I change them or delete them and make new, they sometimes run. I think, there maybe a general problem with timers. Is there something changed in a beta release of domoticz, so I could test it.
There are always a lot of mqtt autodiscovery messages in the protocol, because my shellys are messaging values.
Re: Problem with timers
Posted: Tuesday 05 August 2025 13:14
by waltervl
What is the load on your CPU?
Do you have the Autodiscover main topic (default homeassistant) different than the main shelly state topics, eg shelly?
Re: Problem with timers
Posted: Tuesday 05 August 2025 13:26
by harrykausl
with top I see, that the cpu is not the problem. The mqtt auto discovery topic is homeassistant. For the shellies I used shellyteacher4domo to use autodiscovery.
In my opinnion there's a problem with queuing the time script and the timers because I see nothing in the protocol of the switch and in the main protocol. And sometimes it works. If something runs at the same time a timer should start, there might be a problem.
PS: Most of the devices with timers are dummy-devices.
Re: Problem with timers
Posted: Wednesday 06 August 2025 8:24
by harrykausl
yesterday I deactivated the time script. Now the timers run. But there's one thing. I have a timer on a switch with 1:35 after sunrise. Sunrise was in domoticz declared for 6:03. The switch was triggered on 7:52. Normaly this should have happened on 7:38. Perhaps theres the problem?
Re: Problem with timers
Posted: Wednesday 06 August 2025 8:34
by gizmocuz
Did you enabled a 'randomize' window on the timer? (like 15 before/after) ?
Re: Problem with timers
Posted: Wednesday 06 August 2025 8:56
by harrykausl
Yes, 1:35 after sunrise
Re: Problem with timers
Posted: Wednesday 06 August 2025 9:31
by harrykausl
There are a lot of mqtt messages for my shelly plugs. Temperature, power, voltage. The devices were autmatically createt. Now I deletet this devices which I don't need and deactivatet accept new devices. So I only get messages that there are mqtt messages but accept new hardware is disabled. I hope, this will be easier for domoticz to handle. It would be nice, if I could avoid this messages, but I don't find anything
Re: Problem with timers
Posted: Friday 08 August 2025 8:12
by gizmocuz
Domoticz should have no issues handling these messages.
I have lot's of Zigbee devices, and also 2 shellies, lots and lots of MQTT/Domoticz traffic
I assume you run everything on a Raspberry Pi 3 or higher? (CPU wise)
Also note, if you have a timer at 02:03am, the check to start this timer is not 'at' 02:03am', but if the current time equals or is greater then 02:03am
Meaning, even if you have a hiccup somewhere, this timer is still launched
I am pretty sure there are no issues with timers!
Please explain: "I see it in the protocol of the device"
Are you controlling mqtt devices with timers? Are those devices 'sleeping' devices? (like zwave/zigbee thermostats)
Re: Problem with timers
Posted: Friday 08 August 2025 8:49
by harrykausl
I am only controlling dummy switches with timers. I see in the protocol of the switch, that the timer didn‘t work, because the switch did not change. The problem is, that they sometimes work and sometimes not.
I am using a pi 4.