In diesem Video zeige ich dir, wie du mit Home Assistant deine Lieblings-YouTube-Kanäle im Blick behältst und du automatisch benachrichtigt wirst, wenn neue Videos veröffentlicht werden. Dabei verwenden wir Templates, For-Schleifen und erstellen sogar ein Pie-Chart für die Creator.
🔍 Inhalte des Videos:
1. YouTube-Tracking: Wir setzen Sensoren ein, um die Veröffentlichungen deiner Lieblingskanäle zu überwachen.
2. Automatisierung mit Notification: Du erhältst Benachrichtigungen, sobald neue Videos verfügbar sind.
3. For-Schleife und Variablen in Templates: Wir nutzen diese leistungsstarken Funktionen, um unsere Automatisierung zu optimieren.
4. Pie-Chart für die Creator: Wir visualisieren die Daten mit einem schicken Diagramm. Bleib auf dem Laufenden und abonniere meinen Kanal!
🚀 Wenn du weitere Anpassungen oder Ideen hast, lass es mich wissen! 😊👍
In meinem Shop findest du Produkte * aus meinen Videos und andere interessante Dinge
Die verwendeten Integrationen lassen sich über HACS installieren. Wie du HACS installierst, erfährst du in diesem Video:
Weitere Links:
Home Assistant: Wie du HACS installierst (in 3 Minuten ) – smarthome & more (smarthomeundmore.de)
Den verwendeten Channel ID Finder, kannst du hier finden 🙂
So kann dein Ergebnis dann aussehen :
![](https://www.smarthomeundmore.de/wp-content/uploads/image-39-1024x542.png)
Konfiguration der Youtube Sensoren in der configuration.yaml:
sensor: - platform: youtube channel_id: UCd-TcFifNC20TrnEiESNumw #smart home & more - platform: youtube channel_id: UCkwdS6Kc2yibIyjM04A0bFQ #smarthomeyourself - platform: youtube channel_id: UC6tOdC66bmw1PTYZ9Mxup0g #SteuerdeinLeben - platform: youtube channel_id: UCiU--5PKQOMdfMTG7dTKc7g #Simon42 - platform: youtube channel_id: UC9GhECy9pXpEnzedm_w07wA #Smartzeug - platform: youtube channel_id: UCNvXHh8fiVdYo4NkbHph-9w #Smartrev - platform: youtube channel_id: UCYh0OOdITnYFgkO_vjuvupA #verdrahtet - platform: youtube channel_id: UCe06G4hqXjUlYhB-rDmns4g #Tristan - platform: youtube channel_id: UC9rJWdu8-jyyxo73DPevpKg #Smartlivenet - platform: youtube channel_id: UCvgSyOl0NdnpBEYF7fX7Y_A #The Alkly - platform: youtube channel_id: UCUSC1_KwZp_6GZ8IyIW2yRQ #Smarthomebastler - platform: youtube channel_id: UCPpzG1lA071gQegxfKoKiqQ #Meine digitale Welt
Konfiguration der “published” Sensoren in der configuration.yaml:
- platform: attributes friendly_name: "Youtube Views" attribute: views entities: - sensor.smart_home_more - sensor.smarthome_yourself - sensor.steuer_dein_leben - sensor.simon42 - sensor.smartzeug - sensor.smartrev - sensor.verdrahtet - sensor.tristan_s_smartes_heim - sensor.smart_live_net - sensor.alkly - sensor.smart_home_bastler - sensor.meinedigitalewelt
Automatisierung aus dem Video:
![](https://www.smarthomeundmore.de/wp-content/uploads/image-38-1024x997.png)
alias: Notification, neues YT Video meiner Kanäle verfügbar description: >- Immer, wenn eines der Kanäle ein neues Video bringt, bekomme ich eine Notifikation trigger: - platform: state entity_id: - sensor.smart_home_more - sensor.smarthome_yourself - sensor.steuer_dein_leben - sensor.simon42 - sensor.smartrev - sensor.smartzeug - sensor.verdrahtet - sensor.tristan_s_smartes_heim - sensor.smart_live_net - sensor.alkly - sensor.smart_home_bastler - sensor.meinedigitalewelt attribute: url for: hours: 0 minutes: 1 seconds: 0 condition: [] action: - service: notify.notify metadata: {} data: message: >- {% set buffer = namespace(videos=[]) %} {% for sensor in [ states.sensor.smart_home_more_published, states.sensor.smarthome_yourself_published, states.sensor.steuer_dein_leben_published, states.sensor.tristan_s_smartes_heim_published, states.sensor.smart_live_net_published, states.sensor.alkly_published, states.sensor.smart_home_bastler_published, states.sensor.smartrev_published, states.sensor.smartzeug_published, states.sensor.verdrahtet_published, states.sensor.meinedigitalewelt_published, states.sensor.simon42_published ] %} {% if strptime(sensor.state, '%Y-%m-%dT%H:%M:%S+00:00').date() == now().date() %} {% set video_name = sensor.entity_id.split('.')[1].replace('_published', '') %} {% set buffer.videos = buffer.videos + [video_name] %} {% endif %} {% endfor %} {% if buffer.videos %} Neues Video veröffentlicht von: {{'\n'}}{{ buffer.videos | join(',\n') }} {% endif %} mode: single
Bonusmaterial für Creator 🙂 und Andere …
Attribute “views” in der Configuration.yaml
- platform: attributes friendly_name: "Youtube Veröffentlicht" attribute: published entities: - sensor.smart_home_more - sensor.smarthome_yourself - sensor.steuer_dein_leben - sensor.simon42 - sensor.smartzeug - sensor.smartrev - sensor.verdrahtet - sensor.tristan_s_smartes_heim - sensor.smart_live_net - sensor.alkly - sensor.smart_home_bastler - sensor.meinedigitalewelt
YAML Code der Apex Chart Card
![](https://www.smarthomeundmore.de/wp-content/uploads/image-36-1024x484.png)
type: custom:apexcharts-card apex_config: chart: height: 350px chart_type: pie header: show: true show_states: true colorize_states: true title: Youtube Views der letzen Videos series: - entity: sensor.smart_home_more_views name: smart home & more type: column - entity: sensor.simon42_views name: simon42 type: column - entity: sensor.smarthome_yourself_views name: smarthome yourself type: column - entity: sensor.steuer_dein_leben_views name: Steuer dein Leben type: column - entity: sensor.smartrev_views name: Smart Rev type: column - entity: sensor.smartzeug_views name: Smartzeug type: column - entity: sensor.verdrahtet_views name: Verdrahtet type: column - entity: sensor.tristan_s_smartes_heim_views name: Tristans Smartes Heim type: column - entity: sensor.smart_live_net_views name: SmartLive.Net type: column - entity: sensor.alkly_views name: The Alkly type: column - entity: sensor.smart_home_bastler_views name: Smart Home Basler type: column - entity: sensor.meinedigitalewelt_views name: Meine digitale Welt type: column
YAML Code des gesamten Dashbords, mit zwei Vertikalen Stapeln
![](https://www.smarthomeundmore.de/wp-content/uploads/image-37-1024x437.png)
- title: Youtube path: youtube icon: mdi:youtube type: panel cards: - type: horizontal-stack cards: - type: vertical-stack cards: - type: tile entity: sensor.smart_home_more show_entity_picture: true vertical: true state_content: - published - state - views - stars - type: tile entity: sensor.simon42 show_entity_picture: true vertical: true state_content: - published - state - views - stars - type: tile entity: sensor.smartrev show_entity_picture: true vertical: true state_content: - published - state - views - stars - type: tile entity: sensor.smartzeug show_entity_picture: true vertical: true state_content: - published - state - views - stars - type: tile entity: sensor.verdrahtet show_entity_picture: true vertical: true state_content: - published - state - views - stars - type: tile entity: sensor.smart_home_bastler show_entity_picture: true vertical: true state_content: - published - state - views - stars - type: vertical-stack cards: - type: tile entity: sensor.steuer_dein_leben show_entity_picture: true vertical: true state_content: - published - state - views - stars - type: tile entity: sensor.smarthome_yourself show_entity_picture: true vertical: true state_content: - published - state - views - stars - type: tile entity: sensor.tristan_s_smartes_heim show_entity_picture: true vertical: true state_content: - published - state - views - stars - type: tile entity: sensor.smart_live_net show_entity_picture: true vertical: true state_content: - published - state - views - stars - type: tile entity: sensor.alkly show_entity_picture: true vertical: true state_content: - published - state - views - stars - type: custom:apexcharts-card apex_config: chart: height: 350px chart_type: pie header: show: true show_states: true colorize_states: true title: Youtube Views der letzen Videos series: - entity: sensor.smart_home_more_views name: smart home & more type: column - entity: sensor.simon42_views name: simon42 type: column - entity: sensor.smarthome_yourself_views name: smarthome yourself type: column - entity: sensor.steuer_dein_leben_views name: Steuer dein Leben type: column - entity: sensor.smartrev_views name: Smart Rev type: column - entity: sensor.smartzeug_views name: Smartzeug type: column - entity: sensor.verdrahtet_views name: Verdrahtet type: column - entity: sensor.tristan_s_smartes_heim_views name: Tristans Smartes Heim type: column - entity: sensor.smart_live_net_views name: SmartLive.Net type: column - entity: sensor.alkly_views name: The Alkly type: column - entity: sensor.smart_home_bastler_views name: Smart Home Basler type: column - entity: sensor.meinedigitalewelt_views name: Meine digitale Welt type: column - show_name: true show_icon: true type: button tap_action: action: toggle
Ich würde mich sehr über einige Dashboards auf Basis dieses Videos freuen. Kommt dazu gerne auf meinen Discord Server https://discord.gg/tCGy3RWFwJ und teilt Eure Ideen. Vielen Dank 🙂