Files
Home-AssistantConfig/config/packages/space.yaml
Carlo Costanzo 314d5d47aa Enhance automation configurations and documentation
- Updated dark_rainy_day.yaml to improve weather-related light automation with a more robust trigger mapping.
- Refined docker_infrastructure.yaml to include a 20-minute escalation for persistent container outages and updated related documentation.
- Revised onenote_indexer.yaml to clarify daily maintenance request details and improve communication style.
- Enhanced space.yaml to track SpaceX launches with improved trigger logic and messaging.
- Updated README.md and script documentation to reflect new features and automation enhancements.
2026-03-18 10:47:23 -04:00

50 lines
1.8 KiB
YAML
Executable File

######################################################################
# @CCOSTAN - Follow Me on X
# For more info visit https://www.vcloudinfo.com/click-here
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# Space - ISS and launch-related telemetry
# Tracks SpaceX timing and announces an upcoming launch window.
# -------------------------------------------------------------------
# Notes: Guard template triggers against unavailable startup sensor state.
######################################################################
sensor:
- platform: rest
scan_interval: 1800
name: SpaceX Starman
json_attributes:
- earth_distance_mi
value_template: '{{ value_json["speed_mph"] }}'
unit_of_measurement: "mph"
resource: 'https://api.spacexdata.com/v2/info/roadster'
- platform: rest
scan_interval: 1800
name: SpaceX
json_attributes:
- mission_name
- launch_site
- rocket
value_template: '{{ value_json["launch_date_unix"] }}'
resource: 'https://api.spacexdata.com/v2/launches/next'
automation:
- alias: Launch Window Approaching
id: 1d42fc4f-a37d-4283-b64b-09242a145598
trigger:
- platform: template
value_template: >-
{% set launch_ts = states('sensor.spacex') | int(0) %}
{% set seconds_until = launch_ts - (now().timestamp() | int) %}
{{ launch_ts > 0 and seconds_until > 0 and seconds_until <= 600 }}
action:
- service: script.notify_engine
data:
value1: >-
{% set mission = state_attr('sensor.spacex', 'mission_name') | default('A SpaceX launch', true) %}
Go outside. {{ mission }} is scheduled to launch in about 10 minutes.
group: 'information'