test new day

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

Post Reply
User avatar
pierrotori
Posts: 117
Joined: Tuesday 15 May 2018 0:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

test new day

Post by pierrotori »

Hi,
it is a best solution to get the new day and test if dz.time.hour == 0 in the dzvents script ?
Regards
rpi : Raspberry Pi 2 Model B Rev 1.1 / Modele : Cortex-A7 armv7l GNU/Linux / Os Name : bullseye
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
User avatar
pierrotori
Posts: 117
Joined: Tuesday 15 May 2018 0:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

Re: test new day

Post by pierrotori »

i found this solution with data persistent

Code: Select all

 
 local jour	= dz.time.day
if jour ~= dz.data.config.jour then
end
rpi : Raspberry Pi 2 Model B Rev 1.1 / Modele : Cortex-A7 armv7l GNU/Linux / Os Name : bullseye
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
HvdW
Posts: 601
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: test new day

Post by HvdW »

What about this?

Code: Select all

if os.date("%H:%M") == '23:59' then
or

Code: Select all

on = {
        timer = {
            'at midnight',
                   },
       }
Bugs bug me.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest