dzVents not triggering on device indexes

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

Moderator: leecollings

Post Reply
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

dzVents not triggering on device indexes

Post by BakSeeDaa »

dzVents 2.2.0, Domoticz V3.8143 @ rpi3

The following script won't trigger on a device with idx 596:

Code: Select all

return {
	active = true,
	logging = {
		level = domoticz.LOG_INFO, -- Select one of LOG_DEBUG, LOG_INFO, LOG_ERROR, LOG_FORCE to override system log level
		marker = "TEST"
	},
	on = {
		devices = {
			596,
		},
	},
	execute = function(domoticz, device)
		domoticz.log('Triggered by device: '..device.name, domoticz.LOG_INFO)
		domoticz.log('Device state: '..device.state, domoticz.LOG_INFO)
		domoticz.log('Device lastUpdate.raw: '..device.lastUpdate.raw, domoticz.LOG_INFO)

	end
}
Changing 596 to the device's name makes the script trigger properly.
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents not triggering on device indexes

Post by dannybloe »

Ok, can you try this: turn dzVents into debug logging mode (domoticz settings, not just this script!). Then trigger this device. Then paste all the logging dzVents does. Also find the part in scripts/dzVents/domoticzData.lua that lists this device and paste it here as well.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: dzVents not triggering on device indexes

Post by BakSeeDaa »

I think I found something usable...

My test script will trigger on the device id only if there are no other scripts that's triggers on the same device's name.

E.g. if I remove "A580 IP" from my radio.lua script, my testa.lua script can trigger on the device using it's id (596). Does that make any sense? Do you still need the debug output?
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents not triggering on device indexes

Post by dannybloe »

Aha.. I must have done that on purpose. But it sucks indeed.
/me will investigate
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents not triggering on device indexes

Post by dannybloe »

Ok, I think I have a fix (for 2.2.1). Could you try my fix? Locate the file EventHelpers.lua in scripts/dzVents/runtime and replace it with the attached version. (copy the current version first).

Let me know if that fixes the problem for you.

Cheers,
Danny
Attachments
EventHelpers.lua.zip
(5.04 KiB) Downloaded 105 times
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: dzVents not triggering on device indexes

Post by BakSeeDaa »

Thanks
I will try it when I get home later.
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: dzVents not triggering on device indexes

Post by BakSeeDaa »

Problem is solved!

:¦:-•:*"*:•.-:¦:-•*EXCELLENT WORK!*•-:¦:-•:*'''*:•-:¦:-THANKS*•-:¦:-•:*''**•
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents not triggering on device indexes

Post by dannybloe »

Cool, then I'll commit it.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: dzVents not triggering on device indexes

Post by BakSeeDaa »

dannybloe wrote:Cool, then I'll commit it.
I believe it's still not changed in Domoticz version 3.8153 (Stable). Will the attached file work for the new Domoticz version to?
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents not triggering on device indexes

Post by dannybloe »

True.. it will be in 2.1.1. Dunno when it will be in the beta.
But you can use the attached file without problems.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest