Netatmo is a weather station quickly presented here.
I wrote a web widget in PHP to display weather information of several locations and modules. I put it in my Mac OS X Dashboard via Safari and works like a charm.
Take a look on the sideshow above !
These are 3 weather stations attached to my Netatmo account :
- Home location
- TCPCode location (at the office)
- Digne location (merry christmas dad !)
- Grab the code on GitHub
- Just put your credentials on top of file
index.phpin your favorite web browser
If APC is enabled on your web server, weather station informations will be cached in order to call the Netatmo API no more than one time every five minutes.
You can call :
index.phpin a web browser. The widget will display all weather stations attached to your Netatmo account.
index.php?n=stationnamein a web browser. The widget will display only the selected weather station with parameter
index.php?cc=whateverin a web browser to delete cache informations and force the widget to fetch weather station informations from the Netatmo API.
index.php?l=fr_FRto display informations in french for example.
index.php?nu=USER_EMAIL&np=USER_PASS&nc=APP_CLIENT_ID&ns=APP_CLIENT_SECRETto display informations of a specific app and user.
index.php?u=1to display temperature informations in Fahrenheit. Use 0 for Celcius.
index.php?up=1to display atmospheric pressure in inHg. Use 0 for mbar.
index.php?up=2to display atmospheric pressure in mmHg. Use 0 for mbar.
index.php?do=TemperatureMin, TemperatureMax, PressureMin, Pressure, PressureMax, NoiseMin, Noise, NoiseMax, HumidityMin, Humidity, HumidityMax, CO2to select and manage order elements of the inner Device station.
index.php?mo=TemperatureMin, TemperatureMax, HumidityMin, Humidity, HumidityMax, CO2, Rain, RainSumto select and manage order elements of the external Module station.
index.php?scd=1monthto set scale for Min and Max value of the inner Device station. Accepted values are
1day, 1week, 1month.
index.php?scm=1dayto set scale for Min and Max value of the external Module station. Accepted values are
1day, 1week, 1month. If not set,
scdvalue will be used.
index.php?mm=1to display date for minimal and maximal values.
Remote access by sending your accounting informations in
GET url is disabled by default.
You can enable this feature by setting the constant
ALLOW_REMOTE_ACCOUNTING in file
define( 'ALLOW_REMOTE_ACCOUNTING' , true );
The widget can be displayed in your tongue :
- It first takes a look on your browser language.
- Then constant
config.inc.phpwill take precedence.
lwill take precedence.
You can contribute by translating the
lang/messages.po file in your locale. Available languages are :
- Dutsh - nl_NL (by B.J. de Jong)
- English - en_GB - en_US
- French - fr_FR
- German - de_DE (by Handyman1983)
- Italian - it_IT (by Luca Volpone)
- Polish - pl_PL (by Karol Zak)
- Spanish - es_ES (by Andrew Kurtis @ WebHostingHub )
The widget can display temperatures in Celcius or Fahrenheit :
- It first takes a look on your Netatmo user preferences.
- Then constant
config.inc.phpwill take precedence if defined.
uwill take precedence.
This is the same thing for atmospheric pressures with constant
- Enhancement : Add rain modules support
- Enhancement : Add user stylesheets customisation
- Fix : display fixed when several modules
- Enhancement : best locale management for french and german
- Enhancement : display min and max dates on a new line for large display
- Change :
- Bug fix : float temperatures instead of integer
- Enhancement :
scmchange cache informations
- New feature : Atmospheric pressure units
- New feature : Choose what measure to display for inner and external sensors
- Enhancement : White style
- New feature : Metric units
This plugin is licensed under the GNU General Public License and is copyright 2012 potsky.
A special thanks goes out to Netatmo and their fabulous API !