Parses HTTP requests from Ambient Weather Stations and exposes a prometheus metrics endpoint for scraping by a prometheus or VictoriaMetrics instance.
Does not implement all possible parameters from the Device Data Specs. Currently implements enough to support parameters from the WS-2000 including the indoor sensor and the addon temperature sensors. If anyone needs more parameters supported, it is trivial to add support.
-
Download a binary from the latest [Release][release] if you use arm 32 bit (raspberry pi)
curl -O https://github.com/tedpearson/weather2influxdb/releases/download/v1.1.0/ambientweatherexporter-linux-arm
-
Make the binary executable
chmod +x ambientweatherexporter-linux-arm
-
If your architecture is not avaialable, you'll need to build from source:
- Clone this repo
- Install Go
-
cd ambientweatherexporter go build
./ambientweatherexporter --port 1234 --station-name "your station"
Arguments:
--port
port to listen for ambient weather requests and prometheus scrapes--station-name
the name of your weather station, which will populate the "name" label in the time series.-v
run./ambientweatherexporter -v
to see the version and build information.
- Check the version of firmware and wifi firmware by following these instructions. Your firmware needs to be 1.6.9 or later, with wifi firmware 4.2.8 or later.
- Upgrade firmware if necessary:
- Update hardware firmware using a MicroSD card
- Update wifi firmware using the awnet mobile app
- The WS-2000 will automatically show up in the awnet app, you don't need to press any of the weather station types that show up.
- You must be connected to the same network and not be using something like UniFi's device isolation setting or it won't work.
- Configure the WS-2000 to send data to your server
- Go into Setup > Weather Server
- Select Customized > Setup and go into it
- Change State to Enable
- Protocol type should be Same as AMBWeather
- Put your IP/hostname and port
- Choose whatever interval you want reports. You can scrape the metrics endpoint at whatever interval you desire as well.
- Leave the path as "/data/report/"
- All done! Go hit
http://yourip:port/metrics
and you should see your data!