Home Assistant n8n Workflow: NASA APOD & Near-Earth Asteroid
Home Assistant n8n Workflow: NASA APOD & Near-Earth Asteroid
Regular price
£18.99
Regular price
£18.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
Home Assistant n8n Workflow: NASA APOD & Near-Earth Asteroid
Regular price
£18.99
Regular price
£18.99
Sale price
Unit price
/
per
Bring NASA’s latest space discoveries into your Home Assistant—automatically
This Home Assistant n8n Workflow fetches NASA’s Astronomy Picture of the Day (APOD) and the closest near-Earth asteroid from NASA’s NEO feed, then upserts both as sensor entities in Home Assistant for dashboard viewing.
What this workflow does
- Runs daily at 6:00 AM (or you can start it manually via a manual trigger).
- Calls the NASA APOD API to retrieve today’s picture metadata, including thumbnail URLs for video content.
-
Formats and upserts APOD data to Home Assistant as
sensor.nasa_apod—including title, date, media type, image/thumbnail URL, and a NASA explanation capped to a configurable `280-character` length. - Calls NASA’s Near-Earth Object (NEO) feed for a rolling 3-day window starting today.
- Flattens, sorts, and selects the nearest asteroid by miss distance, then extracts key fields such as distance, size, speed, a hazard flag, and the total count of matched close-approach entries.
-
Upserts the nearest-asteroid details to Home Assistant as
sensor.nasa_asteroid.
Use cases
- Daily dashboards showing NASA APOD with a fresh image/thumbnail and short explanation.
- Home Assistant screens for near-Earth asteroid awareness—always highlighting the closest object from the next few days.
- Automation engineers and SaaS operators demonstrating reliable API-to-home dashboard patterns in n8n.
Technical details
- Nodes/tech stack: set, code, sticky note, http request, home assistant, manual trigger.
-
NASA authentication: add a NASA API key from
https://api.nasa.govas an HTTP Query Auth credential (e.g.,api_key), used by both NASA HTTP requests. - Home Assistant authentication: configure a Home Assistant API credential (base URL + long-lived access token) and select it in both Home Assistant upsert steps.
-
Configurable: schedule time, asteroid look-ahead window end date, APOD explanation length, and target entity IDs (
sensor.nasa_apod,sensor.nasa_asteroid).
