The YouTube sensor produces the following when a new video is uploaded to a specified channel :
url: https://www.youtube.com/watch?v=JWFlSp2SXox
published: 2020-07-28T08:09:04+00:00
live: false
friendly_name: channelname
icon: mdi:youtube
entity_picture: https://i3.ytimg.com/vi/JWFlSp2SXox/hqdefault.jpg
I want to use that URL in an automation and am testing by simply forwarding it as a message. I realise I’m getting the formatting of the URL wrong and wondered if anyone has any pointers. There’s not a lot of documentation or importantly examples of this type of sensor.
Below is what I’ve blindly guessed by reading other similar scripts :
alias: ytnotification
description: ‘’
trigger:
- entity_id: sensor.ytchannel
platform: state
condition: []
action: - service: notify.HAnotification
data_template:
title: “YouTube”
message: {{states.sensor.ytchannel.url}}