2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								############################################################################### 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								#   @author         :   Jeffrey Stone  
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								#   @date           :   02/19/2019 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								#   @package        :   Space 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								#   @description    :   Tracking space. Inspiration and code taking from https://github.com/CCOSTAN/Home-AssistantConfig#logo 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								#   @original       :   https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/config/packages/space.yaml  
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								############################################################################### 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								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 
  
						 
					
						
							
								
									
										
										
										
											2019-07-22 09:52:24 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								     show_on_map :   false 
  
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								sensor : 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   - platform :   moon 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   - platform :   launch_library 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-07 11:20:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   # Disabling 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   # - platform: rest 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   scan_interval: 1800 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   resource: https://launchlibrary.net/1.2.2/launch/next/10 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   # resource: https://raw.githubusercontent.com/cribbstechnologies/ha_config/master/www/test_launch.json 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   name: launch window 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   # if the current timestamp is in the launch window 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   # this sensor will return the UTC timestamp of the launch 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   value_template: >- 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #     {%- for launch in value_json.launches %} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #       {% if launch.location.id == 16 or launch.location.id == 17 %} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #         {% if strptime(launch.isostart, '%Y%m%dT%H%M%SZ').strftime('%Y-%m-%d') == now().strftime('%Y-%m-%d') %} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #           {% set utc_offset_string = now().strftime('%z') %} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #           {% set utc_offset_direction = utc_offset_string[:1] %} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #           {% set utc_offset_hours = now().strftime('%z')[-4:] %} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #           {% set utc_offset_seconds = (utc_offset_hours| int /100) * 60 * 60 %} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #           {% if utc_offset_direction == '-' %} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #            {{ launch.wsstamp - utc_offset_seconds}} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #           {% else %} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #             {{ launch.wsstamp + utc_offset_seconds}} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #           {% endif %} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #         {% endif %} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #       {% endif %} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #     {% endfor %} 
  
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								automation : 
  
						 
					
						
							
								
									
										
										
										
											2020-08-21 23:55:57 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   # - id: launch_window 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   alias: Launch Window Approaching 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   trigger: 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #     - platform: state 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #       entity_id: sensor.launch_window 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   condition: 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #     - condition: template 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #       value_template: "{{states('sensor.launch_window') != 'unknown'}}" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   action: 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #     - wait_template: >- 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #         {{((as_timestamp(now()) - states('sensor.launch_window') | float) | abs < 601)}} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #     - service: script.ah_report 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #       data: 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #         call_launch: 1 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #     - service: script.text_notify 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #       data_template: 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #         who: "jeff" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #         title: "Laumch Imminent" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #         message: "A Launch is imminent" 
  
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   - id :   iss_tweet 
  
						 
					
						
							
								
									
										
										
										
											2019-07-11 07:44:08 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								     initial_state :   true 
  
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								     alias :   'ISS Tweet' 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     trigger : 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       - platform :   state 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         entity_id : 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           - binary_sensor.iss 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         to :   'on' 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         from :   'off' 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     action : 
  
						 
					
						
							
								
									
										
										
										
											2019-11-13 20:53:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       - service :   script.twitter_notify_image 
  
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								         data_template : 
  
						 
					
						
							
								
									
										
										
										
											2019-11-13 20:53:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								           tweet :   >- 
  
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								             {{  [ 
  
						 
					
						
							
								
									
										
										
										
											2019-07-11 07:44:08 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             "The #ISS is passing over. Wave. #Space #theycanseeourhouse " , 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             "The #ISS just flew by with there are {{states.binary_sensor.iss.attributes.number_of_people_in_space}} people doing cool stuff. #Space #theycanseeourhouse" , 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             "The #ISS just flew by with {{states.binary_sensor.iss.attributes.number_of_people_in_space}} people in it. #Space #theycanseeourhouse" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             ]   | random }} 
  
						 
					
						
							
								
									
										
										
										
											2019-11-13 20:53:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								           image :   >- 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             {{  [   "/config/www/tweet_images/iss.jpg" , 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                  "/config/www/tweet_images/iss2.jpg" ]   | random }}   
  
						 
					
						
							
								
									
										
										
										
											2019-07-11 07:44:08 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-11-21 21:34:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   # - id: iss_notification 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   initial_state: true 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   alias: 'ISS Notification' 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   trigger: 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #     - platform: state 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #       entity_id: 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #         - binary_sensor.iss 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #       to: 'on' 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #       from: 'off' 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #   action: 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #     - service: script.ah_report 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #       data: 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #         call_interuption: 1 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   #         call_iss: 1 
  
						 
					
						
							
								
									
										
										
										
											2019-07-11 07:44:08 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            
  
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								   - id :   full_moon_tweet 
  
						 
					
						
							
								
									
										
										
										
											2019-07-11 07:44:08 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								     initial_state :   true 
  
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								     alias :   'Full Moon -Tweet' 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     trigger : 
  
						 
					
						
							
								
									
										
										
										
											2020-12-02 22:55:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       - platform :   sun 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         event :   sunset 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         offset :   -00 : 15 : 00 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     condition : 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       - condition :   state 
  
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								         entity_id :   sensor.moon 
  
						 
					
						
							
								
									
										
										
										
											2020-12-02 22:55:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								         state :   'full_moon' 
  
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								     action : 
  
						 
					
						
							
								
									
										
										
										
											2020-12-02 22:55:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       - service :   script.jarvis_voice 
  
						 
					
						
							
								
									
										
										
										
											2020-12-02 23:09:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								         data_template : 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           who :   '{{ states.sensor.room_audio.state }}' 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           message :   > 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             <p> 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               {{  [ 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               'There is a Full Moon out tonight. and this time it is the <emphasis>actual</emphasis> moon. And <emphasis>not</emphasis> the neighbor. ' , 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               'Hey look, There is the full moon. ' , 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               'The moon is <emphasis>huge<e/mphasis>! And full. ' , 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               'If you went outside right now you might see the full moon. <break time="2s"/> Of course if you wait long enough there will be one inside the house too. ' , 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               'If you want to see the full moon, <emphasis>tonight is the night</emphasis>.' ]  
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               | random }} 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             </p> 
  
						 
					
						
							
								
									
										
										
										
											2019-11-13 20:53:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       - service :   script.twitter_notify_image 
  
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								         data_template : 
  
						 
					
						
							
								
									
										
										
										
											2019-11-13 20:53:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								           tweet :   >- 
  
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:49:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								             {{  [ 
  
						 
					
						
							
								
									
										
										
										
											2019-07-11 07:44:08 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             "There is a Full Moon out tonight, and this time it's the actual moon and not the neighbor. " , 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             "Hey look kids, There's the full moon. " , 
  
						 
					
						
							
								
									
										
										
										
											2019-11-12 14:36:27 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             "The moon is huge! And full. " ]   | random + "#Space   #fullmoon"}} 
  
						 
					
						
							
								
									
										
										
										
											2019-11-13 20:53:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								           image :   >- 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             "/config/www/tweet_images/full_moon.jpg"