Page 1 of 1

lastUpdate from triggered device is now (0 seconds ago)

Posted: Tuesday 22 September 2020 22:01
by Tjalling94
I'm running some dzVents scripts that use the 'lastUpdate' from the triggeredDevice. For some months the lastUpdate is the current time (or 1-2 sec old) while expect it to be the time it was updated before this script was called. I can't figure out what's wrong.

When I call the device using domoticz.devices('name').lastUpdate I get the same result. When calling another device, that is not triggered on that time, the lastUpdate is the time it was lastUpdated.

Code: Select all

return {
	on = {
		devices = {
			'Motion *',
			'MC *'
		}
	},
	execute = function(domoticz, device)
	    local lastTime = device.lastUpdate.minutesAgo; -- 0

Relevant log:

Code: Select all

Status: dzVents: Info: Handling events for: "MC bergkamer", value: "Open"
Status: dzVents: Info: ------ Start internal script: PIR notification when no phone: Device: "MC bergkamer (Zigbee2MQTT)", Index: 106
Status: dzVents: Info: ------ Finished PIR notification when no phone
Status: dzVents: Info: ------ Start internal script: Bergkamer: Device: "MC bergkamer (Zigbee2MQTT)", Index: 106
Status: dzVents: Info: ------ Finished Bergkamer
Edit: Domoticz Version: 2020.2, dzVents Version: 3.0.2

Re: lastUpdate from triggered device is now (0 seconds ago)  [Solved]

Posted: Wednesday 23 September 2020 0:21
by waaren
Tjalling94 wrote: Tuesday 22 September 2020 22:01 I'm running some dzVents scripts that use the 'lastUpdate' from the triggeredDevice. For some months the lastUpdate is the current time (or 1-2 sec old) while expect it to be the time it was updated before this script was called. I can't figure out what's wrong.
This is a bug in latest Stable. It was fixed in build 12002