Retrieve boiler status in "pseudo real time"

The Netatmo API is a set of webservices allowing developers and third parties to access Netatmo device's data.
Post Reply
antoine.frt
Posts: 5
Joined: 08 Jul 2017, 17:44

Retrieve boiler status in "pseudo real time"

Post by antoine.frt »

Hello everyone,

Do someone knows if there is a way to retrieve boiler status in "pseudo real time" ?
Even if boiling has not been triggered by Netatmo thermostat ?

I tried playing with the API, but I'm not sure that I can do such a things.
It seems that I can only retrieve request to boil from Netatmo thermostat.
Leslie
Posts: 42
Joined: 12 Feb 2020, 11:07

Re: Retrieve boiler status in "pseudo real time"

Post by Leslie »

Hi Antoine,

I suppose you would like to access webhooks to be warned when a change occurs for the boiler (as we have for cameras for instance : https://dev.netatmo.com/apidocumentatio ... y#webhooks)
Unfortunately, we don't provide this possibility for other products and it's not planned to do it. The only solution is to do polling :
- send a call to /homesdata (by respecting the rate limits : https://dev.netatmo.com/guideline#rate-limits)
- Check the "on" value for the NLPO. You'll retrieve a boolean (true/false value)

Have a good day,
Leslie - Community Manager
antoine.frt
Posts: 5
Joined: 08 Jul 2017, 17:44

Re: Retrieve boiler status in "pseudo real time"

Post by antoine.frt »

Hi Leslie !

Thanks a lot for your answer !
Would have been awesome if their was some webhooks based on boiler event but I was already aware that they doesn't exist and I would need to implement my own pooling mechanism.

I was searching for the information your are talking about but I don't have no NLPO (?) in the payload returned by my request to /homesdata.
Please find below what I received (I removed personal information, rooms, zones, schedules etc...)

Code: Select all

{
  "body": {
    "homes": [
      {
        "id": "***",
        "name": "***",
        "country": "FR",
        "timezone": "Europe\/Paris",
        "modules": [
          {
            "id": "***",
            "type": "NAPlug",
            "name": "Appart",
            "setup_date": 1483816329,
            "modules_bridged": [
              "***",
              "***",
              "***",
              "***",
              "***"
            ]
          },
          {
            "id": "***",
            "type": "NATherm1",
            "name": "Thermostat",
            "setup_date": 1483816379,
            "room_id": "2284391758",
            "bridge": "***"
          },
          {
            "id": "***",
            "type": "NRV",
            "name": "Vanne salle a manger",
            "setup_date": 1501255683,
            "room_id": "2956782714",
            "bridge": "***"
          },
          {
            "id": "***",
            "type": "NRV",
            "name": "Vanne cuisine",
            "setup_date": 1501263199,
            "room_id": "1922475933",
            "bridge": "***"
          },
          {
            "id": "***",
            "type": "NRV",
            "name": "Vanne chambre",
            "setup_date": 1501256520,
            "room_id": "2958590578",
            "bridge": "***"
          },
          {
            "id": "***",
            "type": "NRV",
            "name": "Vanne bureau",
            "setup_date": 1501262590,
            "room_id": "3247014899",
            "bridge": "***"
          },
          {
            "id": "***",
            "type": "NAMain",
            "name": "Indoor",
            "setup_date": 1359763200,
            "modules_bridged": [
              "***"
            ]
          },
          {
            "id": "***",
            "type": "NAModule1",
            "name": "Extérieur",
            "setup_date": 1384430708,
            "bridge": "***"
          }
        ],
        "therm_mode": "hg",
        "therm_setpoint_default_duration": 180
      }
    ],
    "user": {
      "email": "***",
      "language": "fr",
      "locale": "fr-FR",
      "feel_like_algorithm": 0,
      "unit_pressure": 0,
      "unit_system": 0,
      "unit_wind": 0,
      "id": "***"
    }
  },
  "status": "ok",
  "time_exec": 0.06071901321411133,
  "time_server": 1630014949
}
Leslie
Posts: 42
Joined: 12 Feb 2020, 11:07

Re: Retrieve boiler status in "pseudo real time"

Post by Leslie »

Hi Antoine,

Sorry, I misunderstood you were talking about the NATherm1
For this device, we don't provide an "on/off state" via the API. The best way to know its state is to make a /getmeasure request : https://dev.netatmo.com/apidocumentatio ... getmeasure
If the returned value for the last measure is strictly equal to 0 : it means that the boiler is off. If the measure is different than 0 : it's on

Have a good day,
Leslie - Community Manager
antoine.frt
Posts: 5
Joined: 08 Jul 2017, 17:44

Re: Retrieve boiler status in "pseudo real time"

Post by antoine.frt »

Hi Leslie,

Thanks again for your feedback :)

Just tried what you suggested with the /getmeasure endpoint but I still have some issues.

I have set in my request the required query params below:
* device_id = mac address of the NATherm1 device
* scale = 30min
* type = boileron

But I receive 404 with response below:

Code: Select all

{
error:{
code:9
message:"Device not found"
}
}
I checked twice the ID of my NATherm1 device, and everything is fine.
Do you have an idea why I can't access access to the measure of this device ?

Please find below the curl command related to my request (I have "uglified" some params for privacy :) )

