triggerInfo.trigger unavailable?

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

Moderator: leecollings

Post Reply
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

triggerInfo.trigger unavailable?

Post by emme »

Ciao,

on beta 8648 I'm having some issue using the triggerInfo table:

here is the code:

Code: Select all

return {
	on = { devices = { 'v*CTRL', 'TCM_vBagnetto' } },
	execute = function(dz, devVol, trgInfo)
	    
	    local dbg = dz.LOG_FORCE
	    for k, v in pairs(trgInfo) do
	        dz.log('VOLUMIO: '..k..', '..v..' '..trgInfo.trigger, dz.LOG_FORCE)
	    end 
    
    end
}
and got this as a result:
2017-10-27 09:07:58.049 Error: dzVents: Error: ...ticz/scripts/dzVents/generated_scripts/dzVolumioCTRL.lua:7: attempt to concatenate field 'trigger' (a nil value)
...why trigger is no longer available?
The most dangerous phrase in any language is:
"We always done this way"
Doler
Posts: 163
Joined: Friday 31 July 2015 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Sint-Oedenrode, Netherlands
Contact:

Re: triggerInfo.trigger unavailable?

Post by Doler »

Just my guess: trigger holds information on timer events and since your example triggers only on devices it will return nil.

Mark
Mark: Domoticz latest Beta on Virtual machine (Proxmox) running Debian Bookworm - Z-Stick 7 - RFXCom - P1 - SolarEdge - Dahua - Philips Hue - Docker - Zigbee2mqtt (latest, docker) via python plugin - Zwave-js-ui (latest, docker) - dzVents - Nodered
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: triggerInfo.trigger unavailable?

Post by emme »

uuuh... :cry: :cry: :cry: :roll:
triggerInfo.trigger: which timer rule triggered the script in case the script was called due to a timer event
my fault!!! (I've red it more than one, but I would red what I wanted to read :(


...it would be nice to have the triger info extended to all rules...
The most dangerous phrase in any language is:
"We always done this way"
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: triggerInfo.trigger unavailable?

Post by dannybloe »

That would be nice but that is very hard to do. At least that is what I remember ;-)
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest