Home-AssistantConfig/config/packages/space.yaml

43 lines
1.1 KiB
YAML
Raw Normal View History

2018-01-02 00:00:45 +00:00
#-------------------------------------------
# Space Related Packages
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
#-------------------------------------------
2018-01-02 00:00:45 +00:00
sensor:
2020-07-11 15:26:42 +00:00
- 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'
2018-01-02 00:00:45 +00:00
automation:
- alias: Launch Window Approaching
2020-07-20 18:33:03 +00:00
id: 1d42fc4f-a37d-4283-b64b-09242a145598
2018-01-02 00:00:45 +00:00
trigger:
2020-07-11 19:01:53 +00:00
- platform: template
value_template: '{{ (now().strftime("%s") | int + 600) == (states.sensor.spacex.state | int) }}'
2018-01-02 00:00:45 +00:00
action:
- service: script.notify_engine
data:
2020-07-11 19:01:53 +00:00
value1: 'Go Outside! There is a Rocket Launch very soon! {{states.sensor.next_launch.attributes.stream }}'
group: 'information'
2018-01-02 00:00:45 +00:00