Bug Timer sur DZEvent

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
LorenzoZoub
Posts: 2
Joined: Monday 30 March 2026 14:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Bug Timer sur DZEvent

Post by LorenzoZoub »

Version: v2026.1 (build 17592)
Platform: Raspberry Pi 4 / OS64bits
Plugin/Hardware: Aucun (dzVents + 128IP Lares)

Description: Problèmes avec les timers et at_startup dans dzVents (volets + boot time)

Bonjour,
Je rencontre deux problèmes avec les dzVents sur cette version qui semblent liés aux timers :
1. Volets automatisés (le plus important)
Je veux un script par zone (un radar → un volet) avec :

Ouverture au passage détecté
Fermeture automatique après 60 minutes (timer reset à chaque passage)
TTS une seule fois par heure (cooldown)

J’ai testé :

Script global avec plusieurs radars
Scripts séparés par zone
timer = { 'every 5/10 seconds' }
data.lastTTS pour le cooldown
domoticz.time.isDayTime
.afterMin(60) et .afterSeconds(15)
system = { 'at_startup' } et on = { at_startup = true }
Timer every 10 seconds + blocage avec data.updated

Résultat : Aucun timer ne fonctionne correctement. Les volets s’ouvrent parfois, mais les fermetures et cooldowns ne se déclenchent jamais de façon fiable.
2. Capteur "Dernier redémarrage" (IDX 498 - type Text)
Je veux simplement que ce capteur affiche une seule fois la date/heure du dernier démarrage de Domoticz.
J’ai testé :

on = { system = { 'at_startup' } }
on = { at_startup = true }
Timer every 5/10 seconds + data.updated pour bloquer après 1 run
os.date() et domoticz.system.startTime
Script Lua au boot + dzVents qui écoute un dummy

Résultat : Le capteur reste bloqué sur l’heure de sa création. Aucun des scripts ne met à jour le texte au démarrage.
Quelqu’un a-t-il réussi à faire fonctionner correctement les timers ou le trigger at_startup sur cette version ?
Merci d’avance.
Attachments
Capture d'écran 2026-03-31 121451.png
Capture d'écran 2026-03-31 121451.png (66.06 KiB) Viewed 1502 times
Last edited by LorenzoZoub on Tuesday 31 March 2026 12:15, edited 1 time in total.
User avatar
waltervl
Posts: 7003
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Bug Timer sur DZEvent

Post by waltervl »

This is a English spoken forum. There is also a french spoken Domoticz forum.
So please translate your post to English or post on the french Forum (https://easydomoticz.com/forum/)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
gizmocuz
Posts: 3020
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Bug Timer sur DZEvent

Post by gizmocuz »

I don't think there is a timer for every x seconds, did you read the wiki?

https://wiki.domoticz.com/DzVents:_next ... _scripting

But maybe I understand your question wrong because it seems to be in French
Quality outlives Quantity!
LorenzoZoub
Posts: 2
Joined: Monday 30 March 2026 14:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Bug Timer sur DZEvent

Post by LorenzoZoub »

Sorry for french, I traduce:

Title: Bug dzVents timers (2026.1) – afterMin, data persistence and at_startup unreliable
Post:
Hello,
On Domoticz 2026.1 I am experiencing consistent failures with dzVents timers.
Problem description
I need per-zone scripts that do the following on motion detection (ALARM state from Lares 128IP):

Open corresponding shutter(s)
Auto-close after 60 minutes (or 1 hour)
Reset the timer on every new detection
TTS only once per hour (cooldown)

What I tried in dzVents (all failed):

on = { devices = {idx} } + item.active + data.lastTTS
timer = { 'every 5 seconds' } with manual blocking via data.updated
domoticz.devices(idx).switchOn().afterMin(60)
domoticz.devices(idx).switchOn().afterSeconds(15) for staggered multi-shutter
on = { system = { 'at_startup' } } and on = { at_startup = true }
Global script with multiple radars vs one script per zone

Result: Timers are either never triggered, fire multiple times, or simply do not persist. Closures and cooldowns are completely unreliable.
Working workaround (external Python script)
Since dzVents timers are broken, I moved the logic outside Domoticz:

Standalone Python script polling directly /xml/zones/zonesStatus128IP.xml every 0.5s
Uses native threading.Timer (one independent timer per zone/group)
Proper .cancel() before creating new timer on re-detection
40-second staggered opening for multi-volet groups
Auto-close exactly 1 hour after last detection
Launched at boot via crontab @reboot

This solution is rock-solid and has been running without any missed or duplicate actions.
Has anyone found a real fix inside dzVents/Lua for the timer engine in 2026.x, or is external Python currently the only reliable way?
Thanks!
User avatar
waltervl
Posts: 7003
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Bug Timer sur DZEvent

Post by waltervl »

Check the dzvents wiki for valid triggers as your message is a little bit unclear. https://wiki.domoticz.com/DzVents:_next ... E2%80%A6_}

The trigger probably is the PIR device.
then you can use domoticz.devices(idx).switchOn().afterMin(60)
Or make use of the lastUpdate.MinutesAgo of the PIR Device to reschedule.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply