home-assistant-configuration/config/packages/youtube.yaml

55 lines
1.8 KiB
YAML
Raw Normal View History

#-------------------------------------------
# I totally stole this from @CCOSTAN
#
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# YouTube Related Packages from @Pinkywafer
# https://github.com/pinkywafer/Home-Assistant_Config/blob/master/packages/youtube/vcloudinfo.yaml
# More information found here in these issues
# https://github.com/CCOSTAN/Home-AssistantConfig/issues/720
#-------------------------------------------
# sensor:
# - platform: youtube
# channel_id: UCipZJ6748kd8TbelSxcvcVg
2021-05-24 15:47:55 +00:00
2021-05-24 15:47:55 +00:00
automation:
- alias: YouTube Notification - SlackerLabs
id: 5e751352-067e-4706-978a-2479b6f5fd96
trigger:
- platform: state
entity_id: sensor.slackerlabs
2021-05-24 15:47:55 +00:00
condition:
- condition: template
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
2021-05-24 15:47:55 +00:00
action:
- service: script.text_notify
data_template:
who: "jeff"
message: New Video! {{ states('sensor.slackerlabs') }} - {{ state_attr('sensor.slackerlabs','url') }}
- repeat:
count: 1
sequence:
- delay: '00:03:00'
- service: script.twitter_notify
data:
tweet: >
{{ [
"Brand New Home Assistant Video! {{ states('sensor.slackerlabs') }} - {{ state_attr('sensor.slackerlabs','url') }} "
] | random }}
who: 'thejeffreystone'
- delay: '00:10:00'
- service: script.twitter_notify
data:
tweet: >
{{ [
"New #homeassistant Video went Live! {{ states('sensor.slackerlabs') }} - {{ state_attr('sensor.slackerlabs','url') }} "
] | random }}
who: 'slackerlabs'
- delay: '12:30:00'