Hi,
Just installed the Domoticz on a DS214Play syno. Quite impressed so far. A Netatmo Weather station was added and now I have 4 devices with temp, barometer, humidity, CO2 etc... I am tryin to use the Domoticz JSON API to make calls and retrieve specific values of target device using the rid of the devices.
Problem is, contrary to what is explained in wiki on API calls, when I specify the rid=xxx the returned JSON does not contain the result section, only basic stuff. If I make a generic call on all used device, I get the result section.
My Objective is to retrieve specific value of that weather station and I don't know what params to use in the json call. So for now I was going to use a PHP parser on the result section, but I can't get it if I target a device with the rid. If I do a generic list of all used device, I get proper result section and plenty of data to play with...
Targeting a specific device with rid does not contain RESULT section in JSON : https://mydomoticz:myport/json.htm?type=devices&rid=31AF
{
"ActTime" : 1516472341,
"ServerTime" : "2018-01-20 20:19:01",
"Sunrise" : "09:11",
"Sunset" : "18:21",
"status" : "OK",
"title" : "Devices"
}
However when I call more globally all devices : https://mydomoticz/json.htm?type=devices , I do get a lot of interesting data !
extract :
{
"ActTime" : 1516473072,
"ServerTime" : "2018-01-20 20:31:12",
"Sunrise" : "09:11",
"Sunset" : "18:21",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 0,
"Data" : "17.5 C, 53 %",
"Description" : "",
"DewPoint" : "7.81",
"Favorite" : 0,
"HardwareID" : 2,
"HardwareName" : "Station météo",
"HardwareType" : "Netatmo",
"HardwareTypeVal" : 54,
"HaveTimeout" : false,
"Humidity" : 53,
"HumidityStatus" : "Comfortable",
"ID" : "31AF",
"LastUpdate" : "2018-01-20 20:22:48",
"Name" : "Ext",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "WTGR800",
"Temp" : 17.5,
"Timers" : "false",
"Type" : "Temp + Humidity",
"TypeImg" : "temperature",
"Unit" : 0,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
Questions :
. Through API Calls can we retrive a specific value from above like HumidityStatus or whatever ?
- Why am I not getting the result when querying with rid ? Surely that sounds like a BUG based on wiki ...
Thanks a lot
Stephane
API Call on specific RID Devices does not include result section for NetAtmo
Moderators: leecollings, remb0
-
- Posts: 3
- Joined: Saturday 20 January 2018 19:21
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: API Call on specific RID Devices does not include result section for NetAtmo
All,
I found my issue. I was using the ID instead of the idx field reported. Now it works. Just posting in case someone make same mistake.
Rgds
Stephane
I found my issue. I was using the ID instead of the idx field reported. Now it works. Just posting in case someone make same mistake.
Rgds
Stephane
Who is online
Users browsing this forum: No registered users and 1 guest