Are you referring to calling a service with that information?
You may need to actually place them in the ‘data’. request.post just pushes data through. My guess is that home assistant may be looking for the ‘data’ key. If that’s the case, you’d need to do the following:
data = {"data":{"entity_id": "media_player.speaker","media_content_id":"https://www.youtube.com/watch?v=IsgM7HjEVKU","media_content_type": "music"}}
Are you getting any errors on the home assistant side in the logs? I’d expect something to appear in the logs when you attempt to post and it has the wrong information.
When I go to http://192.168.2.181:8125/api/services to get a list of services, the only extractor one is this, can’t make out if this helps. (it appears there are no services setup yet)
Thanks, I got it to work in python script on the same machine as the media extractor. Is it possible to run in python command line and not in python scripts and to execute on a different HA? If not, I guess I need to create a python script that will accept a url and try to pass that url from another machine through the api / python scripts. It will essentially create a python script to replace media extractor so it can run from the api.
Good question. I do not know. You could use MQTT to pass the information back and forth. If you are trying to post this information to home assistant, then you already have all the building blocks. You just need to make the code.
Hi,
I got he media_extractor working, and it is really great. The script below streams the Norwegian channel NRK1. However, when streamed it is 3 hours back in time! If I open the same link in VLC player it streams live (at current time). I tried setting the HA time_zone to different value with no luck / change. Any ideas on what is causing this, and how to fix it?
To somewhat answer my own question… by doing a media seek above 3 hours (used 3600*4) - i got to the live part:-) So I guess I will just add this after media_extractor starts playing.