Cleaned up space notifications

This commit is contained in:
Jeffrey Stone 2019-07-11 07:44:08 -04:00
parent f017bbda6e
commit b3a4ea8ce5
1 changed files with 25 additions and 8 deletions

View File

@ -54,6 +54,7 @@ sensor:
automation:
- id: iss_tweet
initial_state: true
alias: 'ISS Tweet'
trigger:
- platform: state
@ -66,24 +67,40 @@ automation:
data_template:
message: >-
{{ [
"The #ISS is passing over. Wave.",
"The #ISS just flew by and there is 1 Starman driving a #Tesla and {{states.binary_sensor.iss.attributes.number_of_people_in_space}} people in",
"The #ISS just flew by and there are {{states.binary_sensor.iss.attributes.number_of_people_in_space}} people in"
] | random + " #Space #theycanseeourhouse"}}
"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 }}
- id: iss_notification
initial_state: true
alias: 'ISS Notification'
trigger:
- platform: state
entity_id:
- binary_sensor.iss
to: 'on'
from: 'off'
action:
- service: script.voice_notify
data_template:
message: !include ../templates/iss_report.yaml
- id: full_moon_tweet
initial_state: true
alias: 'Full Moon -Tweet'
trigger:
- platform: state
entity_id: sensor.moon
to: 'Full Moon'
to: 'full_moon'
action:
- delay: '0{{ (range(1, 5)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00'
- service: script.twitter_notify
data_template:
message: >-
{{ [
"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.",
"The moon is huge! And full."
"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. ",
"The moon is huge! And full. "
] | random + "#Space #fullmoon"}}