Problem with timers

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!

Moderators: leecollings, remb0

Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
harrykausl
Posts: 193
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Problem with timers

Post 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?
harrykausl
Posts: 193
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Problem with timers

Post by harrykausl »

I think, the problem is, that a device timer does not start, when a time script is running. Is this correct?
User avatar
waltervl
Posts: 6001
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Problem with timers

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
harrykausl
Posts: 193
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Problem with timers

Post 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?
User avatar
waltervl
Posts: 6001
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Problem with timers

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
harrykausl
Posts: 193
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Problem with timers

Post 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.
User avatar
waltervl
Posts: 6001
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Problem with timers

Post 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?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
harrykausl
Posts: 193
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Problem with timers

Post 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.
harrykausl
Posts: 193
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Problem with timers

Post 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?
User avatar
gizmocuz
Posts: 2594
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Problem with timers

Post by gizmocuz »

Did you enabled a 'randomize' window on the timer? (like 15 before/after) ?
Quality outlives Quantity!
harrykausl
Posts: 193
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Problem with timers

Post by harrykausl »

Yes, 1:35 after sunrise
harrykausl
Posts: 193
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Problem with timers

Post 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
User avatar
gizmocuz
Posts: 2594
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Problem with timers

Post 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)
Quality outlives Quantity!
harrykausl
Posts: 193
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Problem with timers

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest