I’m trying to use the method below in a lua script. It works fine in a browser, but I always get a timeout with a script such as this in the AltUI test code window. Any ideas? Thanks.
local http = require ("socket.http")
http.TIMEOUT = 5
local result, status, content = http.request("http://192.168.1.205:3480/ZWaveAPI/Run/devices[17].Alarm.data.V1event")
print("Status:" .. status)
if status == 200 then
local json = require("dkjson")
local obj, pos, err = json.decode(result)
if err then
print("json decode error: " .. err)
else
print("obj is " .. obj.updateTime)
end
end
[quote=“akbooer, post:13, topic:193746”]OK, plan B (even better, might actually work, it does for me, but, there again, so did plan A) …
[ol][li]update openLuup from the development branch[/li]
[li]add the attached file as /etc/cmh-ludl/cgi/zway_cgi.lua (NB. with the .lua extension)[/li]
[li]delete /etc/cmh-ludl/cgi/port_8083[/li][/ol]
Now, any Zway-related requests made to port 3480 are simply relayed to the ZWay interface on port 8083, no special syntax required.
Thank you. That works. This is ridiculously complex, but it works: Door lock Z-wave → Z-way server → Niffler → Z-way server → Z-wave query → Z-way server → openLuup scene → Z-way server query → openLuup scene → openHAB → DSC Alarm panel.
With the latest AltUI version (v2129) I noticed that my Z-way communication seems to be having an issue. So I checked the logs (openLuup v17.3.9) after a reload and …
2017-09-20 20:53:20.260 luup.chdev.sync:: [118] 63: Garage Combo, syncing children
2017-09-20 20:53:20.260 luup.chdev.sync:: [143] 71: Master Dimmable, syncing children
2017-09-20 20:53:20.260 luup.chdev.sync:: [147] 72: Media Dimmable, syncing children
2017-09-20 20:53:20.260 luup.chdev.sync:: [151] 76: Repeater (Den), syncing children
2017-09-20 20:53:20.260 luup.chdev.sync:: [148] 75: Doorbell, syncing children
2017-09-20 20:53:20.260 luup.chdev.sync:: [152] 77: Repeater (Master), syncing children
2017-09-20 20:53:20.260 luup.chdev.sync:: [137] 67: Hallway Plug, syncing children
2017-09-20 20:53:20.261 luup.chdev.sync:: [141] 69: West Landscape, syncing children
2017-09-20 20:53:20.261 luup.chdev.sync:: [145] 74: North Landscape, syncing children
2017-09-20 20:53:20.261 luup.chdev.sync:: [157] 46: Garage Binary, syncing children
2017-09-20 20:53:20.261 luup.chdev.sync:: [146] 73: Laundry Dimmable, syncing children
2017-09-20 20:53:20.261 openLuup.context_switch:: ERROR: ./L_ZWay.lua:1034: attempt to index local 'this' (a nil value)
2017-09-20 20:53:20.261 openLuup.scheduler:: job aborted : ./L_ZWay.lua:1034: attempt to index local 'this' (a nil value)
Lots/perhaps all of my Z-way devices are not reporting but scenes are operating as my outside lights are coming on and off per schedule. Just don’t see updates (all my sensors indicate the last update was yesterday when I performed the AltUI upgrade). Let me know if you need more detail.
This appears to be related to a non-existent node. Can you check the attributes of the ZWay child nodes (or maybe just one) and see that the do, indeed, refer to the ZWay device?
I’m a bit stumped as to how an AltUI version change can do this, but…
(I’m running the latest AltUI in my development system, but not currently with ZWay.)
Here are the details from a Leviton switch… ZWay Parent id is indeed ‘5’.
[quote=“akbooer, post:45, topic:193746”](Thanks for your reminder on another thread.)
This appears to be related to a non-existent node. Can you check the attributes of the ZWay child nodes (or maybe just one) and see that the do, indeed, refer to the ZWay device?
I’m a bit stumped as to how an AltUI version change can do this, but…
(I’m running the latest AltUI in my development system, but not currently with ZWay.)[/quote]
Fresh install and the issues still persist. Perhaps the ZWay API has changed somehow… Issue shows on 2.3.5 and this morning I tried 2.3.6 beta and the issue still persists.
2017-09-20 20:53:20.261 openLuup.context_switch:: ERROR: ./L_ZWay.lua:1034: attempt to index local 'this' (a nil value)
2017-09-20 20:53:20.261 openLuup.scheduler:: job aborted : ./L_ZWay.lua:1034: attempt to index local 'this' (a nil value)
This seems to be a problem with not finding the right device IDs for the child devices. Can you delete the parent device and reload. Create another instance of the device, and try again. Which version of the ZWay plugin are you running?
[hr]
Edit: You DO have the right IP address, username, and password set?
All credentials are good. This was a totally clean install (openLuup_install) of openLuup/AltUI where only the ZWay plugin/devices were being loaded. It appears to have retrieved them all despite the error on startup but there is no status updates for any of the z-wave devices. I attempted to eliminate all possible causes but I’m just not sure what’s going on here or why. I’m attaching the startup log as well as the log data leading up to the error and after the error.
If all else I can always provide full access to the system.
Thanks…
CN
[quote=“akbooer, post:53, topic:193746”]This seems to be a problem with not finding the right device IDs for the child devices. Can you delete the parent device and reload. Create another instance of the device, and try again. Which version of the ZWay plugin are you running?
[hr]
Edit: You DO have the right IP address, username, and password set?[/quote]