From 67236c5a9bbf518d2e054a8b3634cb47ba1a9cee Mon Sep 17 00:00:00 2001 From: ccostan Date: Wed, 27 May 2020 18:41:01 -0400 Subject: [PATCH] Updated Space Notifications a bit. #411 --- config/packages/space.yaml | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/config/packages/space.yaml b/config/packages/space.yaml index dc3d1d4b..53f18479 100755 --- a/config/packages/space.yaml +++ b/config/packages/space.yaml @@ -4,18 +4,6 @@ # Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig #------------------------------------------- #------ISS---------------------------------- -homeassistant: - customize: - binary_sensor.iss: - icon: mdi:satellite-variant - friendly_name: ISS Visibility - - hidden: False - homebridge_hidden: true - sensor.launch_window: - hidden: False - icon: mdi:rocket - friendly_name: Rocket Launch Window #------------------------------------------- binary_sensor: - platform: iss @@ -23,7 +11,6 @@ binary_sensor: #------------------------------------------- sensor: - - platform: launch_library - platform: moon @@ -58,21 +45,12 @@ automation: - platform: state entity_id: sensor.launch_window condition: - condition: and - conditions: - - condition: template - value_template: "{{states('sensor.launch_window') != 'unknown'}}" - - condition: template - value_template: "{{as_timestamp(now()) < (states('sensor.launch_window') | float)}}" + - condition: template + value_template: "{{states('sensor.launch_window') != 'unknown'}}" action: - wait_template: >- - {{as_timestamp(now()) >= ((states('sensor.launch_window') | float) - 1800)}} - - service: script.notify_engine - data_template: - value1: 'There will be a rocket Launch today - I will notify you later when the launch window starts' - - wait_template: >- - {{as_timestamp(now()) >= ((states('sensor.launch_window') | float) - 300)}} + {{((as_timestamp(now()) - states('sensor.launch_window') | float) | abs < 601)}} - service: script.notify_engine data_template: value1: 'Go Outside! There is a Rocket Launch very soon!'