Page 1 of 1

Strange behaviour lastupdate.secondsAgo

Posted: Friday 29 May 2020 16:50
by acaonweb
Hi,
before 2020.1 i was able to calculate seconds between two updates of a dummy switch.
the code is like that

Code: Select all

return {
	on = {
		devices = {'update'},
	},
	data = {},
	logging = {
	    level = domoticz.LOG_DEBUG,
	    marker = "update: "
	},
	execute = function(dz, device, tginfo)
	   local update=dz.devices('update')
	   dz.log(update.lastUpdate.secondsAgo)
	end
}
switching the state of a dummy switch, i can have seconds using that code, and it was working


Now log tell me 0 seconds...

Code: Select all

2020-05-29 16:48:07.010 Status: dzVents: Info: Handling events for: "update", value: "Off"
2020-05-29 16:48:07.010 Status: dzVents: Info: update: : ------ Start internal script: test: Device: "update (Dummy)", Index: 187
2020-05-29 16:48:07.011 Status: dzVents: Info: update: : 0
2020-05-29 16:48:07.012 Status: dzVents: Info: update: : ------ Finished test
What's changed? What is my mistake?

Thanx in advance

Re: Strange behaviour lastupdate.secondsAgo

Posted: Friday 29 May 2020 17:24
by waaren
acaonweb wrote: Friday 29 May 2020 16:50 before 2020.1 i was able to calculate seconds between two updates of a dummy switch.
What's changed? What is my mistake?
What is your domoticz / dzVents version ?
between build 11886 and 12002 the lastUpdate value was not correctly send to dzVents. also see issue 4112

Re: Strange behaviour lastupdate.secondsAgo

Posted: Saturday 30 May 2020 7:39
by acaonweb
Version: 2020.2
Build Hash: b63341bc0
Compile Date: 2020-04-26 13:47:55
dzVents Version: 3.0.2
Python Version: 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0]

Re: Strange behaviour lastupdate.secondsAgo  [Solved]

Posted: Saturday 30 May 2020 10:13
by waaren
acaonweb wrote: Saturday 30 May 2020 7:39 Version: 2020.2, Build Hash: b63341bc0
This version indeed suffers from that issue. So either update to Beta or wait for the next release
(Please don't ask when the next release will come as no one knows)

Re: Strange behaviour lastupdate.secondsAgo

Posted: Sunday 31 May 2020 18:42
by acaonweb
Workaround?

Re: Strange behaviour lastupdate.secondsAgo

Posted: Sunday 31 May 2020 19:17
by waaren
acaonweb wrote: Sunday 31 May 2020 18:42Workaround?
Install latest Beta

Re: Strange behaviour lastupdate.secondsAgo

Posted: Monday 01 June 2020 8:42
by acaonweb
Well, without any kind of polemic, i think a big bug like that (a command that stop to works) needs a quick bug fix, and potentially beta can resolve this bug but introduce many others...
I’m worried about that, I’ll think on.