Wierd lua error after... no change?
Moderator: leecollings
-
- Posts: 19
- Joined: Saturday 23 November 2013 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Wierd lua error after... no change?
Hello,
After doing.... nothing? This shows up:
------
Mon Apr 14 19:09:00 2014 (PAJ2) Temperature (TempPaj2)
Mon Apr 14 19:09:00 2014 Hardware Monitor: Fetching data (System sensors)
Mon Apr 14 19:09:00 2014 (PAJ) Temperature (TempPaj)
Mon Apr 14 19:09:06 2014 Error: Lua script error: [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to index global 'utilitydevice' (a nil value)
Mon Apr 14 19:09:16 2014 Error: Lua script error: [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to index global 'utilitydevice' (a nil value)
Mon Apr 14 19:09:16 2014 (PAJ2) Lux Meter (ZLightSensor1)
Mon Apr 14 19:09:17 2014 Error: Lua script error: [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to index global 'utilitydevice' (a nil value)
Mon Apr 14 19:09:17 2014 (PAJ2) Lux Meter (ZLightSensor1)
Mon Apr 14 19:09:17 2014 (PAJ2) Temperature + Humidity (TempLivingroom)
Mon Apr 14 19:09:17 2014 (PAJ2) Temperature + Humidity (TempLivingroom)
Mon Apr 14 19:09:19 2014 (PAJ) Temperature + Humidity (TempBathroom)
-------
For some reason some lua script can't get the value from utilitydevice...
I have a event (made with the blocky gui) thats uses my Lightsensor that is under "utilitydevide". When I deactivate it this error dissapears. BUT I havent changed the event... Worked yeasterday. I have not updated Domoticz either.
Hope someone have an idea!
Best regards,
Cristopher
After doing.... nothing? This shows up:
------
Mon Apr 14 19:09:00 2014 (PAJ2) Temperature (TempPaj2)
Mon Apr 14 19:09:00 2014 Hardware Monitor: Fetching data (System sensors)
Mon Apr 14 19:09:00 2014 (PAJ) Temperature (TempPaj)
Mon Apr 14 19:09:06 2014 Error: Lua script error: [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to index global 'utilitydevice' (a nil value)
Mon Apr 14 19:09:16 2014 Error: Lua script error: [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to index global 'utilitydevice' (a nil value)
Mon Apr 14 19:09:16 2014 (PAJ2) Lux Meter (ZLightSensor1)
Mon Apr 14 19:09:17 2014 Error: Lua script error: [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to index global 'utilitydevice' (a nil value)
Mon Apr 14 19:09:17 2014 (PAJ2) Lux Meter (ZLightSensor1)
Mon Apr 14 19:09:17 2014 (PAJ2) Temperature + Humidity (TempLivingroom)
Mon Apr 14 19:09:17 2014 (PAJ2) Temperature + Humidity (TempLivingroom)
Mon Apr 14 19:09:19 2014 (PAJ) Temperature + Humidity (TempBathroom)
-------
For some reason some lua script can't get the value from utilitydevice...
I have a event (made with the blocky gui) thats uses my Lightsensor that is under "utilitydevide". When I deactivate it this error dissapears. BUT I havent changed the event... Worked yeasterday. I have not updated Domoticz either.
Hope someone have an idea!
Best regards,
Cristopher
Re: Wierd lua error after... no change?
You have to supply some more information. What is the calling script line?
-
- Posts: 18
- Joined: Saturday 04 January 2014 20:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Wierd lua error after... no change?
I have the same problem, change the device for the humidity, and then a error in the log, and the event don't do it
disable the event, and no errors
change to an other hum sensor, and it works well
disable the event, and no errors
change to an other hum sensor, and it works well
CubieTruck with Domoticz
RfxTrx 433Mhz Usb, Rfx Sensor, Z-Wave
Slave Raspberry Pi with Domoticz, Piface, P1 usb
RfxTrx 433Mhz Usb, Rfx Sensor, Z-Wave
Slave Raspberry Pi with Domoticz, Piface, P1 usb
-
- Posts: 19
- Joined: Saturday 23 November 2013 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Wierd lua error after... no change?
This is the event Im trying to do. THIS worked before.
Is like Domoticz can't get the value from ZLightSensor1 anymore.. when I press "Show current states" I can see the value..
//Cristopher
Is like Domoticz can't get the value from ZLightSensor1 anymore.. when I press "Show current states" I can see the value..
//Cristopher
- Attachments
-
- Untitled-1.jpg (24.53 KiB) Viewed 5370 times
-
- Posts: 19
- Joined: Saturday 23 November 2013 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Wierd lua error after... no change?
Tried this instead (did a lua script instead):
-------
commandArray = {}
if ((otherdevices['ZLightSensor1'] <= '20' or otherdevices['DuskSensor'] == 'On') and otherdevices['LivingRoomWindow'] == 'Off') then
commandArray['Scene:LightsInsideON']='On'
print('LightsInsideON triggered!')
end
return commandArray
-------
-------
commandArray = {}
if ((otherdevices['ZLightSensor1'] <= '20' or otherdevices['DuskSensor'] == 'On') and otherdevices['LivingRoomWindow'] == 'Off') then
commandArray['Scene:LightsInsideON']='On'
print('LightsInsideON triggered!')
end
return commandArray
-------
-
- Posts: 19
- Joined: Saturday 23 November 2013 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Wierd lua error after... no change?
If I want to write a script that turns on say "LightningDevice1" for 10 minutes if "MotionSensor" is triggered. BUT not turn the lights off if the "MotionSensor" is triggered again within 10 minutes... is it possible?
Best regards
Cristopher
Best regards
Cristopher
-
- Posts: 1
- Joined: Sunday 19 July 2015 9:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2.2563
- Location: Netherlands
- Contact:
Re: Wierd lua error after... no change?
Same thing here: Error: EventSystem: Lua script error (Blockly), Name: test event 2_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to index global 'utilitydevice' (a nil value)
Am i doing something wrong? (sorry for a dumb question, very new to domoticz)
(this is a test event, trying to get the light on for 1 minute, when it is dark)
Am i doing something wrong? (sorry for a dumb question, very new to domoticz)
(this is a test event, trying to get the light on for 1 minute, when it is dark)
- Attachments
-
- Knipsel.PNG (8.64 KiB) Viewed 5149 times
-
- Posts: 2
- Joined: Wednesday 21 October 2015 21:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Germany
- Contact:
Re: Wierd lua error after... no change?
I experience exactly the same. Is there any solution available already?
-
- Posts: 25
- Joined: Saturday 28 November 2015 12:10
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Wierd lua error after... no change?
Hi:
I have the same issue with a utility device for energy meter. Anyone has any idea how to solve this?
regards,
Helder Nogueira
I have the same issue with a utility device for energy meter. Anyone has any idea how to solve this?
regards,
Helder Nogueira
-
- Posts: 2
- Joined: Wednesday 21 October 2015 21:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Germany
- Contact:
Re: Wierd lua error after... no change?
Use the beta version of domotics and is solved.
Worked for me like charme.
Worked for me like charme.
-
- Posts: 25
- Joined: Saturday 28 November 2015 12:10
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Wierd lua error after... no change?
Hi OssiJr:
Where can I find the beta versions?
regards,
Helder
Where can I find the beta versions?
regards,
Helder
-
- Posts: 25
- Joined: Saturday 28 November 2015 12:10
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Wierd lua error after... no change?
Hi all:
Just upgraded to the last version and still have the problem. Anyone can help?
Error: EventSystem: Lua script error (Blockly), Name: teste switch_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to index global 'utilitydevice' (a nil value)
regards,
Helder Nogueira
Just upgraded to the last version and still have the problem. Anyone can help?
Error: EventSystem: Lua script error (Blockly), Name: teste switch_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to index global 'utilitydevice' (a nil value)
regards,
Helder Nogueira
- rolandbreedveld
- Posts: 156
- Joined: Wednesday 09 March 2016 11:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Contact:
Re: Wierd lua error after... no change?
Have the same issue with latest stable and latest beta version. (Version: 3.4834 and Version: 3.5187)
Error: EventSystem: in Pwr gpio: [string "-- sript_update_Pwr gpio.lua..."]:5: attempt to index global 'devicechanged' (a nil value)
I use this to read gpio status and update a power counter (every pulse is 100Wh)
the script works perfect, but sometimes these errors in the log
the complete script:
commandArray = {}
if(devicechanged['Pi gpio1 IN']) then ------ this is line 5
cur_val=tonumber(otherdevices_svalues['Power test'])
print("gpio:" .. tostring(otherdevices['Pi gpio1 IN']) .. " pwr:" .. tostring(cur_val))
commandArray['UpdateDevice'] = 31 .. "|0|" .. tostring(100 + cur_val)
end
return commandArray
Error: EventSystem: in Pwr gpio: [string "-- sript_update_Pwr gpio.lua..."]:5: attempt to index global 'devicechanged' (a nil value)
I use this to read gpio status and update a power counter (every pulse is 100Wh)
the script works perfect, but sometimes these errors in the log
the complete script:
commandArray = {}
if(devicechanged['Pi gpio1 IN']) then ------ this is line 5
cur_val=tonumber(otherdevices_svalues['Power test'])
print("gpio:" .. tostring(otherdevices['Pi gpio1 IN']) .. " pwr:" .. tostring(cur_val))
commandArray['UpdateDevice'] = 31 .. "|0|" .. tostring(100 + cur_val)
end
return commandArray
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
- jvdz
- Posts: 2189
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: Wierd lua error after... no change?
What about when you change that to:
Jos
Code: Select all
commandArray = {}
if(devicechanged['Pi gpio1 IN'] ~= nil) then
cur_val=tonumber(otherdevices_svalues['Power test'])
print("gpio:" .. tostring(otherdevices['Pi gpio1 IN']) .. " pwr:" .. tostring(cur_val))
commandArray['UpdateDevice'] = 31 .. "|0|" .. tostring(100 + cur_val)
end
return commandArray
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- rolandbreedveld
- Posts: 156
- Joined: Wednesday 09 March 2016 11:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Contact:
Re: Wierd lua error after... no change?
jvdz wrote:What about when you change that to:JosCode: Select all
commandArray = {} if(devicechanged['Pi gpio1 IN'] ~= nil) then cur_val=tonumber(otherdevices_svalues['Power test']) print("gpio:" .. tostring(otherdevices['Pi gpio1 IN']) .. " pwr:" .. tostring(cur_val)) commandArray['UpdateDevice'] = 31 .. "|0|" .. tostring(100 + cur_val) end return commandArray
Thanxzz, for the idea, but it gave exactly the same error
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
- jvdz
- Posts: 2189
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: Wierd lua error after... no change?
So that means that the devicechanged table is none existent. Is this a script that runs as Time Event?
Jos
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- rolandbreedveld
- Posts: 156
- Joined: Wednesday 09 March 2016 11:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Contact:
Re: Wierd lua error after... no change?
Jos, it's running as lua script from Domotics events, same as Blockyjvdz wrote:So that means that the devicechanged table is none existent. Is this a script that runs as Time Event?
Jos
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
- jvdz
- Posts: 2189
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: Wierd lua error after... no change?
Is it a script file or a script in the internal script editor?
In the first case: What is the scriptname?
In the second case: Which option did you set in the box underneath the LUA option?
Jos
In the first case: What is the scriptname?
In the second case: Which option did you set in the box underneath the LUA option?
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- rolandbreedveld
- Posts: 156
- Joined: Wednesday 09 March 2016 11:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Contact:
Re: Wierd lua error after... no change?
Options in Domoticz: Name "Pwr gpio" / LUA / All /Active
(Domoticz script editor is used)
even with a nil check outside it, the error stays:
Error: EventSystem: in Pwr gpio: [string "-- sript_update_Pwr gpio.lua..."]:16: attempt to index global 'devicechanged' (a nil value)
commandArray = {}
if(otherdevices['Pi gpio1 IN'] ~= nil ) then
if(devicechanged['Pi gpio1 IN']) then ------>>>> this is line 16, which gives the nil error !!
cur_val=tonumber(otherdevices_svalues['Power test'])
print("gpio:" .. tostring(otherdevices['Pi gpio1 IN']) .. " pwr:" .. tostring(cur_val))
commandArray['UpdateDevice'] = 31 .. "|0|" .. tostring(100 + cur_val)
end
end
return commandArray
(Domoticz script editor is used)
even with a nil check outside it, the error stays:
Error: EventSystem: in Pwr gpio: [string "-- sript_update_Pwr gpio.lua..."]:16: attempt to index global 'devicechanged' (a nil value)
commandArray = {}
if(otherdevices['Pi gpio1 IN'] ~= nil ) then
if(devicechanged['Pi gpio1 IN']) then ------>>>> this is line 16, which gives the nil error !!
cur_val=tonumber(otherdevices_svalues['Power test'])
print("gpio:" .. tostring(otherdevices['Pi gpio1 IN']) .. " pwr:" .. tostring(cur_val))
commandArray['UpdateDevice'] = 31 .. "|0|" .. tostring(100 + cur_val)
end
end
return commandArray
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
- jvdz
- Posts: 2189
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: Wierd lua error after... no change?
Change the All to Device as it will now runs for Timer and Variable events as well which will cause this error.
Jos
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Who is online
Users browsing this forum: No registered users and 1 guest