switchOff.at: bug?  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

switchOff.at: bug?

Post by Number8 »

Hello
This code

Code: Select all

dz.devices(312).switchOn().at("between 15 minutes after civiltwilightstart and 15 minutes before civiltwilightend")
Triggers the following error

Code: Select all

2020-05-14 15:59:40.964 Error: dzVents: Error: (3.0.4) test timer script: /home/pi/domoticz/dzVents/runtime/Utils.lua:87: attempt to perform arithmetic on a nil value (local 'hours')
SwitchOff is executed and program stops execution right after.
The same 'at' conditions in

Code: Select all

on = { 
	devices = { 421, [363] = {"between 15 minutes after civiltwilightstart and 15 minutes before civiltwilightend"} }
works fine
dzVents 3.0.4
Debian buster on NUC and three RPi with buster.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: switchOff.at: bug?  [Solved]

Post by waaren »

Number8 wrote: Thursday 14 May 2020 16:09

Code: Select all

dz.devices(312).switchOn().at("between 15 minutes after civiltwilightstart and 15 minutes before civiltwilightend")
Triggers

Code: Select all

2020-05-14 15:59:40.964 Error: dzVents: Error: (3.0.4) test timer script: /home/pi/domoticz/dzVents/runtime/Utils.lua:87: attempt to perform arithmetic on a nil value (local 'hours')
at() does not use the relative timer rules. You can only use absolute times / days.

From the wiki..

.at(hh:mm[:ss][ on [ ddd|dddd ] ): Function.3.0.1 Activates the command at a certain time [ on a certain day]

device.switchOn().at('09:00') -- earliest moment it will be 09:00 hr.
device.switchOn().at('08:53:30 on fri') -- earliest moment it will be Friday at 08:53:30
device.switchOn().at('08:53:30 on sat, sun') -- earliest moment it will be Saturday or Sunday at 08:53:30 (whatever comes first)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: switchOff.at: bug?

Post by Number8 »

I see thanks
Debian buster on NUC and three RPi with buster.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest