2024-09-04 17:13:18 -06:00
|
|
|
This is an MQTT sensor to send NOAA space weather data to Home Assistant. Fetching the data requires a login to NASA's
|
|
|
|
EarthData which is done through Selenium and the Chrome browser.
|
2024-08-18 15:38:47 -06:00
|
|
|
|
2024-09-04 17:20:22 -06:00
|
|
|
![](dashboard/dashboard.png)
|
|
|
|
|
2024-08-18 15:38:47 -06:00
|
|
|
## Install
|
|
|
|
|
|
|
|
1. Create an account at <https://urs.earthdata.nasa.gov>
|
|
|
|
2. `pip install -r requirements.txt`
|
2024-11-06 12:59:52 -07:00
|
|
|
3. `sudo apt-get install redis-server`
|
|
|
|
4. `sudo systemctl enable --now redis-server`
|
2024-08-18 15:38:47 -06:00
|
|
|
|
|
|
|
## Run
|
|
|
|
|
|
|
|
The lat/lon range is used to pick the region of the planet for generating statistics, for example your home state. To
|
|
|
|
|
|
|
|
```shell
|
|
|
|
LAT_RANGE_MIN=<lower range for lat bounding box> \
|
|
|
|
LAT_RANGE_MAX=<upper range for lat bounding box> \
|
|
|
|
LON_RANGE_MIN=<lower range for lon bounding box> \
|
|
|
|
LON_RANGE_MAX=<upper range for lon bounding box> \
|
|
|
|
MQTT_BROKER_HOST="<Home Assistant IP>" MQTT_BROKER_PORT=1883 MQTT_USERNAME="user" MQTT_PASSWORD="<password>" \
|
2024-09-03 16:37:39 -06:00
|
|
|
python3 mqtt.py
|
2024-08-18 15:38:47 -06:00
|
|
|
```
|
|
|
|
|
2024-09-03 16:37:39 -06:00
|
|
|
Example systemd service files are provided.
|
2024-08-18 15:38:47 -06:00
|
|
|
|
|
|
|
### Home Assistant MQTT Config
|
|
|
|
|
|
|
|
```yaml
|
2024-11-06 12:59:52 -07:00
|
|
|
- state_topic: "space-weather/glotec"
|
|
|
|
name: "GloTEC"
|
|
|
|
unit_of_measurement: "(10^16) / m^-2"
|
|
|
|
state_class: measurement
|
|
|
|
unique_id: space_weather_glotec
|
2024-08-18 15:38:47 -06:00
|
|
|
```
|
|
|
|
|
|
|
|
## Data
|
|
|
|
|
2024-11-06 12:59:52 -07:00
|
|
|
### GloTEC
|
2024-08-18 15:38:47 -06:00
|
|
|
|
2024-11-06 12:59:52 -07:00
|
|
|
<https://www.swpc.noaa.gov/experimental/glotec>
|
2024-08-18 15:38:47 -06:00
|
|
|
|
2024-11-06 12:59:52 -07:00
|
|
|
Unit: `(10^16) / m^-2`
|
2024-08-18 15:38:47 -06:00
|
|
|
|
2024-09-04 17:20:22 -06:00
|
|
|
Updated hourly.
|