djtimca
(Tim)
October 8, 2020, 2:07pm
1
I might be a little space obsessed, but after putting out my SpaceX sensors integration, I figured I would like to also be aware of other non-SpaceX launches that I might get a chance to watch.
I released the first version of my Rocket Launch Live - Next 5 Launches integration last night at https://github.com/djtimca/harocketlaunchlive (compatible with HACS custom repository install).
This integration uses the free rocketlaunch.live API for the next 5 launches and currently adds 5 sensors (one for each launch) with a ton of information in the attributes for each launch. I expect to add launch warnings etc like in my SpaceX Integration but need to monitor the data for a bit to understand how/when it will come in.
Happy to get testing feedback and suggestions as well.
I am currently showing the launch info using the custom:button-card (from HACS) in my Lovelace with the following YAML:
type: vertical-stack
title: Next 5 Rocket Launches
cards:
- type: 'custom:button-card'
entity: sensor.rocket_launch_1
show_name: false
show_state: true
show_icon: false
layout: icon_state
styles:
card:
- font-size: 12px
- padding: 10px
grid:
- grid-template-areas: >-
"s" "provider" "vehicle" "launch_pad" "location" "target_date"
"tags"
- grid-template-columns: 1fr
- grid-template-rows: 1fr min-content min-content min-content
state:
- font-weight: bold
- font-size: 16px
- align-self: start
- justify-self: start
custom_fields:
provider:
- align-self: start
- justify-self: start
vehicle:
- align-self: start
- justify-self: start
launch_pad:
- align-self: start
- justify-self: start
location:
- align-self: start
- justify-self: start
target_date:
- align-self: start
- justify-self: start
tags:
- align-self: start
- justify-self: start
custom_fields:
provider: |
[[[
return `Provider: ${states['sensor.rocket_launch_1'].attributes["provider"]}`
]]]
vehicle: |
[[[
return `Vehicle: ${states['sensor.rocket_launch_1'].attributes['vehicle']}`
]]]
launch_pad: |
[[[
return `Launch Pad: ${states['sensor.rocket_launch_1'].attributes['launch_pad']}`
]]]
location: |
[[[
return `Location: ${states['sensor.rocket_launch_1'].attributes['launch_location']}`
]]]
target_date: |
[[[
return `Target Date: ${states['sensor.rocket_launch_1'].attributes['launch_date_target']}`
]]]
tags: |
[[[
return `Tags: ${states['sensor.rocket_launch_1'].attributes['tags']}`
]]]
- type: 'custom:button-card'
entity: sensor.rocket_launch_2
show_name: false
show_state: true
show_icon: false
layout: icon_state
styles:
card:
- font-size: 12px
- padding: 10px
grid:
- grid-template-areas: >-
"s" "provider" "vehicle" "launch_pad" "location" "target_date"
"tags"
- grid-template-columns: 1fr
- grid-template-rows: 1fr min-content min-content min-content
state:
- font-weight: bold
- font-size: 16px
- align-self: start
- justify-self: start
custom_fields:
provider:
- align-self: start
- justify-self: start
vehicle:
- align-self: start
- justify-self: start
launch_pad:
- align-self: start
- justify-self: start
location:
- align-self: start
- justify-self: start
target_date:
- align-self: start
- justify-self: start
tags:
- align-self: start
- justify-self: start
custom_fields:
provider: |
[[[
return `Provider: ${states['sensor.rocket_launch_2'].attributes["provider"]}`
]]]
vehicle: |
[[[
return `Vehicle: ${states['sensor.rocket_launch_2'].attributes['vehicle']}`
]]]
launch_pad: |
[[[
return `Launch Pad: ${states['sensor.rocket_launch_2'].attributes['launch_pad']}`
]]]
location: |
[[[
return `Location: ${states['sensor.rocket_launch_2'].attributes['launch_location']}`
]]]
target_date: |
[[[
return `Target Date: ${states['sensor.rocket_launch_2'].attributes['launch_date_target']}`
]]]
tags: |
[[[
return `Tags: ${states['sensor.rocket_launch_2'].attributes['tags']}`
]]]
- type: 'custom:button-card'
entity: sensor.rocket_launch_3
show_name: false
show_state: true
show_icon: false
layout: icon_state
styles:
card:
- font-size: 12px
- padding: 10px
grid:
- grid-template-areas: >-
"s" "provider" "vehicle" "launch_pad" "location" "target_date"
"tags"
- grid-template-columns: 1fr
- grid-template-rows: 1fr min-content min-content min-content
state:
- font-weight: bold
- font-size: 16px
- align-self: start
- justify-self: start
custom_fields:
provider:
- align-self: start
- justify-self: start
vehicle:
- align-self: start
- justify-self: start
launch_pad:
- align-self: start
- justify-self: start
location:
- align-self: start
- justify-self: start
target_date:
- align-self: start
- justify-self: start
tags:
- align-self: start
- justify-self: start
custom_fields:
provider: |
[[[
return `Provider: ${states['sensor.rocket_launch_3'].attributes["provider"]}`
]]]
vehicle: |
[[[
return `Vehicle: ${states['sensor.rocket_launch_3'].attributes['vehicle']}`
]]]
launch_pad: |
[[[
return `Launch Pad: ${states['sensor.rocket_launch_3'].attributes['launch_pad']}`
]]]
location: |
[[[
return `Location: ${states['sensor.rocket_launch_3'].attributes['launch_location']}`
]]]
target_date: |
[[[
return `Target Date: ${states['sensor.rocket_launch_3'].attributes['launch_date_target']}`
]]]
tags: |
[[[
return `Tags: ${states['sensor.rocket_launch_3'].attributes['tags']}`
]]]
- type: 'custom:button-card'
entity: sensor.rocket_launch_4
show_name: false
show_state: true
show_icon: false
layout: icon_state
styles:
card:
- font-size: 12px
- padding: 10px
grid:
- grid-template-areas: >-
"s" "provider" "vehicle" "launch_pad" "location" "target_date"
"tags"
- grid-template-columns: 1fr
- grid-template-rows: 1fr min-content min-content min-content
state:
- font-weight: bold
- font-size: 16px
- align-self: start
- justify-self: start
custom_fields:
provider:
- align-self: start
- justify-self: start
vehicle:
- align-self: start
- justify-self: start
launch_pad:
- align-self: start
- justify-self: start
location:
- align-self: start
- justify-self: start
target_date:
- align-self: start
- justify-self: start
tags:
- align-self: start
- justify-self: start
custom_fields:
provider: |
[[[
return `Provider: ${states['sensor.rocket_launch_4'].attributes["provider"]}`
]]]
vehicle: |
[[[
return `Vehicle: ${states['sensor.rocket_launch_4'].attributes['vehicle']}`
]]]
launch_pad: |
[[[
return `Launch Pad: ${states['sensor.rocket_launch_4'].attributes['launch_pad']}`
]]]
location: |
[[[
return `Location: ${states['sensor.rocket_launch_4'].attributes['launch_location']}`
]]]
target_date: |
[[[
return `Target Date: ${states['sensor.rocket_launch_4'].attributes['launch_date_target']}`
]]]
tags: |
[[[
return `Tags: ${states['sensor.rocket_launch_4'].attributes['tags']}`
]]]
- type: 'custom:button-card'
entity: sensor.rocket_launch_5
show_name: false
show_state: true
show_icon: false
layout: icon_state
styles:
card:
- font-size: 12px
- padding: 10px
grid:
- grid-template-areas: >-
"s" "provider" "vehicle" "launch_pad" "location" "target_date"
"tags"
- grid-template-columns: 1fr
- grid-template-rows: 1fr min-content min-content min-content
state:
- font-weight: bold
- font-size: 16px
- align-self: start
- justify-self: start
custom_fields:
provider:
- align-self: start
- justify-self: start
vehicle:
- align-self: start
- justify-self: start
launch_pad:
- align-self: start
- justify-self: start
location:
- align-self: start
- justify-self: start
target_date:
- align-self: start
- justify-self: start
tags:
- align-self: start
- justify-self: start
custom_fields:
provider: |
[[[
return `Provider: ${states['sensor.rocket_launch_5'].attributes["provider"]}`
]]]
vehicle: |
[[[
return `Vehicle: ${states['sensor.rocket_launch_5'].attributes['vehicle']}`
]]]
launch_pad: |
[[[
return `Launch Pad: ${states['sensor.rocket_launch_5'].attributes['launch_pad']}`
]]]
location: |
[[[
return `Location: ${states['sensor.rocket_launch_5'].attributes['launch_location']}`
]]]
target_date: |
[[[
return `Target Date: ${states['sensor.rocket_launch_5'].attributes['launch_date_target']}`
]]]
tags: |
[[[
return `Tags: ${states['sensor.rocket_launch_5'].attributes['tags']}`
]]]
1 Like
Jefe
(Jeff)
October 9, 2020, 12:04am
2
Tim,
Great work! Looks like another fine launch integration and cards. Can’t wait to install it tomorrow. Thanks!
1 Like
djtimca
(Tim)
October 15, 2020, 2:33pm
3
Released version 002 which allows you to enter a paid API key during setup (you can register/subscribe at https://rocketlaunch.live for minimum $3USD per month).
Adds new attributes to each launch:
launch_media_link - YouTube watch link for the launch (premium only)
launch_target - Target launch date/time in your Home Assistant local time
launch_target_timestamp - Target launch date/time in UNIX timestamp
launch_24h_warning - true/false if the launch is within the next 24 hours
launch_20m_warning - true/false if the launch is within the next 20 minutes
I updated my cards to show the updated launch target date (in Home Assistant local time) and to flip the cards yellow and red if the launch is within 24 hours or 20 minutes (new warnings added). If you have a premium account you could also include the media link to the card. Updated cards (without the media link) are below:
type: vertical-stack
title: Next 5 Rocket Launches
cards:
- type: 'custom:button-card'
entity: sensor.rocket_launch_1
show_name: false
show_state: true
show_icon: false
layout: icon_state
styles:
card:
- font-size: 12px
- padding: 10px
- background-color: |
[[[
if (states['sensor.rocket_launch_1'].attributes['launch_24h_warning'] == "true")
return "yellow";
else if (states['sensor.rocket_launch_1'].attributes['launch_20m_warning'] == "true")
return "red";
]]]
grid:
- grid-template-areas: >-
"s" "provider" "vehicle" "launch_pad" "location" "target_date"
"tags"
- grid-template-columns: 1fr
- grid-template-rows: 1fr min-content min-content min-content
state:
- font-weight: bold
- font-size: 16px
- align-self: start
- justify-self: start
custom_fields:
provider:
- align-self: start
- justify-self: start
vehicle:
- align-self: start
- justify-self: start
launch_pad:
- align-self: start
- justify-self: start
location:
- align-self: start
- justify-self: start
target_date:
- align-self: start
- justify-self: start
tags:
- align-self: start
- justify-self: start
custom_fields:
provider: |
[[[
return `Provider: ${states['sensor.rocket_launch_1'].attributes["provider"]}`
]]]
vehicle: |
[[[
return `Vehicle: ${states['sensor.rocket_launch_1'].attributes['vehicle']}`
]]]
launch_pad: |
[[[
return `Launch Pad: ${states['sensor.rocket_launch_1'].attributes['launch_pad']}`
]]]
location: |
[[[
return `Location: ${states['sensor.rocket_launch_1'].attributes['launch_location']}`
]]]
target_date: |
[[[
return `Target Date: ${states['sensor.rocket_launch_1'].attributes['launch_target']}`
]]]
tags: |
[[[
return `Tags: ${states['sensor.rocket_launch_1'].attributes['tags']}`
]]]
- type: 'custom:button-card'
entity: sensor.rocket_launch_2
show_name: false
show_state: true
show_icon: false
layout: icon_state
styles:
card:
- font-size: 12px
- padding: 10px
- background-color: |
[[[
if (states['sensor.rocket_launch_2'].attributes['launch_24h_warning'] == "true")
return "yellow";
else if (states['sensor.rocket_launch_2'].attributes['launch_20m_warning'] == "true")
return "red";
]]]
grid:
- grid-template-areas: >-
"s" "provider" "vehicle" "launch_pad" "location" "target_date"
"tags"
- grid-template-columns: 1fr
- grid-template-rows: 1fr min-content min-content min-content
state:
- font-weight: bold
- font-size: 16px
- align-self: start
- justify-self: start
custom_fields:
provider:
- align-self: start
- justify-self: start
vehicle:
- align-self: start
- justify-self: start
launch_pad:
- align-self: start
- justify-self: start
location:
- align-self: start
- justify-self: start
target_date:
- align-self: start
- justify-self: start
tags:
- align-self: start
- justify-self: start
custom_fields:
provider: |
[[[
return `Provider: ${states['sensor.rocket_launch_2'].attributes["provider"]}`
]]]
vehicle: |
[[[
return `Vehicle: ${states['sensor.rocket_launch_2'].attributes['vehicle']}`
]]]
launch_pad: |
[[[
return `Launch Pad: ${states['sensor.rocket_launch_2'].attributes['launch_pad']}`
]]]
location: |
[[[
return `Location: ${states['sensor.rocket_launch_2'].attributes['launch_location']}`
]]]
target_date: |
[[[
return `Target Date: ${states['sensor.rocket_launch_2'].attributes['launch_target']}`
]]]
tags: |
[[[
return `Tags: ${states['sensor.rocket_launch_2'].attributes['tags']}`
]]]
- type: 'custom:button-card'
entity: sensor.rocket_launch_3
show_name: false
show_state: true
show_icon: false
layout: icon_state
styles:
card:
- font-size: 12px
- padding: 10px
- background-color: |
[[[
if (states['sensor.rocket_launch_3'].attributes['launch_24h_warning'] == "true")
return "yellow";
else if (states['sensor.rocket_launch_3'].attributes['launch_20m_warning'] == "true")
return "red";
]]]
grid:
- grid-template-areas: >-
"s" "provider" "vehicle" "launch_pad" "location" "target_date"
"tags"
- grid-template-columns: 1fr
- grid-template-rows: 1fr min-content min-content min-content
state:
- font-weight: bold
- font-size: 16px
- align-self: start
- justify-self: start
custom_fields:
provider:
- align-self: start
- justify-self: start
vehicle:
- align-self: start
- justify-self: start
launch_pad:
- align-self: start
- justify-self: start
location:
- align-self: start
- justify-self: start
target_date:
- align-self: start
- justify-self: start
tags:
- align-self: start
- justify-self: start
custom_fields:
provider: |
[[[
return `Provider: ${states['sensor.rocket_launch_3'].attributes["provider"]}`
]]]
vehicle: |
[[[
return `Vehicle: ${states['sensor.rocket_launch_3'].attributes['vehicle']}`
]]]
launch_pad: |
[[[
return `Launch Pad: ${states['sensor.rocket_launch_3'].attributes['launch_pad']}`
]]]
location: |
[[[
return `Location: ${states['sensor.rocket_launch_3'].attributes['launch_location']}`
]]]
target_date: |
[[[
return `Target Date: ${states['sensor.rocket_launch_3'].attributes['launch_target']}`
]]]
tags: |
[[[
return `Tags: ${states['sensor.rocket_launch_3'].attributes['tags']}`
]]]
- type: 'custom:button-card'
entity: sensor.rocket_launch_4
show_name: false
show_state: true
show_icon: false
layout: icon_state
styles:
card:
- font-size: 12px
- padding: 10px
- background-color: |
[[[
if (states['sensor.rocket_launch_4'].attributes['launch_24h_warning'] == "true")
return "yellow";
else if (states['sensor.rocket_launch_4'].attributes['launch_20m_warning'] == "true")
return "red";
]]]
grid:
- grid-template-areas: >-
"s" "provider" "vehicle" "launch_pad" "location" "target_date"
"tags"
- grid-template-columns: 1fr
- grid-template-rows: 1fr min-content min-content min-content
state:
- font-weight: bold
- font-size: 16px
- align-self: start
- justify-self: start
custom_fields:
provider:
- align-self: start
- justify-self: start
vehicle:
- align-self: start
- justify-self: start
launch_pad:
- align-self: start
- justify-self: start
location:
- align-self: start
- justify-self: start
target_date:
- align-self: start
- justify-self: start
tags:
- align-self: start
- justify-self: start
custom_fields:
provider: |
[[[
return `Provider: ${states['sensor.rocket_launch_4'].attributes["provider"]}`
]]]
vehicle: |
[[[
return `Vehicle: ${states['sensor.rocket_launch_4'].attributes['vehicle']}`
]]]
launch_pad: |
[[[
return `Launch Pad: ${states['sensor.rocket_launch_4'].attributes['launch_pad']}`
]]]
location: |
[[[
return `Location: ${states['sensor.rocket_launch_4'].attributes['launch_location']}`
]]]
target_date: |
[[[
return `Target Date: ${states['sensor.rocket_launch_4'].attributes['launch_target']}`
]]]
tags: |
[[[
return `Tags: ${states['sensor.rocket_launch_4'].attributes['tags']}`
]]]
- type: 'custom:button-card'
entity: sensor.rocket_launch_5
show_name: false
show_state: true
show_icon: false
layout: icon_state
styles:
card:
- font-size: 12px
- padding: 10px
- background-color: |
[[[
if (states['sensor.rocket_launch_5'].attributes['launch_24h_warning'] == "true")
return "yellow";
else if (states['sensor.rocket_launch_5'].attributes['launch_20m_warning'] == "true")
return "red";
]]]
grid:
- grid-template-areas: >-
"s" "provider" "vehicle" "launch_pad" "location" "target_date"
"tags"
- grid-template-columns: 1fr
- grid-template-rows: 1fr min-content min-content min-content
state:
- font-weight: bold
- font-size: 16px
- align-self: start
- justify-self: start
custom_fields:
provider:
- align-self: start
- justify-self: start
vehicle:
- align-self: start
- justify-self: start
launch_pad:
- align-self: start
- justify-self: start
location:
- align-self: start
- justify-self: start
target_date:
- align-self: start
- justify-self: start
tags:
- align-self: start
- justify-self: start
custom_fields:
provider: |
[[[
return `Provider: ${states['sensor.rocket_launch_5'].attributes["provider"]}`
]]]
vehicle: |
[[[
return `Vehicle: ${states['sensor.rocket_launch_5'].attributes['vehicle']}`
]]]
launch_pad: |
[[[
return `Launch Pad: ${states['sensor.rocket_launch_5'].attributes['launch_pad']}`
]]]
location: |
[[[
return `Location: ${states['sensor.rocket_launch_5'].attributes['launch_location']}`
]]]
target_date: |
[[[
return `Target Date: ${states['sensor.rocket_launch_5'].attributes['launch_target']}`
]]]
tags: |
[[[
return `Tags: ${states['sensor.rocket_launch_5'].attributes['tags']}`
]]]
1 Like
TRusselo
(Tristyn Russelo)
December 10, 2020, 1:10am
4
hey its me from the other thread.
like I said, I installed in HACS.
Tried for over an hour, installing, removing, installing, reinstalling, CTRL F5, Shift F5, reboot hass million times, chrome settings, clear data… and cookies… finally tried adding it via yaml and finally got a new sensor to show up but returned french data.
removed the yaml code as you said it its not needed and was not yours.
rebooted home assistant and loaded microsoft edge browser for the first time ever… and still does not show up in the integrations page. not a cache issue.
does not show up in integrations page.
im at a loss
djtimca
(Tim)
December 10, 2020, 1:55am
5
Completely lost on me too. Does it work if you copy manually into custom_components not using HACS?
djtimca
(Tim)
December 10, 2020, 2:33pm
6
Actually one other thought… what version of HA are you running?
TRusselo
(Tristyn Russelo)
December 10, 2020, 4:10pm
7
im using home-assistant-core docker on unraid. ha 118.5
on another topic, the coutdown timer entity and its status change every second filling up the logs…
HA has a timer integration- https://www.home-assistant.io/integrations/timer/
im thinking it should be possible to set a timer using an automation or script based on a launch date/time.
Then you can display the countdown in hass frontend without creating a log entry every second of the countdown
djtimca
(Tim)
December 10, 2020, 5:23pm
8
OK that theory is out the window… was wondering if it wasn’t showing up for you because of version constraints… I have no idea otherwise why it isn’t showing up.
If you browse the custom_components folder do you see the rocketlaunchlive folder on your Home Assistant system?
Thanks for the timer tip - next time I do an update on the other integration I might remove the countdown timer. Alternatively any user can exclude it from logging / saving state changes in their own system which would also accomplish the same.
TRusselo
(Tristyn Russelo)
December 10, 2020, 10:41pm
9
yeah the folder was in custom_components.
I gave up. no worries. was just playing anyway.
make sure to share your timer/automation/script config in the readme.md
thanks!
Hi,
this is great!
Please, when I click on the card, it shows 24h warning: false. I wanted to check what configuration is available but you havent written help on the github. Would you mind helping me how can I configure the notification? What options do we have in YAML? Thanks
I tried:
launch_24h_warning: true
I found in developers tools when checking your entity but no success.
djtimca
(Tim)
December 30, 2020, 3:22pm
11
There is no YAML configuration which is why it isn’t documented. It is only set up through the Integrations UI.
The launch_24h_warning is a binary sensor which will go True when there is a launch within 24 hours which you can use to trigger automations.
1 Like
Hi @djtimca
EDIT: Seems that deleting the pycache folder and restarting HA did the trick.
I just updated to core-2021.6.3, and despite the files were still in ‘custom_components’ folder, the integration stopped to work (wish I had saved the error message).
After removing it, and re-started HA, now I don’t find the integration anymore in the ‘add integration’ screen. Tried to re-deploy the files but no lucky.
I tried to change folder/file permissions, ownership to root, no luck.
Any idea?
djtimca
(Tim)
June 9, 2021, 5:52pm
13
Great stuff! Glad you got it sorted!
HansE
(HansE)
March 11, 2025, 1:21am
14
Is it possible to add the scheduled launch time next to the launch date?
I just created this Entity Card - still trying to find the best format for me, though:
type: entities
entities:
- type: attribute
entity: sensor.rocket_launch_1
name: Where
attribute: launch_pad
secondary_info: state
- type: attribute
entity: sensor.rocket_launch_1
name: When
attribute: launch_target
format: date
- type: attribute
entity: sensor.rocket_launch_1
name: When
attribute: launch_target
format: time
- type: attribute
entity: sensor.rocket_launch_1
name: When
attribute: launch_target
format: datetime