What is the cause of this error?
Posted: Thursday 20 January 2022 18:54
Lua newbie here.
The script works but generates every minute an error in the log. Not sure why.
This error:
2022-01-20 18:45:00.931 Error: EventSystem: in Achterdeurbel_trigger: [string "-- ..."]:8: attempt to index a nil value (global 'devicechanged')
Is generated bij this script:
--
-- Script Achterdeurbel
-- Start shellscript bij het activeren van de achterdeurdeurbel voor het afspelen van geluid op squeezebox spelers
--
commandArray = {}
if (devicechanged['Deurbelknop_achter'] == 'On') then
if (otherdevices['Silence'] == 'Off') then
print("** Deurbel achterdeur geactiveerd **")
os.execute('/home/vincent/domoticz/scripts/sqalert.sh "kitchen" Ding-dong.mp3 Deurbel_achterdeur.mp3 40')
os.execute('/home/vincent/domoticz/scripts/sqalert.sh "bathroom" Ding-dong.mp3 Deurbel_achterdeur.mp3 40')
os.execute('/home/vincent/domoticz/scripts/sqalert.sh "livingroom" Ding-dong.mp3 Deurbel_achterdeur.mp3 40')
end
end
return commandArray
The script works but generates every minute an error in the log. Not sure why.
This error:
2022-01-20 18:45:00.931 Error: EventSystem: in Achterdeurbel_trigger: [string "-- ..."]:8: attempt to index a nil value (global 'devicechanged')
Is generated bij this script:
--
-- Script Achterdeurbel
-- Start shellscript bij het activeren van de achterdeurdeurbel voor het afspelen van geluid op squeezebox spelers
--
commandArray = {}
if (devicechanged['Deurbelknop_achter'] == 'On') then
if (otherdevices['Silence'] == 'Off') then
print("** Deurbel achterdeur geactiveerd **")
os.execute('/home/vincent/domoticz/scripts/sqalert.sh "kitchen" Ding-dong.mp3 Deurbel_achterdeur.mp3 40')
os.execute('/home/vincent/domoticz/scripts/sqalert.sh "bathroom" Ding-dong.mp3 Deurbel_achterdeur.mp3 40')
os.execute('/home/vincent/domoticz/scripts/sqalert.sh "livingroom" Ding-dong.mp3 Deurbel_achterdeur.mp3 40')
end
end
return commandArray