2020-06-27 17:05:13 +00:00
|
|
|
#-------------------------------------------
|
|
|
|
# Visit The Main Blog for More Home Assistant Goodness - https://www.vCloudInfo.com
|
|
|
|
# Follow me on the socials - @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: UC301G8JJFzY0BZ_0lshpKpQ
|
|
|
|
|
|
|
|
- platform: socialblade
|
|
|
|
name: vCloudinfo_info
|
|
|
|
channel_id: UC301G8JJFzY0BZ_0lshpKpQ
|
|
|
|
|
|
|
|
automation:
|
|
|
|
- alias: YouTube Notification - vCloudInfo
|
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
entity_id: sensor.vcloudinfo
|
|
|
|
|
2020-07-01 20:55:38 +00:00
|
|
|
condition:
|
|
|
|
- condition: template
|
|
|
|
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
|
|
|
|
|
2020-06-27 17:05:13 +00:00
|
|
|
action:
|
2020-07-07 15:09:17 +00:00
|
|
|
- delay: '00:10:00'
|
|
|
|
|
2020-06-27 17:24:25 +00:00
|
|
|
- service: script.tweet_engine_no_image
|
2020-06-27 17:05:13 +00:00
|
|
|
data_template:
|
|
|
|
tweet: >
|
|
|
|
{{ [
|
2020-06-27 17:26:46 +00:00
|
|
|
"New Video! {{ states('sensor.vcloudinfo') }} - {{ state_attr('sensor.vcloudinfo','url') }} "
|
2020-06-27 17:05:13 +00:00
|
|
|
] | random }}
|
2020-06-27 17:24:25 +00:00
|
|
|
who: 'ccostan'
|
|
|
|
|
|
|
|
- delay: '00:10:00'
|
|
|
|
|
|
|
|
- service: script.tweet_engine_no_image
|
|
|
|
data_template:
|
|
|
|
tweet: >
|
|
|
|
{{ [
|
2020-06-27 17:26:46 +00:00
|
|
|
"New Video! {{ states('sensor.vcloudinfo') }} - {{ state_attr('sensor.vcloudinfo','url') }} "
|
2020-06-27 17:24:25 +00:00
|
|
|
] | random }}
|
|
|
|
who: 'BearStoneHA'
|