Page 1 of 1

switchOff.at: bug?

Posted: Thursday 14 May 2020 16:09
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

Re: switchOff.at: bug?  [Solved]

Posted: Thursday 14 May 2020 17:08
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)

Re: switchOff.at: bug?

Posted: Thursday 14 May 2020 18:28
by Number8
I see thanks