Page 1 of 1
invalid on = section, logging = {
Posted: Saturday 03 October 2020 9:55
by Varazir
Version: 2020.2 (build 12442)
Build Hash: 9834d993a-modified
Compile Date: 2020-10-02 17:21:24
dzVents Version: 3.0.14
Python Version: 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0]
Hello after I updated to latest beta I started to get an error on all my dzVents scripts.
2020-10-03 09:36:35.086 Error: dzVents: Error: (3.0.14) Internal script SoligtSovrum.lua has an invalid on = section; please check the wiki. Skipping it until fixed.
2020-10-03 09:51:31.916 Status: dzVents: !Info: You entered "logging" in the on = section. Maybe you meant "devices"?
it was saying that this section was wrong,
logging = {
level = domoticz.LOG_DEBUG,
marker = 'ScenesSovrum'
}
If I remove the logging section the error goes away.
Edit: I have checked
https://github.com/domoticz/domoticz/tr ... umentation and
https://www.domoticz.com/wiki/DzVents:_ ... ptional.29 couldn't se any wrong with my script.
Re: invalid on = section, logging = {
Posted: Saturday 03 October 2020 10:43
by waaren
Varazir wrote: ↑Saturday 03 October 2020 9:55
couldn't see anything wrong with my script.
Can you please share the script giving the error (the part from line 1 until execute = ) ?
Re: invalid on = section, logging = {
Posted: Saturday 03 October 2020 11:09
by Varazir
waaren wrote: ↑Saturday 03 October 2020 10:43
Varazir wrote: ↑Saturday 03 October 2020 9:55
couldn't see anything wrong with my script.
Can you please share the script giving the error (the part from line 1 until execute = ) ?
Code: Select all
return {
on = {
scenes = {
'Sovrum*'
},
logging = {
level = domoticz.LOG_DEBUG,
marker = 'ScenesSovrum'
}
},
execute = function(dz, scene)
local function logWrite(str,level)
dz.log(tostring(str),level or dz.LOG_DEBUG)
end
if scene.name == 'SovrumGN' then
dz.helpers.join(dz,"domoticz=:=scenes=:=SovrumGN")
-- dz.helpers.join(dz,"group.all","domoticz","SovrumGN")
-- dz.notify("Scenes Sovrum","domoticz=:=scenes=:=SovrumGN",dz.PRIORITY_NORMAL,dz.NSS_HTTP)
else
dz.helpers.join(dz,"domoticz=:=scenes=:=SovrumGM")
-- dz.notify("Scenes Sovrum","domoticz=:=scenes=:=SovrumGM",dz.PRIORITY_NORMAL,dz.NSS_HTTP)
end
end
}
Re: invalid on = section, logging = { [SOLVED]
Posted: Saturday 03 October 2020 11:21
by waaren
Varazir wrote: ↑Saturday 03 October 2020 11:09
couldn't see anything wrong with my script.
Nice to see that the extra control I added in recent Beta's works
The way you placed your
}, makes that Lua makes
logging part of the on = section. This often made mistake is one of the reason I always align my opening- and closing ( curly ) brackets.
see below for the corrected script.
Code: Select all
return
{
on =
{
scenes =
{
'Sovrum*',
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'ScenesSovrum',
},
execute = function(dz, scene)
local function logWrite(str,level)
dz.log(tostring(str),level or dz.LOG_DEBUG)
end
if scene.name == 'SovrumGN' then
dz.helpers.join(dz,"domoticz=:=scenes=:=SovrumGN")
-- dz.helpers.join(dz,"group.all","domoticz","SovrumGN")
-- dz.notify("Scenes Sovrum","domoticz=:=scenes=:=SovrumGN",dz.PRIORITY_NORMAL,dz.NSS_HTTP)
else
dz.helpers.join(dz,"domoticz=:=scenes=:=SovrumGM")
-- dz.notify("Scenes Sovrum","domoticz=:=scenes=:=SovrumGM",dz.PRIORITY_NORMAL,dz.NSS_HTTP)
end
end
}
Re: invalid on = section, logging = {
Posted: Saturday 03 October 2020 12:15
by Varazir
waaren wrote: ↑Saturday 03 October 2020 11:21
Varazir wrote: ↑Saturday 03 October 2020 11:09
couldn't see anything wrong with my script.
Nice to see that the extra control I added in recent Beta's works
The way you placed your
}, makes that Lua makes
logging part of the on = section. This often made mistake is one of the reason I always align my opening- and closing ( curly ) brackets.
see below for the corrected script.
Code: Select all
return
{
on =
{
scenes =
{
'Sovrum*',
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'ScenesSovrum',
},
execute = function(dz, scene)
local function logWrite(str,level)
dz.log(tostring(str),level or dz.LOG_DEBUG)
end
if scene.name == 'SovrumGN' then
dz.helpers.join(dz,"domoticz=:=scenes=:=SovrumGN")
-- dz.helpers.join(dz,"group.all","domoticz","SovrumGN")
-- dz.notify("Scenes Sovrum","domoticz=:=scenes=:=SovrumGN",dz.PRIORITY_NORMAL,dz.NSS_HTTP)
else
dz.helpers.join(dz,"domoticz=:=scenes=:=SovrumGM")
-- dz.notify("Scenes Sovrum","domoticz=:=scenes=:=SovrumGM",dz.PRIORITY_NORMAL,dz.NSS_HTTP)
end
end
}
Thanks I can never get the hang of when to add a , or not.
Re: invalid on = section, logging = {
Posted: Saturday 03 October 2020 12:43
by waaren
Varazir wrote: ↑Saturday 03 October 2020 12:15
Thanks I can never get the hang of when to add a , or not.
This was not about a misplaced comma. It was about a misplaced curly bracket.
A comma need to placed between items in a table. After the last item in a table ( just before the closing curly bracket ) it can be left out but it is not an error when you also use it there.
Re: invalid on = section, logging = {
Posted: Saturday 03 October 2020 13:27
by Varazir
waaren wrote: ↑Saturday 03 October 2020 12:43
Varazir wrote: ↑Saturday 03 October 2020 12:15
Thanks I can never get the hang of when to add a , or not.
This was not about a misplaced comma. It was about a misplaced curly bracket.
A comma need to placed between items in a table. After the last item in a table ( just before the closing curly bracket ) it can be left out but it is not an error when you also use it there.
I see it now, thanks.