Testing Netatmo Weather station and using PHP API

Robert Andresen Internet of things, Programming Leave a Comment

We just bought some Netatmo devices (Weather station components) at work, to monitor the air-quality in our office. After using it for 3 days, I am a bit stunned over how much you can use this devices for.

The data itself are interesting enough, but when integrating this data in to a smarthome, you can actually «see» where the people are.

Netatmo also provides a great API, to integrate the devices with other systems.

The chart data

After looking at the chart in the Netatmo webapplication, I am actually stunned of how much this data can be used for. If I buy this at home, I can not only monitor the air-quality, but also track if there are people at home and build events based on this data.

netatmo_co2_chart

The negative sides

When you buy the «start-kit» it comes with an indoor and outdoor module. The indoor module can measure pressure and sound (dB). In addition to these two devices, you can have max three other add-on devices. We bought three indoor add-on devices, so the only way to add more devices, is to buy additional «start-kit» *.

Another negative thing is that this add-on modules does not have pressure and sound (dB). The pressure would most likely be the same, but the dB would be interesting to have on all devices.

I also wondered of how the CO2 is measured and how it calibrates. They are actually calibrating themselves, by taking the lowest value over one week period. They recommend airing the rooms fully once a week, to get a base value for 400 ppm. Looks like they assumes the outdoor value would be 400ppm. This means that you can never know how correct the CO2 value actually is (without having a very expensive calibrated device to compare with).

* I have to say that it looks like they have created a good way to link different locations and users together. If I buy Netatmo and install the devices at my own home, I can add myself as and administrator for the account at work as well. This means that the max device limit is not a problem if you buy multiple kits with main devices.

Shared with the world

In the webapplication you can share your data on social media (like twitter) – but I also found that the weather data is publicly available on the Netatmo weather map: https://www.netatmo.com/weathermap.

I’m not sure how I feel about this… It’s a really great feature, as you get real time weather-data from all over the world. Most weather services has an algorithm that calculates the weather-data in different places from the nearby sensors. Netatmo-data will probably give you more accurate data.

The downside is that your personal weather data is automatically shared with the world. I haven’t read the license agreement yet, but in theory Netatmo can sell your «private» data to a third-party.

How reliable this public data is, is another question, as some users can have the outdoor-module inside and others could have placed it on the sunny side of the house.

The API

Start here: https://dev.netatmo.com/
See also the PHP SDK they have on GitHub: https://github.com/Netatmo/Netatmo-API-PHP

I wrote a sample code I wrote for my own system, to log devices into my smarthome database. I used client authorization instead of token, so I have to store the Netatmo username and password in my database.

The code requires NAApiClient.php (dead link) and Config.php (dead link) from they’re PHP SDK on GitHub. My code builds an array with all the devices and values. The code uses my own classes for my MySmartHome, so it does not work «out-of-the-box» for you – but use it as an example 🙂