API for device

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
jhmartin
Posts: 29
Joined: 14 Apr 2015 02:52

API for device

Post by jhmartin »

I have a garage door sensor that I can see in the Smorthome ui at

Code: Select all

http://192.168.1.3:8083/smarthome/#/element/ZWayVDev_zway_3-0-48-1
, yet when I query it (after authenticating) via the devices api it says it does not exist:

Code: Select all

$ curl -b /tmp/cookies2 -s http://localhost:8083/ZAutomation/api/v1/devices/ZWayVDev_zway_3-0-48-1|python -mjson.tool
{
    "code": 404,
    "data": null,
    "error": "Device ZWayVDev_zway_3-0-48-1 doesn't exist",
    "message": "404 Not Found"
}
Any suggestion why this is occuring? v2.0.1.
nybble
Posts: 27
Joined: 04 Jun 2015 19:37

Re: API for device

Post by nybble »

If you dump all devices from: http://localhost:8083/ZAutomation/api/v1/devices

Is it there with the same name?
jhmartin
Posts: 29
Joined: 14 Apr 2015 02:52

Re: API for device

Post by jhmartin »

Aha! I am logged in to 192.168.1.3.

Code: Select all

$ ifconfig|grep inet|head -1
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0

Code: Select all

$ curl -s http://192.168.1.3:8083/ZAutomation/api/v1/devices  -b /tmp/cookies2 |python -mjson.tool|grep -w id|wc -l

67

Code: Select all

 $ curl -s http://localhost:8083/ZAutomation/api/v1/devices  -b /tmp/cookies2 |python -mjson.tool|grep -w id|wc -l
7
Something about referencing 'localhost' causes only a small subset of devices to be returned,.
Post Reply