Code: Select all

curl -X GET "https://api.netatmo.com/api/getmeasure?device_id=70%3Aee*****e%3A6f%3Adc&scale=30min&type=boileron&optimize=true&real_time=true" -H "accept: application/json" -H "Authorization: Bearer 52951e921****3da36d|5ca4d4e2f2e4f6*****84e6e438b5"
Leslie
Posts: 42
Joined: 12 Feb 2020, 11:07

Re: Retrieve boiler status in "pseudo real time"

Post by Leslie »

Hi Antoine,

I think there is a little error in our documentation as "module_id" is missing but needed to perform this call
You should also correct the way your device_id is encoded in the request
Other points seems correct to me, you just need to add the module_id value of your thermostat

It should look like the following :

Code: Select all

curl -L -X GET 'https://api.netatmo.com/api/getmeasure?device_id=70:ee:xxxxxx&scale=1hour&type=boileron&optimize=true&real_time=true&module_id=04:00:xxxxxxxxx' \
-H 'Authorization: Bearer 5e37f3eaa774xxxxxfd972c073a55658d911f'
Have a good day,
Leslie - Community Manager
mdillmann
Posts: 77
Joined: 15 Oct 2017, 13:51

Re: Retrieve boiler status in "pseudo real time"

Post by mdillmann »

Hi Antoine,
use the /homestatus with the home_id in question and you'll get this:

Code: Select all

modules:[
{
boiler_cable:false
firmware_revision:222
hardware_version:229
id:"xx"
rf_strength:107
type:"NAPlug"
wifi_strength:56
}
{
anticipating:false
battery_level:4498
boiler_status:false
boiler_valve_comfort_boost:false
firmware_revision:75
id:"yyy"
reachable:true
rf_strength:64
type:"NATherm1"
bridge:"zzz"
battery_state:"full"
}
]
"boiler_status" = true will tell you if the Thermostat has switched on the boiler.

HTH
-Markus
antoine.frt
Posts: 5
Joined: 08 Jul 2017, 17:44

Re: Retrieve boiler status in "pseudo real time"

Post by antoine.frt »

Hi Leslie,

Thanks for reply.

Still had some issues but I made some investigations for the /getMeasure endpoint
As you said, module ID is required. This module ID is the MAC address of my device NATherm1.
Then the device ID is also required. This device ID value has to be the MAC address of the NAPlug.
I'm now able to get some data on the value array.

But when I start my boiler manually, I still get 0 as last value of this array.
I think that the value is updated only when the boiling is requested by my Netatmo devices. Can you confirm ?
Basically, I would like to retrieve the boiling status even if the boiler has been started manually or for any other reason than when Netatmo devices send a request.
Do you know if it is possible ?

@mdillmann thanks for reply as well
As said above, I would like to retrieve the "boiler on" status that has been triggered by any "requests". It can be manual request from the command panel of the boiler, automated request from the boiler itself (for hot water during summer for example), and from the Netatmo Thermostat.

Antoine
mdillmann
Posts: 77
Joined: 15 Oct 2017, 13:51

Re: Retrieve boiler status in "pseudo real time"

Post by mdillmann »

Via API from Netatmo you can only retrieve what Netatmo initiated. The relay is not "bi-directional" in a way that it could detect if the boiler is running.

If you want to detect boiler operations (real-time or not) directly, it would need an API. Eg my wood-pellet-boiler has a Modbus interface.
Depending on the type of boiler, you could go the indirect route:
  • measure electricty-consumption, which could be (significantly) higher than standby via a cheap Tasmota/mqtt plug
  • measure temp on the boiler-chassis / smoke-exhaust
  • if its a gas-boiler with open flame visibility via some optical sensor
But all these are completely outside of Netatmo-API.
Post Reply

Return to “Netatmo API”