Netatmo

Netatmo

How to use the Netatmo weather station with OpenHAB.

Examples:

Classic UI or Mobile App

Basic UI

on an habpanel 

or in a graph view 

Note the graph above on the CO2 part. It’s in a bedroom and the line starts after a night of sleeping. The CO2 concentration was in the alert zone. Opening the door the concentration decreases slowly in a safer zone. Then the windows have been open ventilating the room and the air quality became very healthy so quickly.

Considerations about measurements

On the Netatmo installation manual it’s well explained how to arrange the sensors in order to have reliable measures. For the outdoor device it’s strongly recommended to put it inside a dedicated protecting cap like, for example, this one. They are cheap, protect your device from weather and improve a lot the quality of the measures.

Netatmo

This article will describe how to connect a NETATMO personal weather station with OpenHAB.

Configuration

The OpenHAB Netatmo binding tutorial is good enough but, as usual, some precaution must be followed to achieve an up-and-running configuration without wasting too much time.

First of all the main unit needs to be connected to the Netatmo cloud. After creating the personal account on Netatmo web site the app to configure the main device and the additional stations can be downloaded:

Connecting the main unit to the computer through the supplied USB cable and starting the wizard, the devices will be registered, named and configured.
As explained on the binding tutorial it needs to create an app in order to open the available API for the device. This allows to get the Client ID and the Client secret needed to configure the Netatmo API bridge (automatically created after the binding installation). It’s interesting to take a look at the API available and how many applications can be done with just a small coding. A lot of examples are proposed both in python and javascript.

Connect the Netatmo bridge.

When the Netatmo API bridge is  ONLINE  (and ONLY when it’s  ONLINE ) the things related to the devices can be added. It could be possible that it needs a reboot to be connected.

Note! These configuration examples show fake IDs. The configurations supplied must be updated with the correct IDs after registration.

If the Netatmo API bridge is correctly installed and connected, the main and the outdoor devices parameters, configured on the Netatmo cloud, will be linked automatically to the things exposed by the binding, with the correct IDs and shown in the inbox ready to be confirmed.

On the contrary on what the binding tutorial teaches, it’s better to use all the Paper UI automatic discovery features instead of writing down the things configuration files. This because the things parameters will be displayed only when all it’s correctly configured, step by step, and they will be correct for sure.

In this case there are the things for API, outdoor and indoor units as parts of the standard weather station:

The name of each thing is shown in the device things list

E.g.:

netatmo:NAModule1:bd02ddba:0200002b4bde:Temperature

Configure:

items/netatmo.items

Number Netatmo_Indoor_Temperature         "Temperature in [%.1f °C]"                { channel = "netatmo:NAMain:bd02ddba:70ee502af646:Temperature" }
Number Netatmo_Indoor_Humidity            "Humidity in [%d %%]"                        { channel = "netatmo:NAMain:bd02ddba:70ee502af646:Humidity" }
Number Netatmo_Indoor_Humidex             "Humidex in [%.1f °C]"                { channel = "netatmo:NAMain:bd02ddba:70ee502af646:Humidex" }
Number Netatmo_Indoor_HeatIndex           "Heat Index in [%.1f °C]"             { channel = "netatmo:NAMain:bd02ddba:70ee502af646:HeatIndex" }
Number Netatmo_Indoor_Dewpoint            "Dewpoint in [%.1f °C]"              { channel = "netatmo:NAMain:bd02ddba:70ee502af646:Dewpoint" }
Number Netatmo_Indoor_DewpointDepression  "Dew point Depression in [%.1f °C]"  { channel = "netatmo:NAMain:bd02ddba:70ee502af646:DewpointDepression" }
Number Netatmo_Indoor_Co2                 "Co2 [%.0f ppm]"                          { channel = "netatmo:NAMain:bd02ddba:70ee502af646:Co2" }
Number Netatmo_Indoor_Pressure            "Pressure [%.1f mbar]"                         { channel = "netatmo:NAMain:bd02ddba:70ee502af646:Pressure" }
Number Netatmo_Indoor_AbsolutePressure    "Absolute Pressure [%.1f mbar]"                { channel = "netatmo:NAMain:bd02ddba:70ee502af646:AbsolutePressure" }
Number Netatmo_Indoor_Noise               "Noise [%.0f db]"                           { channel = "netatmo:NAMain:bd02ddba:70ee502af646:Noise" }
Number Netatmo_Indoor_WifiStatus          "Wifi Status [%s]"                               { channel = "netatmo:NAMain:bd02ddba:70ee502af646:WifiStatus" }
DateTime Netatmo_Indoor_TimeStamp         "Time Stamp [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"    { channel = "netatmo:NAMain:bd02ddba:70ee502af646:TimeStamp" }
Location Netatmo_Indoor_Location          "Location"                                  { channel = "netatmo:NAMain:bd02ddba:70ee502af646:Location" }
DateTime Netatmo_Indoor_LastStatusStore   "LastStatusStore [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"    { channel = "netatmo:NAMain:bd02ddba:70ee502af646:LastStatusStore" }
Number Netatmo_Indoor_Unit                "Unit [MAP(netatmo_unit_en.map):%s]"          { channel = "netatmo:NAMain:bd02ddba:70ee502af646:Unit" }
Number Netatmo_Indoor_WindUnit            "WindUnit [MAP(netatmo_windunit.map):%s]"     { channel = "netatmo:NAMain:bd02ddba:70ee502af646:WindUnit" }
Number Netatmo_Indoor_PressureUnit        "PressureUnit [MAP(netatmo_pressureunit.map):%s]"    { channel = "netatmo:NAMain:bd02ddba:70ee502af646:PressureUnit" }

Number Netatmo_Outdoor_Temperature        "Temperature out [%.2f °C]"                  { channel = "netatmo:NAModule1:bd02ddba:0200002b4bde:Temperature" }
String Netatmo_Outdoor_TempTrend          "TempTrend [%s]"                                   { channel = "netatmo:NAModule1:bd02ddba:0200002b4bde:TempTrend" }
Number Netatmo_Outdoor_Humidity           "Humidity out [%d %%]"                        { channel = "netatmo:NAModule1:bd02ddba:0200002b4bde:Humidity" }
Number Netatmo_Outdoor_Humidex            "Humidex out [%.1f °C]"                { channel = "netatmo:NAModule1:bd02ddba:0200002b4bde:Humidex" }
Number Netatmo_Outdoor_HeatIndex          "Heat Index out [%.1f °C]"              { channel = "netatmo:NAModule1:bd02ddba:0200002b4bde:HeatIndex" }
Number Netatmo_Outdoor_Dewpoint           "Dewpoint out [%.1f °C]"              { channel = "netatmo:NAModule1:bd02ddba:0200002b4bde:Dewpoint" }
Number Netatmo_Outdoor_DewpointDepression "Dew point Depression out[%.1f °C]"    { channel = "netatmo:NAModule1:bd02ddba:0200002b4bde:DewpointDepression" }
Number Netatmo_Outdoor_RfStatus           "Rf Status [%.0f / 5]"                       { channel = "netatmo:NAModule1:bd02ddba:0200002b4bde:RfStatus" }
Switch Netatmo_Outdoor_LowBattery         "Low Battery [%s]"                            { channel = "netatmo:NAModule1:bd02ddba:0200002b4bde:LowBattery" }
Number Netatmo_Outdoor_BatteryVP          "V Battery [%.0f %%]"                      { channel = "netatmo:NAModule1:bd02ddba:0200002b4bde:BatteryVP" }
DateTime Netatmo_Outdoor_TimeStamp        "Time Stamp [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"    { channel = "netatmo:NAModule1:bd02ddba:0200002b4bde:TimeStamp" }
DateTime Netatmo_Outdoor_LastMessage      "LastMessage [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"    { channel = "netatmo:NAModule1:bd02ddba:0200002b4bde:LastMessage" }

sitemaps/cm3home.sitemaps

