On statement and global_data.lua [SOLVED]
Posted: Wednesday 13 January 2021 12:51
Hello,
Is there any way to use an entity declared in global_data.lua within the on statement of a dzVents script?
I mean:
This works -->
But, this doesn't work (Off course, IDX_HEATINGSELECTOR and IDX_THERMOSTAT_SETPOINT are defined in my global_data.lua file)
Runtime Error in the log: 2021-01-13 13:01:33.368 Status: dzVents: Error (2.4.19): /home/pi/domoticz/scripts/dzVents/scripts/Heating.lua:9: attempt to index global 'helpers' (a nil value)
-->OR
Is there any way to use an entity declared in global_data.lua within the on statement of a dzVents script?
I mean:
This works -->
Code: Select all
return {
on = {
timer = {'every 1 minutes'},
devices = {'Horaires/Start Chauffage','Horaires/Stop Chauffage', 17, 16}
},
Runtime Error in the log: 2021-01-13 13:01:33.368 Status: dzVents: Error (2.4.19): /home/pi/domoticz/scripts/dzVents/scripts/Heating.lua:9: attempt to index global 'helpers' (a nil value)
-->
Code: Select all
return {
on = {
timer = {'every 1 minutes'},
devices = {'Horaires/Start Chauffage','Horaires/Stop Chauffage', domoticz.helpers.IDX_HEATINGSELECTOR, domoticz.helpers.IDX_THERMOSTAT_SETPOINT}
},
Code: Select all
return {
on = {
timer = {'every 1 minutes'},
devices = {'Horaires/Start Chauffage','Horaires/Stop Chauffage', helpers.IDX_HEATINGSELECTOR, helpers.IDX_THERMOSTAT_SETPOINT}
},