Hi guys, are there any integrations or config out there that can alert you when someone subscribes to your Youtube channel or even likes one of your videos? I would like the ability to create an automation to play a message through my Google mini’s when someone subscribes to my channel.
I have tried searching for such integration but was unsuccessful in finding anything.
Use the Youtube API,Subscriptions: list | YouTube Data API | Google Developers.
Go watch any of the videos with a live physical display that shows likes or subscribers and you will see the basics of it.
Then it’s just a matter of adapting it to HA.
Thank you I will have a look at this. It is a bit over my head but will at least try to see what I can do with this. I will be sure to share here should I make headway with it. In the meantime, if there is anyone out there that can assist, please feel free to add your comments.
Hi again, I have managed to generate an API through the developer console but I am a bit confused on what to do with the auth token? I went to create a new Oauth client ID but not sure what to type into the “Authorised redirect URIs” field. should it just be youtube.com?
Perfect, thank you. It seems mine is working but not giving me subscriber count. I only have 1 subscriber at the moment but I thought that it should still show that info.
Last question I promise. I added the sensor to my configuration.yaml file and I can add the sensor as an entity in Lovelace. It obviously only shows the fake value “1”. How would I display the attributes in the entity card? I am guessing this is some more yaml config right?
Thanks again for the help. I am obviously doing something wrong but I took your first template and pasted into the developer template window and it just outputs the code not the result. I checked that the sensor.youtube_api is available under the states section but it only shows friendly_name as an attribute. see screenshots below:
The thing is that the sensor should get the “items”.
But apparently it doesn’t. I’m lost now.
But your count and view sensor needs the [0] also as you can see above. But that won’t solve the issue since sensor.youtube_api is empty
Just a wild guess here to see if anything at all works.
Replace the fake value with "{{ value_json.["items"][0].statistics.subscriberCount }}" and restart.