Netatmo Weather Station plugin

I don’t want to take this thread off track, but I thought this was the best place to mention is. You can get the Netatmo from Amazon for $149 (~$30 off I think). Not too bad:

I now allow this thread to return to the “plugin” :smiley:

Fine by me… more Netatmos means more Netatmo plugin users!

I have been finishing off a new version for the App Store and Netatmo has just announced to developers an important change to the API, so I have a bit more work to do…

The new API has been providing a significant opportunity for simplification in the plugin’s code (although this is proving hard to do!) As a bonus, it’s going to enable a few new, and hopefully useful, features:

[ul][li]a significantly enhanced number of variables in the main Netatmo device, including: “AbsolutePressure” (sea level), “MaxTemp”, “MinTemp”, “DateMaxTemp”,“DateMinTemp”, “TimeUtc” (actual time of readings)
[/li]
[li]the “MaxTemp”, “MinTemp” (daily) values will also be available as variables in child temperature devices[/li]
[li]the Rain module will have variables: “Rain” (as before, the latest reading), “SumRain1” (current hourly total), “SumRain24” (current daily total), with a facility to display any or all of these values.[/li]
[li]the standard icon set will include dynamic CO[sub]2[/sub] child device icons indicating different thresholds (as does the Netatmo hardware)[/li]
[li]battery levels for the different modules may be available (although these are currently in weird units and need some decoding)[/li][/ul]

All work in progress, but hopefully available as a beta from here soon, and in the app store a bit later.

Awesome @akbooer!!! You know I’m more than willing to beta test!

Sent from my Nexus 7 using Tapatalk

Here’s a beta version of the plugin using the new API. Perhaps the most significant change is one that you shouldn’t see: it now only takes one HTTP request to retrieve all the data instead of one per module (in my case, that’s a 6:1 difference).

However, the observable differences include:

[ul][li]Netatmo icon - changes colour according to device status (example attached):
[list]
[li]transparent - unitialised[/li]
[li]red - authorizing client credentials. Remains red if the authorization fails.[/li]
[li]yellow - temporary internet communication failure. May later clear if problem goes away.[/li]
[li]green - normal status[/li]
[li]blue - at least one of the module batteries is low[/li]
[/list][/li]
[li]CO[sub]2[/sub] icon - changes colour according to thresholds (example attached):
[list]
[li]pale green - below 1000 ppm[/li]
[li]pale yellow - below 2000 ppm[/li]
[li]rather a fetching shade of pink - above 2000 ppm[/li]
[/list][/li]
[li]Rain - front panel displays latest reading, control tab also shows hourly and daily totals[/li]
[li]Pressure - control tab also shows ‘absolute’ pressure adjusted to sea level[/li]
[li]Temperature - device variables [tt]MinTemp[/tt] and [tt]MaxTemp[/tt] show daily extremes. (I also have a modified JSON file which show these values on the control tab)[/li]
[li]New Device Variables - as well as the new child device variables mentioned above, the master device has additional variables including: [tt]DateMaxTemp, DateMinTemp, TimeUtc[/tt] (actual time of last reading), and [tt]Battery[/tt] for all modules[/li]
[li]The main device control page has links to three separate reports: device list, tree display of modules and measurements, and a comprehensive diagnostics page. [/li]
[li]The device list report has hyperlinks to plots of any of the variables over the duration of the memory cache since startup (configurable, but the default is two days at 10 minute sampling)[/li]
[li]the log file entries (or syslog, if you have that enabled) show actual measurements for each module.[/li][/ul]

I’ve also tried to make error recovery (internet protocol errors) more robust, but startup will still fail if the internet is not up at the time.

Installation

[ol][li]unzip the [tt]NetatmoFiles.zip[/tt] archive and transfer the files using the UI Luup files page[/li]
[li]unzip the [tt]NetatmoIcons.zip[/tt] archive and use [tt]scp[/tt] or equivalent to transfer to [tt]/www/cmh/skins/default/icons/[/tt][/li][/ol]

Don’t forget to restart and refresh your browser (possibly several times.)

I’m particularly keen to have someone check out all the units if they use the imperial system, but, as ever, any reports received with interest.

Akbooer
Downloaded new beta, so far no problems like the new icons. Will let you know if anything shows up longer term.

David

Fast feedback indeed @dsroberts1945.

Thanks for the positive reaction so far - let’s hope it stays that way!

No issues with the new beta here either. Thanks a million for all your work akbooer.

Just so pissed at conrad for not sending me the rain gauge, back in stock on 18th…

Good news re. Beta.
Bad news re. Gauge.

…get your order in for the wind speed and direction now! (I haven’t heard if they will do one, but I hope so.)

I remember reading somewhere that the wind speed/direction module is scheduled for Q4 this year but you newer know… don?t quite understand why it takes that much time to develop these modules, they are after all quite simple. Its not like they are inventing something new anyway…

I copied everything over, and at least right now, the netatmo icon shows Blue, whoever my battery shows full green on my.netatmo.com. What can I check to make sure I have the right icon?

