Page 1 of 1

Bug Timer sur DZEvent

Posted: Monday 30 March 2026 14:16
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.

Re: Bug Timer sur DZEvent

Posted: Monday 30 March 2026 16:13
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/)

Re: Bug Timer sur DZEvent

Posted: Monday 30 March 2026 20:55
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

Re: Bug Timer sur DZEvent

Posted: Tuesday 31 March 2026 12:07
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!

Re: Bug Timer sur DZEvent

Posted: Tuesday 31 March 2026 12:21
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.