This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

curl to LUA
#5
Thx for the help.

I made a script from some copy pasting of other scripts i have running. But i don't get the different value.

The reply from the bell in the JSON is the following: 

Code:
{
    "CallStatus":    {
        "status":    "idle"
    }
}

But with the following script i get no value from the doorbell:

Code:
require('json')
require('socket.http')
data = socket.http.request('http://admin:xxxx@192.168.0.0/ISAPI/VideoIntercom/callStatus?format=json')
data = json.pdecode(data)

if type(data) == 'table' then
  data = data['CallStatus'][ 1 ]
  log(data)
  -- Status
grp.checkwrite('32/5/1', data.status)
 
else
  alert('request failed')
end


Sorry i am just not good at scripting (yet)
Reply


Messages In This Thread
curl to LUA - by KoBra - 29.12.2021, 10:41
RE: curl to LUA - by admin - 29.12.2021, 11:05
RE: curl to LUA - by KoBra - 29.12.2021, 15:18
RE: curl to LUA - by admin - 29.12.2021, 16:04
RE: curl to LUA - by KoBra - 01.01.2022, 20:30
RE: curl to LUA - by admin - 02.01.2022, 13:01
RE: curl to LUA - by KoBra - 02.01.2022, 14:05
RE: curl to LUA - by admin - 03.01.2022, 06:27
RE: curl to LUA - by KoBra - 03.01.2022, 14:26
RE: curl to LUA - by admin - 03.01.2022, 14:52
RE: curl to LUA - by KoBra - 03.01.2022, 20:43
RE: curl to LUA - by Krstfr2k - 03.03.2022, 07:08
RE: curl to LUA - by admin - 03.03.2022, 08:33
RE: curl to LUA - by Krstfr2k - 03.03.2022, 08:41
RE: curl to LUA - by admin - 03.03.2022, 09:04
RE: curl to LUA - by Krstfr2k - 04.03.2022, 12:26
RE: curl to LUA - by cekca - 27.01.2023, 13:45
RE: curl to LUA - by admin - 27.01.2023, 13:56

Forum Jump: