2

Integrating the netatmo anemometer into the Fibaro Home Center 2 – This is how it works

by boomx22. November 2015

Chris introduced you all the new netatmo anemometer 2 days ago. We are now going to show you, how to integrate it into your Fibaro Home Center 2.

As we all unfortunately know, the integration of new devices always takes a bit longer for Fibaro. Due to this fact and because we did not want to wait, we came up with the idea of just programming it by ourselves, right after we received the netatmo anemometer. Because of the open interface of Netatmo this was no problem at all. You can find the result in this article.

To be able to read the anemometer, it has to be connected to your netatmo weather station. In case you should already be using the plugin of the Fibaro HomeCenter 2, you already have a developer-account on the netatmo-website.

The installation of the anemometer scene

Let us come to the actual integration now. This, on the one hand, consists of a scene, which exports the API-Call to the netatmo-interface and writes the data in global variables and on the other hand, of a virtual device, which displays the values. You might be asking yourself, why we cannot just go ahead and use a virtual device from the beginning on. This is a reasonable question, but unfortunately, https-connections cannot be set up with a virtual device. So far, this only works in scenes and also only when using the Firmware-Version 4 of the Fibaro HomeCenter 2. So just create a new scene and copy the following code into your scene:

 

At this point, we do not have to change a lot. Your data of the open app on dev.netatmo.com (as shown on the picture; variables are named after client_id (script) = Client id (netatmo), client_secret = Client secret) only has to be entered into lines 8-12, along with the user/password combination of your account.

Your data under the developer-account

Your data under the developer-account

Afterwards, you need to add four variables under the page “Panels”, “Variables Panel” via the switch panel “Add”. These have to be called:

  1. wind forth
  2. wind direction
  3. gust strength
  4. gust direction

If you set all that up correctly, the script is supposed to start and update the values every 5 minutes. The following should then appear in the debug-window (in case this does not happen and you receive an error message, you made a mistake with your access data):

Debug of the anemometer scene

Debug of the anemometer scene

The virtual device for the anemometer

Anemometer VD on the overview page of HC2

Anemometer VD on the overview page of HC2

With the virtual device for the anemometer, you can take a look at the present wind speeds and wind directions via the web surface of the HomeCenter 2. The file for the import can be downloaded on here. After you downloaded the file and imported it via “Add/Remove”, you have to adjust the ID of the virtual device in the script posted above. This can be done in line 14. The ID of the just imported device has to be entered in this line. In case you should not know this ID, you can just switch to the edit mode of the device. On there, the ID can be found in the browser bar above. By doing this, you also update the VD, that way the current values will always be included. You are now finished with the installation.

Of course, we also did not forget the icons on the Fibaro web surface:

And now, have fun with measuring the wind  We are looking forward to read your comments/questions/suggestions.

Update:

In case you should receive various mails concerning registrations of IP XXX.XXX.XXX.XXX, after the installation, that are being send directly from netatmo, you can deactivate them. In order to do so, go to netatmo.com and simply log in with your data. Afterwards, you can click the middle icon, in the top right corner (as shown on the picture):

Netatmo profile-settings (red rectangle)

Netatmo profile-settings (red rectangle)

You have to scroll down in the new window and go on the setting box “E-Mail-preferences”. The menu of the settings for the mail-shipment of your account is going to open. If you set it up as shown in the following picture, you will not receive those mails anymore.

Settings in the netatmo account

Settings in the netatmo account

Linda translator

This text was translated by Linda

Hi! My name is Linda and I graduated high school with great interest in English language. I help with mein-cleveres-haus.de and translate texts for siio.de in my spare time.

You can read the original in German on siio.de.

About The Author
boomx
boomx
  • piotr
    3. October 2016 at 20:45

    they works better with change
    fibaro:setGlobal(‘windstaerke’, WindStrength)
    with
    fibaro:call(vd_ID, “setProperty”, “ui.Label1.value”, ” “..WindStrength .. ” km/h”)
    for another value same change
    in this case You not need code in button on virtual device.

  • Kees
    29. October 2016 at 9:46

    What is the url to the client info on the site of Netatmo?
    cant find it.
    kind regards
    Kees

Leave a Response