Home Assistant - Get notified when ISS is above your home

Home Assistant - Get notified when ISS is above your home

Hi everyone,

In this article I've explained how to know the ISS position in Home Assistant.

Use case

The ISS is above your home.

If you are at home, you want to get notified in order to be ready to take a picture.

Software configuration

  1. Home Assistant. I'm currently running version?2022.8.0
  2. Internation Space Station integration configured in Home Assistant. This integration allows you to know if the station is above your home location (10° above the horizon of your home).
  3. Within the configuration.yaml file set the coordinates (latitude/longitude) of your home location as well as the elevation in meters.
  4. Mobile App integration?configured in Home Assistant. This integration allows Home Assistant mobile apps (Android / IOS) to integrate with your Home Assistant environment.
  5. A Input Number helper has been defined accordingly.

Home Assistant code (yaml)

This is the piece of code - Automation - you have to write down:

alias: Android Notify - ISS is visibile
description: Send an android notification to my phone if the ISS is visible and I'm at home. This notification will be automatically cleared after xx seconds according to the defined threshold.
trigger:
? - entity_id: binary_sensor.iss
? ? from: "off"
? ? platform: state
? ? to: "on"
condition:
? - condition: state
? ? entity_id: device_tracker.[nameofyoursmartphone]
? ? state: home
action:
? - data:
? ? ? message: >-
? ? ? ? ISS is visible! Coordinates:
? ? ? ? {{state_attr('binary_sensor.iss', 'latitude')}},
? ? ? ? {{state_attr('binary_sensor.iss', 'longitude')}}
? ? ? data:
? ? ? ? timeout: "{{ states('input_number.iss') | int}}"
? ? service: notify.mobile_app_[nameofyoursmartphone]
mode: single        

Some specifics about the code above

  1. The automation's trigger is the changing state (from off to on) of the binary_sensor.iss entity defined adding the Internation Space Station integration.
  2. In order to have the automation smarter, I've added a condition based on the actual position of my smartphone. This is achieved simply adding the condition state based on the entity: device_tracker.[nameofyoursmartphone].
  3. The notification is sent using the service notify.mobile_app_[nameofyoursmartphone] available after that you have configured the Mobile App Integration above.
  4. The android notification's message can me customized as you want / need. In this example, it includes the ISS coordinates when the trigger is fired.
  5. In order to avoid clogging up your smartphone, the notification will be automatically cleared when the threshold, defined by the input_number.iss helper, is reached.

I do hope you have enjoyed this article. I'm available for any feedback so, feel free to contact me or share your thoughts in the comments section below!

Thank you for reading.

--------------------------------------------------------------------------------------------------------

Other recent articles about Home Assistant:

Home Assistant - Getting the position?of ISS

Home Assistant - Getting the distance between people and zones

Home Assistant - Automation: Stop chromcast streaming if TV has turned OFF

Home Assistant - Sensor: Getting the operational state of a household appliance

Home Assistant - Automation: Power up your TV / DVD based on Chromcast

要查看或添加评论,请登录

Emiliano Guerzoni的更多文章

社区洞察

其他会员也浏览了