API Queries Help

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
InMySights
Posts: 8
Joined: Thursday 23 July 2015 19:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

API Queries Help

Post by InMySights »

Hi,
I have a Raspberri Pi 2
Aeotec Zwave stick
Stable version of Domoticz

I am writing an app that is using the HTTP rest api to turn devices on/off etc. Recently I started seeing on the web site a switch or two would be RED and after some research it seems that the switch in particular is Offline.

I do not see a means to query the server for the availability of the device in question.
Is there a command that can be used via curl.exe, REST or other means to detect for availability?
Is there a command that can be used via curl.exe, REST or other means to query all devices listed in Settings for my Aeotec stick?
like 019 (0x13) Kitchen Slider Sensor Ecolink Unknown: type=0001, id=0002
Also going into Settings for my Zwave USB stick I can see that you can see the Group Network and perform a Heal on a Node or as a group.. Can this be done via another mechanism also?

Thanks
Brad
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: API Queries Help

Post by Egregius »

Use developer view of your browser and you'll see all the calls.
InMySights
Posts: 8
Joined: Thursday 23 July 2015 19:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: API Queries Help

Post by InMySights »

Thanks for the reply but I have the developer tools open in Chrome and the browser is calling the line below and get a return value. There is No indication of state of the devices in this... What am I missing? There are 3 items in my Utility tab that are red ...

http://xxxxxx/json.htm?type=devices&fil ... 588&plan=0

{
ActTime: 1499380564,
ServerTime: "2017-07-06 14:36:04",
Sunrise: "04:29",
Sunset: "19:59",
status: "OK",
title: "Devices"
}
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: API Queries Help

Post by Egregius »

Remove the lastupdate part of the url:

Code: Select all

/json.htm?type=devices&filter=utility&used=true&order=Name&plan=0
Then you'll see a 'havetimeout' field.

The url to show all z-wave nodes (change idx to idx of your zwave hardware):

Code: Select all

/json.htm?type=openzwavenodes&idx=3
In that reply you'll see a 'State' field indicating if the node is awake, sleeping, dead,...
InMySights
Posts: 8
Joined: Thursday 23 July 2015 19:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: API Queries Help

Post by InMySights »

Thank you I see this now.

Is there an effort to add these calls to the API documentation?
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: API Queries Help

Post by Egregius »

Edit the wiki as you fit ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest