_G.moduleLabel return nil value  [Solved]

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

Moderator: leecollings

Post Reply
hestia
Posts: 361
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

_G.moduleLabel return nil value

Post by hestia »

I have installed the last stable and I have errors due to _G.moduleLabel is nill
I've upgraded to the last beta with same issue
Version: 2020.1 (build 11836)
Build Hash: 7e0c5045a
Compile Date: 2020-03-25 17:53:32
dzVents Version: 3.0.1
Python Version: 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0]

it was ok with:
Version: 4.11605
Build Hash: 7de1f368f
Compile Date: 2020-01-08 23:12:15
dzVents Version: 2.5.5
Python Version: 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516]
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: _G.moduleLabel return nil value

Post by waaren »

hestia wrote: Wednesday 01 April 2020 21:44 I have installed the last stable and I have errors due to _G.moduleLabel is nil
Thx for reporting. Don't know yet why this does no longer exist. Will try to find out and correct if possible. Until fixed you will have to set a marker
in

Code: Select all

logging = { level = domoticz.LOG_DEBUG, marker = ' scriptName' },
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
hestia
Posts: 361
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: _G.moduleLabel return nil value

Post by hestia »

Thanks for replying and having agreed so fast ;-)
Until fixed you will have to set a marker in

Code: Select all

logging = { level = domoticz.LOG_DEBUG, marker = ' scriptName' },
I could just do this

Code: Select all

 _G.logMarker =  ' scriptName'
because _G.logMarker is working, but _G.moduleLabel not!
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: _G.moduleLabel return nil value  [Solved]

Post by waaren »

hestia wrote: Wednesday 01 April 2020 22:04 Thanks for replying and having agreed so fast ;-)
(kind of) Fixed in next Beta.
moduleLabel is available but no longer in global _G table but in the domoticz object.

so if you have

Code: Select all

execute = ( domoticz, item)
 
You can get moduleLabel as domoticz.moduleLabel

and if you have

Code: Select all

execute = ( dz, item)
 
You can get moduleLabel as dz.moduleLabel
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
hestia
Posts: 361
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: _G.moduleLabel return nil value

Post by hestia »

Thanks waaren
moduleLabel as dz.moduleLabel
I'm not familiar to compile domoticz, so I'm going to wait for a version to download.
Meanwhile I added the line in the lua EventHelpers.lua and it works.
I'll have to change my scripts but it is a small change ;-)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest