Hi guys,
Probably my lack of LUA knowledge here so please bare with me… I’ve got a bunch of variables and functions defined in my startup LUA file which are all accessible from my Vera scenes, no problem. I always assumed this was a good way of defining global params and functions and I’ve been doing this forever with great success.
Today I tried to take advantage of adding some LAU to some of my Reactor activities. The same function calls and references to variables from here though are failing similar to this:
01 02/27/19 18:51:00.141 luup_log:95: Reactor: "Initiate Home Mode" (185) runLua action: "scene__trip185_group1_action2" accesses undeclared/uninitialized global "getMultiSwitchStatus" <0x74756520>
01 02/27/19 18:51:00.142 luup_log:95: Reactor: "Initiate Home Mode" (185) runLua action: "scene__trip185_group1_action2" accesses undeclared/uninitialized global "DEVID_VERA_MULTISWITCH_1" <0x74756520>
01 02/27/19 18:51:00.144 luup_log:95: Reactor: "Initiate Home Mode" (185) aborting scene "__trip185" Lua execution at group step 2, Lua run failed: "[string \"scene__trip185_group1_action2\"]:3: attempt to call global 'getMultiSwitchStatus' (a nil value)" <0x74756520>
02 02/27/19 18:51:00.144 luup_log:95: Reactor: Lua:
-- Enable lighting, heating and cooling
local minLux = 5
local heaterOverride = getMultiSwitchStatus(6, DEVID_VERA_MULTISWITCH_1)
if ((isNight()) or (isDark(DEVID_ENTRANCE_SENSOR_LUX, minLux)) or (isDark(DEVID_UPSTAIRS_RETREAT_SENSOR_LUX, minLux))) then
setBinarySwitch(DEVID_KITCHEN_LIGHTS,1)
setBinarySwitch(DEVID_RUMPUS_LEDS,1)
setBinarySwitch(DEVID_LOUNGE_LAMP,1)
setBinarySwitch(DEVID_RUMPUS_LAMP,1)
end
if (isWithinTempRange(DEVID_KITCHEN_HEATER, 0, VAR_HEAT_ON_TEMP_MIN)) then -- less than min temp threshold
if (tonumber(heaterOverride) == 0) then -- override is off
setThermostat(DEVID_KITCHEN_HEATER, "HeatOn", VAR_HEAT_SETPOINT)
end
end
return true <
Any help appreciated.