Page 1 of 1
dzVents not triggering on device indexes
Posted: Friday 28 July 2017 8:40
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.
Re: dzVents not triggering on device indexes
Posted: Friday 28 July 2017 10:04
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.
Re: dzVents not triggering on device indexes
Posted: Friday 28 July 2017 10:37
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?
Re: dzVents not triggering on device indexes
Posted: Friday 28 July 2017 10:47
by dannybloe
Aha.. I must have done that on purpose. But it sucks indeed.
/me will investigate
Re: dzVents not triggering on device indexes
Posted: Friday 28 July 2017 11:30
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
Re: dzVents not triggering on device indexes
Posted: Friday 28 July 2017 12:12
by BakSeeDaa
Thanks
I will try it when I get home later.
Re: dzVents not triggering on device indexes
Posted: Friday 28 July 2017 13:40
by BakSeeDaa
Problem is solved!
:¦:-•:*"*:•.-:¦:-•*EXCELLENT WORK!*•-:¦:-•:*'''*:•-:¦:-THANKS*•-:¦:-•:*''**•
Re: dzVents not triggering on device indexes
Posted: Friday 28 July 2017 13:42
by dannybloe
Cool, then I'll commit it.
Re: dzVents not triggering on device indexes
Posted: Monday 31 July 2017 13:08
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?
Re: dzVents not triggering on device indexes
Posted: Monday 31 July 2017 13:10
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.