Page 1 of 1

Use info.scriptName in marker

Posted: Sunday 27 October 2019 9:21
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.

Re: Use info.scriptName in marker  [Solved]

Posted: Sunday 27 October 2019 11:28
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
}

Re: Use info.scriptName in marker

Posted: Sunday 27 October 2019 16:02
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!