Linux Bash Script for reading values from the Netatmo Weather API by only using username and password
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Netatmo Weather Station Shell Script

A Linux Shell / Bash script for querying the data of your Netatmo weather station(s). This script only uses the public Netatmo API. Just specify your username and password from your Netatmo account.

Usage -h [-u <user>] [-p <pass>] -D [OPTIONS]

General options

Display this help message and exit

-u [username]
User to use (default is set in the configuration area of this script). A guest user is sufficient.

-p [password]
Passwordassword to use (default is set in the configuration area of this script)

Don't fetch data, but get device info and current readings. If jq is available, it's used to format and pretty-print the output.

Additional general options for data fetching (not -D) mode only

Get the data as Excel, not as CSV

In the output filename, use the module's ID instead of it's name

-o [directory]
Directory to put the received files in (defaults to the current directory)

Date/time selection options (not for -D mode)

-s [date time]
Start time (format: 'YYYY-MM-DD HH:MM:SS') Defaults to now - 3600 seconds

-e [date time]
End time (format: 'YYYY-MM-DD HH:MM:SS') Defaults to now

Date/time selection shortcuts (not for -D mode)

-n [seconds]
Get data for the last seconds

Get yesterday's data

Get today's data (00:00:00 until now)

-d [yyyy-mm-dd]
Get historical data for the specified day

Get this month' data

Get last month' data

-M [yyyy-mm]
Get data for the specified month


In -D mode, prints out the received JSON object to STDOUT.

In data fetching mode, generates a separate output file for each sensor. For the main module e.g. you'll get five different files, one for temperature, humidity, co2, noise and pressure each.

The files will be placed in your current directory (or in whatever directory you specified using the -o option).

Filenames are [module][sensor][time or timerange].[extension]

    Is the module's name as given in your configuration, or it's
    ID ('aa:bb:cc:dd:ee:ff') if requested via -i.

    Is the name of the sensor as defined by NetAtmo 
    (co2, humidity, noise, pressure, rain, temperature etc.)

[time or timerange]
    Depends on your request.

    If you request data for a specific day (-d, -y, -t), it will be
    the day (e.g. '2016-01-16'). For today, where you don't get a
    whole day's worth of data (but only from midnight to now),
    a '-(partially)' is added (-] '2016-01-17-(partially)').

    If you request data for a specific month (-M, -L, -T), it will be
    the month (2016-01). For 'this month', where you don't get a whole
    month' worth of data (but only from the 1st to now), a '-(partially)'
    is added (-] '2016-01-(partially)').

    In any other case, it will be the exact timerange as time span
    like '[2016-01-17-10-00-00_2016-01-18-13-42-51]'
    Is 'csv' for csv files, 'xls' for Excel (if requested using -x)

Some filename examples:


(generic with -i)

(specific day)

(specific month)

Examples -h

Get the help screen -D

Fetch device information

Get data for the last hour -n 1800

Get data for the last half hour (= 1800s) -t

Get data since midnight until now -T

Get data since the 1st of the current month until now -y

Get data for yesterday -L

Get data for the last month -d 2016-02-17

Get data for February 17th 2016 -M 2016-02

Get data for February 2016 -s '2016-05-03 17:31:15' -e '2016-05-04 12:21:17'

Get data from 2016-05-03 17:31:15 to 2016-05-04 12:21:17 '2016-08-30 17:31:15'

Get data from 2016-08-30 17:31:15 until now