From 922c62657b41698755dc1a1485196f055cadc2eb Mon Sep 17 00:00:00 2001 From: Cyberes Date: Fri, 16 Aug 2024 23:38:59 -0600 Subject: [PATCH] improve readme --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++- service/vtec.service | 2 +- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e38915a..ed7a362 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,56 @@ # ha-noaa-space-weather-sensor -MQTT sensor to send NOAA space weather data to Home Assistant. \ No newline at end of file +*MQTT sensor to send NOAA space weather data to Home Assistant.* + +## Install + +1. Create an account at +2. `pip install -r requirements.txt` +3. `sudo apt install p7zip-full` + +### Google Chrome + +If you don't have Google Chrome installed (used to log into the NASA site), here's how to install it. + +```shell +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 + +```shell +LAT_RANGE_MIN= \ +LAT_RANGE_MAX= \ +LON_RANGE_MIN= \ +LON_RANGE_MAX= \ +CDDIS_USERNAME= CDDIS_PASSWORD= \ +MQTT_BROKER_HOST="" MQTT_BROKER_PORT=1883 MQTT_USERNAME="user" MQTT_PASSWORD="" \ +python3 main.py +``` + +An example systemd service file is provided. + +### Home Assistant MQTT Config + +```yaml +- 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 + + + +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. \ No newline at end of file diff --git a/service/vtec.service b/service/vtec.service index a393f7e..fcca715 100644 --- a/service/vtec.service +++ b/service/vtec.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=homeassistant EnvironmentFile=/etc/secrets/space-weather -ExecStart=/srv/space-weather/venv/bin/python /srv/space-weather/ha-noaa-space-weather-sensor/main.py +ExecStart=/srv/space-weather/ha-noaa-space-weather-sensor/venv/bin/python /srv/space-weather/ha-noaa-space-weather-sensor/main.py Restart=on-failure RestartSec=5s