Frame label="Netatmo"
{
    	Text label="Indoor" icon=presence
		{
			Text    item=Netatmo_Indoor_Temperature valuecolor=[>25="red",>20="green",<=20="blue"]
			Text    item=Netatmo_Indoor_Humidex  valuecolor=[<20.1="green",<29.1="blue",<28.1="yellow",<45.1="orange",<54.1="red",>54.1="maroon"]
			Text    item=Netatmo_Indoor_Humidity valuecolor=[>60="blue",>40="green",<=40="orange"]
			Text    item=Netatmo_Indoor_Dewpoint
			Text    item=Netatmo_Indoor_Co2  valuecolor=[<800="green",<1000="orange",<1400="red",>1399="maroon"]
			Text    item=Netatmo_Indoor_Pressure
			Text    item=Netatmo_Indoor_Noise
			Text    item=Netatmo_Indoor_WifiStatus
			Text    item=Netatmo_Indoor_TimeStamp
			Text    item=Netatmo_Indoor_Location
    	}
    	Text label="Outdoor" icon=terrace
		{
			Text    item=Netatmo_Outdoor_Temperature
			Text    item=Netatmo_Outdoor_TempTrend
			Text    item=Netatmo_Outdoor_Humidity
			Text    item=Netatmo_Outdoor_Humidex
			Text    item=Netatmo_Outdoor_Dewpoint
			Text    item=Netatmo_Outdoor_RfStatus
			Text    item=Netatmo_Outdoor_LowBattery
			Text    item=Netatmo_Outdoor_BatteryVP  valuecolor=[>60="green",>45="orange",>36="red",>0="maroon"]
			Text    item=Netatmo_Outdoor_TimeStamp
    	}
}

The data can be displayed on an Habpanel too . In order to customize the panel with very local parameters, the widget can be modified integrating the measures from different technologies, i.e.: Sonoff, 1-Wire, etc. The example supplied with the SD card can be enhanced with more items:

<table id="weather-table">
<tbody>
<tr>
<td><img id="weather-icon" src="../static/weather-data/images/{{IconSet}}/{{statesnames[itemValue('Condition_ID')]}}.png" align="left" /></td>
<td id="weather-temp">{{'%.1f' | sprintf:itemValue('Netatmo_Outdoor_Temperature')}}</td>
<td id="weather-temp-sign">°C
ext</td>
<td id="weather-temp">{{'%.1f' | sprintf:itemValue('TempIntValue')}}</td>
<td id="weather-temp-sign">°C
int Nord L</td>
<td id="weather-temp">{{'%.1f' | sprintf:itemValue('Sonoff1Temp')}}</td>
<td id="weather-temp-sign">°C
int Nord S</td>
<td id="weather-temp">{{'%.1f' | sprintf:itemValue('Netatmo_Indoor_Temperature')}}</td>
<td id="weather-temp-sign">°C
int Sud</td>
</tr>
<tr>
<td></td>
<td id="weather-table-details1">Umidità:</td>
<td id="weather-table-details2">{{'%.0f' | sprintf:itemValue('Netatmo_Outdoor_Humidity')}} %</td>
<td id="weather-table-details1"></td>
<td id="weather-table-details2"></td>
<td id="weather-table-details1">Umidità:</td>
<td id="weather-table-details2">{{'%.0f' | sprintf:itemValue('Sonoff1Hum')}} %</td>
<td id="weather-table-details1">Umidità:</td>
<td id="weather-table-details2">{{'%.0f' | sprintf:itemValue('Netatmo_Indoor_Humidity')}} %</td>
</tr>
<tr>
<td></td>
<td id="weather-table-details1">Pressione:</td>
<td id="weather-table-details2">{{'%.0f' | sprintf:itemValue('Netatmo_Indoor_Pressure')}} mBar</td>
<td id="weather-table-details1"></td>
<td id="weather-table-details2"></td>
<td id="weather-table-details1"></td>
<td id="weather-table-details2"></td>
<td id="weather-table-details1">CO2:</td>
<td id="weather-table-details2">{{'%.0f' | sprintf:itemValue('Netatmo_Indoor_Co2')}} ppm</td>
</tr>
<tr>
<td></td>
<td id="weather-table-details1">Percepita:</td>
<td id="weather-table-details2">{{'%.0f' | sprintf:itemValue('Netatmo_Outdoor_Humidex')}} °C</td>
<td id="weather-table-details1"></td>
<td id="weather-table-details2"></td>
<td id="weather-table-details1"></td>
<td id="weather-table-details2"></td>
<td id="weather-table-details1">Percepita:</td>
<td id="weather-table-details2">{{'%.0f' | sprintf:itemValue('Netatmo_Indoor_Humidex')}} °C</td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table> 
Links

Share