Hello,
I'im trying to parse JSON from a Shelly 1 but my code is wrong and i don't understant why.
I've used example_json.lua and i've read some code in this forum.
The shelly URL is : http://192.168.0.122/relay/0 and give me :
{"ison":true, "has_timer":false}
I've a http poller :
URL = http://192.168.0.122/relay/0
command : shelly.lua
delay : 10
I've the script : /home/loops/domoticz/scripts/lua_parsers/shelly.lua :
with :
Code: Select all
s = request['content'];
print(s)
local etat = domoticz_applyJsonPath(s,'.ison')
print("etat : "..etat)
Code: Select all
2019-03-30 10:36:38.379 CLuaHandler: udevices: {"ison":true, "has_timer":false}
2019-03-30 10:36:38.379 Error: CLuaHandler: /home/loops/domoticz/scripts/lua_parsers/shelly.lua:5: attempt to concatenate local 'etat' (a nil value)
Thank you so mutch for your help !
JC