Strange behaviour lastupdate.secondsAgo  [Solved]

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

Moderator: leecollings

Post Reply
acaonweb
Posts: 92
Joined: Thursday 23 March 2017 14:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Strange behaviour lastupdate.secondsAgo

Post 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
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Strange behaviour lastupdate.secondsAgo

Post 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
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
acaonweb
Posts: 92
Joined: Thursday 23 March 2017 14:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange behaviour lastupdate.secondsAgo

Post 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]
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Strange behaviour lastupdate.secondsAgo  [Solved]

Post 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)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
acaonweb
Posts: 92
Joined: Thursday 23 March 2017 14:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange behaviour lastupdate.secondsAgo

Post by acaonweb »

Workaround?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Strange behaviour lastupdate.secondsAgo

Post by waaren »

acaonweb wrote: Sunday 31 May 2020 18:42Workaround?
Install latest Beta
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
acaonweb
Posts: 92
Joined: Thursday 23 March 2017 14:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange behaviour lastupdate.secondsAgo

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest