Extract weather data from any weatherXM station via api calls in Home Assistant.
- weather condition (sunny, cloudy, partly cloudy, rainy).
- temperature
- temperature real feel
- humidity
- wind speed km/h - m/h
- wind gust km/h - m/h
- pressure hpa
- wind direction
- wind direction cardinal
- precipitation
- uv_index
- icon
- icon color
- navigate to WeatheXM Explorer.
- pick the station you want.
- in the website url copy the highlighted text after the # (in yellow).
-
replace the (*****) with the text you copied.
https://api.weatherxm.com/api/v1/cells/*****/devices
we need this url for the api call.
-
now paste the folowing code to your sensors.yaml and replace the url in line 3 with yours.
(If you don't already have sensos.yaml file, then create it in the
/config/
directory using your File editor. -
make sure you add this line to your configuration.yaml:
!include sensors.yaml
-
if the station you want is the second one in the HEX, then change the [0] with [1] in line 6.
-
restart Home assistant and you're done, now weather station data is avalible in your home assistant and you're free to use it.
Big portion of the code was inpired by arcidodo Thanks to him, link to his repo.