ha-noaa-space-weather/feeder
Cyberes 122bf365d9 add instructions for map on ha dashboard 2024-09-04 17:13:18 -06:00
..
lib fix timezone 2024-09-03 17:54:07 -06:00
systemd adjust image size 2024-09-04 17:00:24 -06:00
README.md add instructions for map on ha dashboard 2024-09-04 17:13:18 -06:00
cache.py get working 2024-09-03 17:09:36 -06:00
global-image.py fix timezone 2024-09-03 17:54:07 -06:00
mqtt.py wowee 2024-09-03 17:21:14 -06:00
requirements.txt fix timezone 2024-09-03 17:54:07 -06:00
server.py adjust image size 2024-09-04 17:00:24 -06:00

README.md

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.

Install

  1. Create an account at https://urs.earthdata.nasa.gov
  2. pip install -r requirements.txt
  3. sudo apt-get install p7zip-full redis-server
  4. sudo apt-get install dvipng texlive-latex-extra texlive-fonts-recommended cm-super
  5. sudo systemctl enable --now redis-server

Google Chrome

If you don't have Google Chrome installed (used to log into the NASA site), here's how to install it.

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt install ./google-chrome-stable_current_amd64.deb

Run

The lat/lon range is used to pick the region of the planet for generating statistics, for example your home state. To

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> \
CDDIS_USERNAME=<username> CDDIS_PASSWORD=<password> \
MQTT_BROKER_HOST="<Home Assistant IP>" MQTT_BROKER_PORT=1883 MQTT_USERNAME="user" MQTT_PASSWORD="<password>" \
python3 mqtt.py

Example systemd service files are provided.

Home Assistant MQTT Config

mqtt:
  - state_topic: "space-weather/vtec"
    name: "VTEC"
    unit_of_measurement: "(10^16 el) / m^2"
    state_class: measurement
    unique_id: space_weather_vtec

Data

VTEC

https://www.spaceweather.gov/products/us-total-electron-content

Unit: (10^16 el) / m^2

VTEC, or Vertical TEC, is a specific type of TEC measurement that is taken along a path extending vertically from the Earth's surface to the edge of the atmosphere. So essentially, VTEC is a subset of TEC, with the difference lying in the specific path along which the measurement is taken.

Updated hourly.

Home Assistant Dashboard

Global VTEC Map

  1. Enable the Generic Camera integration.
  2. Set the Still Image URL to http://[server IP]:5000/global
  3. Set the Frame Rate (Hz) to 0.0016666666666667 (sets it to a 10 minute refresh rate).
  4. Create this card on the dashboard:
    type: picture-entity
    entity: camera.[your entity name]
    show_state: false
    show_name: false
    camera_view: auto