Skip to content

bentasker/Ecowitt_to_InfluxDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ecowitt Listener

Small docker image to receive writes from weather stations using Ecowitt protocol and write the data into an upstream InfluxDB instance (OSS, Enterprise or Cloud).


Examples

Writing into InfluxCloud

docker run -d \
-p 8090:8090 \
-e INFLUX_URL="https://eu-central-1-1.aws.cloud2.influxdata.com" \
-e INFLUX_ORG="myaddress@example.invalid" \
-e INLUX_TOKEN="====" \
-e INFLUX_BUCKET="weather" \
bentasker12/ecowitt_listener

Writing into an unauthenticated Influx 1.x instance

docker run -d \
-p 8090:8090 \
-e INFLUX_URL="http://myinfluxinstance:8086" \
-e INFLUX_BUCKET="weather" \
bentasker12/ecowitt_listener

Writing into an authenticated Influx 1.x instance

docker run -d \
-p 8090:8090 \
-e INFLUX_URL="http://myinfluxinstance:8086" \
-e INFLUX_BUCKET="weather" \
-e INLUX_TOKEN="ben:secretpassword" \
bentasker12/ecowitt_listener

Writing into an OSS 2.x instance

docker run -d \
-p 8090:8090 \
-e INFLUX_URL="http://myinfluxinstance:8086" \
-e INFLUX_ORG="myaddress@example.invalid" \
-e INLUX_TOKEN="====" \
-e INFLUX_BUCKET="weather" \
bentasker12/ecowitt_listener

Configuration Options

The default configuration is set to suit me, so may not suit you.

The following environment variables can be exported to control behaviour

  • IGNORE: Which fields in the input should be skipped (default: "PASSKEY,stationtype,dateutc,freq")
  • TAGS: Which fields in the input should be converted to tags (default: "model")
  • MEASUREMENT: Name of the measurement to write into (default: "weather")
  • DEBUG: Set non-empty to enable debugging
  • RAIN_MM: Convert rain from Inches to MM (Default: "yes")
  • PRESSURE_HPA: Convert pressure readings to HPA (Default: "yes")
  • TEMP_C: Convert temperature readings to Centigrade (Default: "yes")
  • SPEED_KPH: Convert speed to KPH (Default: "no")

Fields

The name of some fields seems to differ between device.

  • wh[num]bat (e.g. wh65batt) - battery status (apparently, 0 = OK, 1 = low)
  • totalrainin/totalrainmm: Total rain recorded in inches/mm
  • yearlyrainin/yearlyrainmm: Total rain recorded in inches/mm this year
  • monthlyrainin/monthlyrainmm: Total rain recorded in inches/mm this month
  • weeklyrainin/weeklyrainmm: Total rain recorded in inches/mm this week
  • dailyrainin/dailyrainmm: Total rain recorded in inches/mm today
  • hourlyrainin/hourlyrainmm: Total rain recorded in inches/mm in this hour
  • eventrainin/eventrainmm: Total rain recorded in inches/mm in the most recent shower
  • rainratein/rainratemm: Current rainfall rate in inches/mm
  • uv: UV index
  • solarradiation: Solar radiation (w/m2)
  • maxdailygust / maxdailygustkph: Maximum wind gust speed today (MPH/KPH)
  • windgustmph / windgustkph: Gust speed (MPH/KPH)
  • windspeedmph / windspeedkph: Wind speed (MPH/KPH)
  • winddir: Wind direction (degrees)
  • humidity: Outside humidity (%)
  • tempf / tempc: Outside temperature (F/C)
  • baromrelin / baromrelhpa: Relative pressure (inches/hpa)
  • baromabsin / baromabshpa: Absolute pressure (inches/hpa)
  • humidityin: Inside humidity (%)
  • tempinf / tempinc: Inside temperature (F/C)

Tags

Tags added are

  • model: The model number submitted by the downstream
  • submitted_by: The IP address of the unit writing stats in

Fields can be converted to tags by including their name in the environment variable TAGS.


Met Office Integration

The tool can also forward reports onwar into the Met Office's Weather Observations Website (WOW) service

If you wish to use this, you need to set the following environment variables

-e MET_OFFICE_WOW_ENABLED="yes" \
-e MET_OFFICE_SITE_ID="" \
-e MET_OFFICE_SITE_PIN=""

Your site ID is a uuid (something like ffffffff-aaaa-1111-cccc-kkkkkkkk). The PIN is whatever you put in the field Authentication Key when setting up the site.


Examples and more

There's a post at https://www.bentasker.co.uk/posts/blog/house-stuff/receiving-weather-info-from-ecowitt-weather-station-and-writing-to-influxdb.html which gives more detail on how to stand this up, as well as integrate it with WOW


License

Copyright (c) 2022 Ben Tasker.

Released under BSD-3-Clause