Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube integration #86

Closed
BeardedTinker opened this issue May 17, 2022 · 2 comments
Closed

YouTube integration #86

BeardedTinker opened this issue May 17, 2022 · 2 comments
Assignees
Labels
Enhancement New feature or request HACS Home Assistant Community Store Notification Everything related to notifications

Comments

@BeardedTinker
Copy link
Owner

I'll link here some of the YouTube channel that create content that I watch with their Channel IDs, so anyone can use it for their Home Assistant integration:

  1. Automate Your Like
  • UCtRSKEipM17PF7n0mi66btQ
  1. BeardedTinker
  • UCuqokNoK8ZFNQdXxvlE129g
  1. Make It Work
  • UCGoreZKPBtCXCf54F3DF4ug
  1. Mark Watt Tech
  • UCQRm_z7seHnGsBiWDNEWr6A
  1. Mostly Chris
  • UCXEa_Gzl2zjhb7K6xflyrWQ
  1. SlackerLabs
  • UCipZJ6748kd8TbelSxcvcVg
  1. Smart Home Makers
  • UCa-_T4_g4T_11YMlxn80LaQ
  1. Tango Tech
  • UC4YUKOBld2PoOLzk0YZ80lw
@BeardedTinker BeardedTinker added Enhancement New feature or request HACS Home Assistant Community Store Notification Everything related to notifications labels May 17, 2022
@BeardedTinker BeardedTinker self-assigned this May 17, 2022
BeardedTinker added a commit that referenced this issue May 21, 2022
@BeardedTinker
Copy link
Owner Author

Here is excellent automation Jonny created. Of course, you still need individual YT Channel sensors before this will work:

alias: Youtube Live Stream
description: ''
trigger:
  - platform: state
    entity_id:
      - sensor.beardedtinker
      - sensor.unexpected_maker
      - sensor.unexpected_streams
      - sensor.bitluni
      - sensor.bitluni_s_trash
      - sensor.superhousetv
      - sensor.intermit_tech
      - sensor.simple_electronics
    attribute: channel_is_live
    to: true
    for:
      hours: 0
      minutes: 0
      seconds: 0
condition: []
action:
  - service: notify.mobile_app_jonny
    data:
      message: >
        {{state_attr(trigger.entity_id, 'friendly_name')}} is live,  video title
        {{ trigger.to_state.state }}
  - service: tts.cloud_say
    data:
      entity_id: media_player.kontor
      message: >
        {{state_attr(trigger.entity_id, 'friendly_name')}} is live, video title 
        {{ trigger.to_state.state }}
mode: single

And it goes in hand with these sensors that tracks if any of the channels is live:

- platform: template
  sensors:    
    beardedtinker_live:
      unique_id: yt00001
      friendly_name: "{{ state_attr('sensor.beardedtinker', 'friendly_name') Live }}"
      value_template: "{{ state_attr('sensor.beardedtinker', 'channel_is_live') }}"
    unexpected_maker_live:
      unique_id: yt00002
      friendly_name: "{{ state_attr('sensor.unexpected_maker', 'friendly_name') Live }}"
      value_template: "{{ state_attr('sensor.unexpected_maker', 'channel_is_live') }}"
    unexpected_streams_live:
      unique_id: yt00003
      friendly_name: "{{ state_attr('sensor.unexpected_streams', 'friendly_name') Live }}"
      value_template: "{{ state_attr('sensor.unexpected_streams', 'channel_is_live') }}"
    bitluni_live:
      unique_id: yt00004
      friendly_name: "{{ state_attr('sensor.bitluni', 'friendly_name') Live }}"
      value_template: "{{ state_attr('sensor.bitluni', 'channel_is_live') }}"
    bitluni_s_trash_live:
      unique_id: yt00005
      friendly_name: "{{ state_attr('sensor.bitluni_s_trash', 'friendly_name') Live }}"
      value_template: "{{ state_attr('sensor.bitluni_s_trash', 'channel_is_live') }}"
    superhousetv_live:
      unique_id: yt00006
      friendly_name: "{{ state_attr('sensor.superhousetv', 'friendly_name') Live }}"
      value_template: "{{ state_attr('sensor.superhousetv', 'channel_is_live') }}"
    simple_electronics_live:
      unique_id: yt00008
      friendly_name: "{{ state_attr('sensor.simple_electronics', 'friendly_name') Live }}"
      value_template: "{{ state_attr('sensor.simple_electronics', 'channel_is_live') }}"
    intermit_tech_live:
      unique_id: yt00007
      friendly_name: "{{ state_attr('sensor.intermit_tech', 'friendly_name') Live }}"
      value_template: "{{ state_attr('sensor.intermit_tech', 'channel_is_live') }}"
    youtube_live:
      unique_id: ytallchannels
      friendly_name: "Youtube Live"
      value_template: >
        {{ state_attr('sensor.beardedtinker', 'channel_is_live') == True or
        state_attr('sensor.unexpected_maker', 'channel_is_live') == True or
        state_attr('sensor.unexpected_streams', 'channel_is_live') == True or
        state_attr('sensor.bitluni', 'channel_is_live') == True or
        state_attr('sensor.bitluni_s_trash', 'channel_is_live') == True or
        state_attr('sensor.superhousetv', 'channel_is_live') == True or
        state_attr('sensor.intermit_tech', 'channel_is_live') == True }}

BeardedTinker added a commit that referenced this issue May 22, 2022
BeardedTinker added a commit that referenced this issue May 27, 2022
@BeardedTinker
Copy link
Owner Author

Created issue on component repository:
custom-components/youtube#56

BeardedTinker added a commit that referenced this issue Jun 24, 2022
@stale stale bot added the old-issue label Sep 8, 2022
@stale stale bot added the old-issue label Dec 16, 2022
Repository owner deleted a comment from stale bot Jan 13, 2023
Repository owner deleted a comment from stale bot Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request HACS Home Assistant Community Store Notification Everything related to notifications
Projects
None yet
Development

No branches or pull requests

1 participant