About eight years ago we purchased a small Samsung "Smart TV". At the time we thought it was very clever as it has an ethernet connection which allowed us to use an inbuilt web browser and iPlayer. Subsequently it was used as a computer screen and to play media from a DLNA server.
I now want to integrate it with Home Assistant so that we can start and control videos as we do for music. Unfortunately the Smart TV is not smart enough for this so I purchased a Chromecast to help it.
Chromecast installation and testing
As expected there is a slick installation procedure and I soon have the Chromecast working on HDMI with the usual apps such as Netflix, ITVhub available.
Chromecast provides extra connectivity capabilities.
We can easily cast youtube or iplayer from the phone to Chromecast.
On the ipad we can cast from youtube, vlc or iplayer.
On the PC we can cast a chrome browser session to the TV allowing us to see whatever is displayed or playing in the browser. Alternatively you can cast videos from the youtube app or vlc.
All these facilities are great but I probably wouldn't use them much in practice, so I now need to see what extras Home Assistant can offer.
Home Assistant
HA has a Google Cast integration built in and uses it to send speech or music to the Google Nest mini. As far as HA is concerned the TV, with Chromecast attached, is just another casting device.
Using the "Browse Media" button on the card for the TV you can select a video from the DLNA server or local media and play it on the TV. This is a great start, we can already play videos of our choice and it is as simple to use from HA as it is selecting DLNA directly on the TV.Looking at the sample in Google Cast integration it is easy to setup a script to cast a video to the TV. The service is media_player.play_media, the target is media_player.john_study_tv and you just need to provide a URL and type for the media content. Running this script causes the video to play. Now that I have a script I can use a webhook or Google Assistant command to initiate the video so I have the basis of a solution.
You can also play youtube videos by specifiying suitable media_content details:
Conclusion
No comments:
Post a Comment