A Home Assistant integration that tracks upcoming space launches from specific locations using The Space Devs API.
This integration will set up the following platforms:
| Platform | Description |
|---|---|
sensor |
Show upcoming space launch information with countdown attributes |
- Track upcoming launches from any launch location worldwide
- Rich attributes including mission details, rocket info, and launch pad data
- Built-in countdown calculations (days, hours, minutes until launch)
- Automatic updates every 6 hours (configurable)
- Default configured for Vandenberg Space Force Base
- Perfect for creating countdown badges and detailed launch cards
- Open HACS in Home Assistant
- Go to "Integrations"
- Click the three dots in the top right corner and select "Custom repositories"
- Add this repository URL and select "Integration" as category
- Click "Install" on the Space Launch Sensor integration
- Restart Home Assistant
- Using the tool of choice open the directory (folder) for your HA configuration (where you find
configuration.yaml) - If you do not have a
custom_componentsdirectory (folder) there, you need to create it - In the
custom_componentsdirectory (folder) create a new folder calledspace_launch_sensor - Download all the files from the
custom_components/space_launch_sensor/directory (folder) in this repository - Place the files you downloaded in the new directory (folder) you created
- Restart Home Assistant
Add to your configuration.yaml:
sensor:
- platform: space_launch_sensor
name: "My Space Launch Sensor"
launch_location_id: 11 # Vandenberg SFB (default)
scan_interval: 21600 # 6 hours (default: 6 hours)- name (optional): Custom name for the sensor
- launch_location_id (optional): Launch location ID from The Space Devs API (default: 11 for Vandenberg SFB)
- scan_interval (optional): Update frequency in seconds (default: 21600 = 6 hours)
To find launch location IDs, visit: https://ll.thespacedevs.com/2.2.0/location/ Popular locations:
- 11: Vandenberg SFB, CA, USA
- 12: Kennedy Space Center, FL, USA
- 16: Baikonur Cosmodrome, Kazakhstan
- 27: Mahia Peninsula, New Zealand (Rocket Lab)
- 143: Kourou, French Guiana (Ariane, Vega)
Choose your scan_interval based on your needs:
- 1800 (30 minutes): For frequent updates when launches are imminent
- 21600 (6 hours): Recommended default - good balance of freshness and API courtesy
- 86400 (24 hours): For minimal API usage when you just want daily updates
Example configurations:
# Frequent updates during active launch periods
sensor:
- platform: space_launch_sensor
name: "Active Launch Tracking"
launch_location_id: 12 # Kennedy Space Center
scan_interval: 1800 # 30 minutes
# Standard daily monitoring (recommended)
sensor:
- platform: space_launch_sensor
name: "Daily Launch Updates"
scan_interval: 21600 # 6 hoursThe sensor provides these attributes:
launch_id: Unique launch identifierstatus: Launch status (Go, TBD, etc.)net: No Earlier Than timestampwindow_start/window_end: Launch windowrocket: Full rocket namemission: Mission name and typelaunch_provider: Company conducting the launchlocation: Launch pad location and namemap_url: Link to launch pad locationinfo_url: Link to detailed launch informationimage_url: Mission patch or launch image
The sensor also calculates countdown information:
countdown_days: Days until launchcountdown_hours: Hours remaining (after days)countdown_minutes: Minutes remaining (after hours)countdown_display: Formatted countdown (e.g., "5d 8h" or "2h 30m")countdown_total_hours: Total time until launch in hours
Create a countdown badge that only appears when a launch is approaching:
# Add to configuration.yaml
template:
- sensor:
- name: "Launch Countdown Badge"
unique_id: "launch_countdown_badge"
state: "{{ state_attr('sensor.your_sensor_name', 'countdown_display') }}"
icon: >-
{% set days = state_attr('sensor.your_sensor_name', 'countdown_days') | int(0) %}
{% if days <= 1 %}
mdi:rocket-launch
{% elif days <= 7 %}
mdi:rocket
{% else %}
mdi:rocket-outline
{% endif %}
# Dashboard card
type: entity
entity: sensor.launch_countdown_badge
name: "🚀 Next Launch"
visibility:
- condition: template
value_template: "{{ states('sensor.launch_countdown_badge') not in ['Launched', 'Error', 'Unknown'] }}"type: entities
title: 🚀 Next Space Launch
entities:
- entity: sensor.your_sensor_name
name: Mission
icon: mdi:rocket
- type: attribute
entity: sensor.your_sensor_name
attribute: rocket
name: Rocket
icon: mdi:rocket-launch
- type: attribute
entity: sensor.your_sensor_name
attribute: status
name: Status
icon: mdi:clock-outline
- type: attribute
entity: sensor.your_sensor_name
attribute: countdown_display
name: Time Until Launch
icon: mdi:timer-outlineThis integration uses The Space Devs API for launch data.
If you want to contribute to this please read the Contribution guidelines
This integration was developed for the Home Assistant community.
