Use info.scriptName in marker  [Solved]

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

Moderator: leecollings

Post Reply
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Use info.scriptName in marker

Post by pvklink »

I use info.scriptName default as a part of my logging.
Is it possible to use this property in the marker part of a script?

logging = { level = domoticz.LOG_DEBUG,
marker = info.scriptName (also tried domoticz.info.scriptName)
},

etc.
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Use info.scriptName in marker  [Solved]

Post by waaren »

pvklink wrote: Sunday 27 October 2019 9:21 I use info.scriptName default as a part of my logging.
Is it possible to use this property in the marker part of a script?
No. that info is not available in the logging = section.
You could achieve what you want if you do something like below

Code: Select all

return
{
    on = { devices = { 'triggerG' }},
   
    logging = { level = domoticz.LOG_DEBUG },
   
    execute = function(dz, device)
        _G.logMarker = _G.moduleLabel
        -- rest of script
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Use info.scriptName in marker

Post by pvklink »

Unbelie... that you know al this... always an alternative :-)
And yes it works! very easy when using a template for all your scripts and always usable...

thanks again!
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest