Urban Weather Station Netatmo LUA Script for Vera

Eureka! Thanks to all for this, I can confirm V3 works perfectly.

Perhaps I can help others a little now.

First, buy a Netatmo! You know you want to… I was the first to get one in NZ and their support has been excellent.

Second, get a Netatmo App ID (assuming you set up your account with them that is!

Third, install the VContainer app - it’s called Virtual Container in the MIOS apps - took me a while to realise that! You’ll also need to go to he Mios App Store, login and install the GCal plugin as this gives the JSON libraries that the code uses which are not present by default. Thanks Ric for reminding me!

Fourth, go to Apps, My Apps, VContainer and create a second one. Name them Inside and Outside or what makes sense to you, and note their device numbers by clicking the wrench then Advanced and scrolling down a bit.

Fifth, edit the V3 code from a_lurker above, to include your netatmo app parameters (the first two rows of XXXX) and your netatmo account email address and password. Then change the device numbers 34 and 35 in the code to the ones you noted for your own system.

Sixth, reate a new scene, and in the LUA/LUUP section, paste your edited V3. Save it, Confirm it, Save with the big red button and all should work.

Seventh, relax and thank those who have helped me, a total novice, to get this to work.

Cheers guys!

P.S. I changed the word “Hour” to “Time” to Anglicise it a bit. Next I plan to find some more meaningful values to put in exterior variables 4 and 5 so it looks nicer and more informative. Be aware Netatmo have just released additional indoor modules and will be releasing Wind and Rain sensors later this year - allegedly!

Glad to hear it worked out for you. Strange that my code worked for me…

Don’t forget to put the installation of “Google calendar plugin” for the json library in your list.

The 2 unused slots in the Vcontainer you can go in and clear in the device option so it looks pretty.

Thanks Ric, well spotted, I have updated the post above. Yes strange, but working well. And I did figure how the clear the unwanted variables. The only bug I have now is that if the time is between nn:00 and nn:09, the leading zero is missing. Pedantic I know…

When I get a moment I’m going to try to create a V4 which will allow use of additional internal Netatmo modules, mine is in the post as I write.

This netatmo looks cool. can someone post a screenshot of what info is available in vera with this script?

I agree, the Netatmo is a great product in terms of design, quality and support. The API, whilst beyond me, looks well documented too. Screen shots attached - one for the indoor sensor (Lounge) and one for the outdoor (Tauherenikau).

In relation to my last post, please ignore the other Lounge temp and humidity readings, they are from my Nest Thermostat which s not connected at present so are old readings. The Lounge Clinate is from Netatmo - I’ve just now lit the wood burner!

thanks, very nice. it looks like all the data is available to vera, and you can act on those variables?

I was looking into weather stations and found the netatmo. i really want a rain sensor and the devs said somewhere that it will be available within this year.

Yes, my second indoor sensor is in the mail already, it shipped earlier than they said it would be available. I hear that rain and wind sensors are coming out later this year so have held off buying another brand. The API has been expanded to a structure where you have an owner who may have multiple devices, and to each of those primary devices a number of secondary ones may be connected. So, I may have a primary device at home and another at my holiday home, and then several extra sensors (e.g. Wind, rain) attached to either. I was sold on the app and web interface too, very neat and well designed. I’ve been running my outdoor unit for around 6 months now and the batteries are still 75% so no worries there.

As to the variables in the Vcontainers then yes, I’ve seen it done elsewhere, but I’m no programmer these days so it might be best to ask others. Since the script gets the data from the Netatmo web service and puts them into the containers, I’m sure another script can pull them out and act on them. That’s what I intend to do - my two indoor units will tell me the temperature in the lounge and the bedroom, and if the lounge has excess heat it will turn on an appliance module to activate my heat transfer unit to take hot air from above the wood burner and send it to the bedroom. If the lounge temperature drops I’ll have a scene that turns it off again so that after the fire goes out I’m not pumping cold air into the bedroom. Similarly if the bedroom is already warm enough the scene won’t activate. Now all I have to do is learn how to code this! Any ideas on how to control my woodfire via Vera much appreciated!!!

I’m a sucker for cool gadgets, so i ordered one today!

You won’t regret it, good luck!

You can use “Program Logic Event Generator” to control the fans with temperature inputs, easy and no programming skills needed.
And Vera alerts to controlling you for the woodfire.

Real cool 8) thanks to all who made this work. I must now get the Netatmo!! ;D

Quick Q for those who have it: In the specs it says that the system uses 915 MHz or 868 MHz for communication, anyone noticed any interference with Z-Wave/Vera?

Would be real cool to have a proper plugin for the Netatmo :slight_smile:

No probs with interference for me, although living in NZ Z-Wave is on a different frequency than other locations. Netatmo is sold worldwide though and has been going for a while now so m sure we or they would have heard.

As to the wood burner, does anyone know of a Z-Wave device to get me out of my comfy chair? I did heat about the Z-Wife but I’m afraid it might interfere with my life…

I got my netatmo installed and am trying to get this script running.

where do i find

local s_client_id = “XXXXXX”
local s_client_secret = “XXXXXX”

looks like i need to get a developer app or something?

never mind, i watched the youtube vid and got them. back to work…

And it works! Very nice.

How do I get the temps to F instead of C? They’re F on my ios interface.

Hi, I assume you’ve fund the answer to your question, but if not, this is what Thomas from Netatmo wrote to me:

“You have to create an application through dev.netatmo.com.
You will then retrieve application client_id and client_secret from the app you just created.”

With regard to degrees F, I think there is something in the way you request the data, have a read of the API docs, they are well written. I’ll have a look in the meantime in case I spot it.

Mmmm, Netatmo docs say temperature is always returned in Celsius. So, I guess you’ll need someone smarter than me to modify the LUA code. I think you need the formula tempf = ((tempc/4)*9)+32 but I’m not sure if that works in Luup land! Good luck!

5

Yes, sorry! Typo or old age, not sure which!

This netatmo is pretty amazing. It does not (yet) have all of the local sensors that some of the other weather stations have (wind, rain), but it has some that most don’t (CO2, sound level).

The data logging and viewing is simple and amazing. And the presentation of the data on a tablet/phone is beautiful.

My only regret is that I didn’t buy this thing earlier.

Hi
Nobody to make a real plugin for this weather station with each separated devices and correct device types ?