Check all the Battery variable values (things like “OutdoorBattery”, or whatever you have called your modules) under the Netatmo Advanced tab. This will tell you what levels it thinks you have (over a range of 0-100%).

Now check the “stationInfo” values for “BatteryVp” for all the modules - you’ll find this under the diagnostics link on the Control tab: it’s the last item if you scroll to the bottom of the report. These are the raw value reported from the Netatmo API.

There is, as you will see, some conversion required. There is conflicting information about how to do this on the Netatmo developers’ forum, so I may have done something wrong. I am logging all my values over time to see how it goes, but this will take months to come to a firm conclusion, so data from others will be useful. I set a threshold of 10% to flag any low batteries.

Let me know the values. I doubt, very much, that your icons are screwed up. Thanks.

no such field. Maybe I need to reupload the files?

For all 3 links I get “ok” as the response :frowning:

[quote=“akbooer, post:311, topic:176667”]There is, as you will see, some conversion required. There is conflicting information about how to do this on the Netatmo developers’ forum, so I may have done something wrong. I am logging all my values over time to see how it goes, but this will take months to come to a firm conclusion, so data from others will be useful. I set a threshold of 10% to flag any low batteries.

Let me know the values. I doubt, very much, that your icons are screwed up. Thanks.[/quote]
I’m thinking there is something up with my files I uploaded. I even deleted the device and recreated it today to see if it would fix it. I will re-upload the files and do the vera 2-step about a hundred times :slight_smile:

What version (Advanced tab) does it say you have?

there were some non lzo files for L_netatmo.lua and L_netatmo2.lua that were from April. I deleted them and now everything is working correctly. Sorry I’m just a bad beta tester today…LOL

Ok, time for my thoughts:

The plugin is working and I don’t have any issues in the whole 5-10 minutes I"ve been using the correct files…LOL. I do now see the extra variables in the advanced tab for the new values we can get. Some thoughts though:

Can we get Min and Max daily temp devices (perhaps optional) that could show us not only the values, but the times (I assume this is what dateMaxTemp and dateMinTemp are, the times of the min/max values). I know that is 2 more devices per unit (in my case a total of 4, 2 for the inside unit, 2 for the outside).

Another option might be to have a way to tell the plugin which units you want to have those devices for with the option of 1 or 2 devices (1 device could show min/max on one, but not be a standard temp device like the 2 device option would be).

I know it’s a lot, and probably too much work, so feel free to say “No” or “sure, but it’s at the bottom of the list”. I currently use “World weather” for those values and I could see myself uninstalling that plugin and just using the netatmo for those values. The only thing I’d be missing is wind speed and direction, which around here, might not be accurate even with a close weather station (which is still a few miles away). In addition, I’ll get the rain (I’m gonna order one now I think).

Great thoughts. I’m in exactly the same situation. The only thing that would then be missing (apart from wind, which, hopefully, Netatmo will rectify in due course) is the forecast. It would be sad to remove the Weather plugin, since it was the first thing I ever installed. (dataMine was the second, but that has already gone, so I suppose it’s par for the course.)

So something like the attached, then?

It works like this:

[ul][li]There are new Netatmo device variables (aren’t there always?), one for each module, of the form [tt]MaxMin[/tt][/li]
[li]In the example below, the variable [tt]OutdoorMaxMin[/tt] has been set to “1”, and so there are now new child devices [tt]Outdoor - MaxTemp[/tt] and [tt]Outdoor - MinTemp[/tt][/li]
[li]Each of those child devices is a standard temperature device but has a customised icon and displays the respective date/time information of the measurement[/li]
[li]The format of the time display is totally customisable, with a local variable [tt]DateFormat[/tt] which is an [tt]os.date[/tt] format string. [/li]
[li]The default format is European 24-hour style tt[/tt], but in the US you’d want to use [tt](%I:%M %p)[/tt][/li][/ul]

Does this fit the requirements?

Great thoughts. I’m in exactly the same situation. The only thing that would then be missing (apart from wind, which, hopefully, Netatmo will rectify in due course) is the forecast. It would be sad to remove the Weather plugin, since it was the first thing I ever installed. (dataMine was the second, but that has already gone, so I suppose it’s par for the course.)

So something like the attached, then?

It works like this:

[ul][li]There are new Netatmo device variables (aren’t there always?), one for each module, of the form [tt]MaxMin[/tt][/li]
[li]In the example below, the variable [tt]OutdoorMaxMin[/tt] has been set to “1”, and so there are now new child devices [tt]Outdoor - MaxTemp[/tt] and [tt]Outdoor - MinTemp[/tt][/li]
[li]Each of those child devices is a standard temperature device but has a customised icon and displays the respective date/time information of the measurement[/li]
[li]The format of the time display is totally customisable, with a local variable [tt]DateFormat[/tt] which is an [tt]os.date[/tt] format string. [/li]
[li]The default format is European 24-hour style tt[/tt], but in the US you’d want to use [tt](%I:%M %p)[/tt][/li][/ul]

Does this fit the requirements?[/quote]

That is awesome :slight_smile:

Would you like to try it?

Files attached.