Hello everyone! I recently installed home assistant. I need to make it so that a certain video starts playing on the TV every 20 minutes. Can you tell me how I can do this? I can’t implement this idea on my own.
Write an automation with a a time pattern trigger: Automation Trigger - Home Assistant
I figured that out, I need a way to send video to the TV, that’s my only problem.
That wasn’t clear at all based on your OP. The source and destination device types are important. To include how you have those specific devices integrated in HA.
I have a computer with HA installed and a TV that are on the same local network, an LG webOS TV 55UJ634V-ZD. I managed to make friends with the TV and HA, I increased the volume every 20 seconds, sent notifications. But no matter what I do, I don’t want to launch a video on it. I need any working way to launch a video on the TV every 20 minutes, but it is desirable that the launch of this video was instantaneous, without loading the browser, for example.
Tom’s link still is a valid method, but I had to use HA’s specific local IP to get it to work.
http://homeassistant.local:8123
didn’t work, but that may be network settings dependent
Do you mean something like this? That is, I fill in the automation: Condition, additional condition and already the action that needs to be performed?
www
needs to be local
data:
entity_id: media_player.xxxxxxxxx
command: system.launcher/open
payload:
target: http://192.168.1.xxx:8123/local/test.mp4
action: webostv.command
(post deleted by author)
Create a folder under homeassistant called www and put the video in there.
www=local Then reference the file using local.
Such a folder was already created on May 21, I tried to do it, but it didn’t work, can I somehow check the access and functionality of this link? It should open in the browser on the computer, or am I wrong? http://192.168.1xxx:8123/local/test.mp4 does not work unfortunately, I can’t open the video in the browser on the computer
No you are right, that should work.
That’s it. Test a different video. Codecs, video size or audio formats may be in play
Download the 640x360 or the 1280x720 sample file from here by right clicking when it plays. Select save video…
Name it earth.mp4
Upload it to your www folder and test http://192.168.1.xxx/local/earth.mp4
Same error, maybe it’s a matter of access or something? If there was something wrong with the video, would the site give a 404 not found error?
do you have http settings set in your HA configuration file?
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24
There was no such line in the configuration file, I added it, then restarted HA completely and everything worked! I don’t know what helped, just restarting or adding the setting to the configuration. Thank you very much for your help!
a good read. Most likely the restart…
Specifically this
Hosting files
If you want to use Home Assistant to host or serve static files then create a directory called www
under the configuration path (/config
). The static files in www/
can be accessed by the following URL http://your.domain:8123/local/
, for example audio.mp3
would be accessed as http://your.domain:8123/local/audio.mp3
.
Is it possible to write a continuation of my task here? There are still several points that I could not implement on my own. Specifically, I need to remember the initial state of the TV, then run the video, and then return the TV to its initial state. Let’s say YouTube was turned on on the TV, the TV remembers that it was turned on, starts the video as we did, and then returns and turns YouTube back on?