Skip to content

Use the SensorPush API to save temperature, humidity, dewpoint, barometric pressure, altitude and VPD data to a local InfluxDB database

License

Notifications You must be signed in to change notification settings

mzaran-altius/SensorPush

 
 

Repository files navigation

SensorPush

SensorPush recently introduced a API to query the temperature and humidity samples recorded by their smart sensors via G1 WIFI GATEWAY - As long as the API is in beta stage, you have to contact support to get access!

This Python 3 tool can query the API and save the temperature and humidity time series to InfluxDB so it can easily be plotted with Grafana.

If you don't have an G1 WIFI Gateway and still want to plot your temperature, you can us another little tool I wrote to feed the CSV file which you can export via the Android App to InfluxDB.

Grafana

API query

# sensorpush.py --help
usage: sensorpush.py [-h] [-s STARTTIME] [-p STOPTIME] [-b BACKLOG]
                     [-t TIMESTEP] [-q QLIMIT] [-d DELAY] [-l] [-g]
                     [-i SENSORLIST [SENSORLIST ...]] [-n] [-x]

Queries SensorPus API and stores the temp and humidity readings in InfluxDB

optional arguments:
  -h, --help            show this help message and exit
  -s STARTTIME, --start STARTTIME
                        start query at time (e.g. "2019-07-25T00:10:41+0200")
  -p STOPTIME, --stop STOPTIME
                        Stop query at time (e.g. "2019-07-26T00:10:41+0200")
  -b BACKLOG, --backlog BACKLOG
                        Historical data to fetch (default 1 day) - time can be
                        specified in the format <number>[m|h|d|w|M|Y]. E.g.:
                        10 Minutes = 10m, 1 day = 1d, 1 month = 1M
  -t TIMESTEP, --timestep TIMESTEP
                        Time slice per query (in minutes) to fetch (default
                        720 minutes [12 h])
  -q QLIMIT, --querylimit QLIMIT
                        Number of samples to return per sensor (default unset
                        = API default limimt [10])
  -d DELAY, --delay DELAY
                        Delay in seconds between queries
  -l, --listsensors     Show a list of sensors and exit
  -g, --listgateways    Show a list of gateways and exit
  -i SENSORLIST [SENSORLIST ...], --sensorlist SENSORLIST [SENSORLIST ...]
                        List of sensor IDs to query
  -n, --noconvert       Do not convert °F to °C, inHG to mBar, kPa to mBar and feet
                        to meters
  -x, --dryrun          Do not write anything to the database, just print what
                        would have been written

CSV import

# sensorpush_csv-import.py --help
usage: sensorpush_csv-import.py [-h] [-f CSVFILE] [-s SENSORNAME]
                                [-i SENSORID] [-d] [-c CHUNKS]

Reads a CSV file exported from the SensorPush Android App and stores the temp
and humidity readings in InfluxDB

optional arguments:
  -h, --help            show this help message and exit
  -f CSVFILE, --csvfile CSVFILE
                        CSV file exported from the SensorPush Android App
  -s SENSORNAME, --sensorname SENSORNAME
                        Sensor name
  -i SENSORID, --sensorid SENSORID
                        Sensor id
  -d, --dryrun          Do not write anything to InfluxDB - just print what
                        would have been written
  -c CHUNKS, --chunks CHUNKS
                        Write data in chunks to InfluxDB to not overload e.g.
                        a RaspberryPi

About

Use the SensorPush API to save temperature, humidity, dewpoint, barometric pressure, altitude and VPD data to a local InfluxDB database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%