So I have to crawl a coupe of urls on an API to fetch a URL to play on my chromecast. I couldn’t find a nice way to do this other than creating a sensor which runs a bash-script. Seems to work fine and the sensor state is containing the url I want. However my Chromecast cannot play this, like if the url is not passed correctly. Is this even possible?
automation:
- alias: Play Brandmand Sam
trigger:
platform: state
entity_id: input_select.1salcast
to: "Brandmand Sam"
action:
- service: media_player.play_media
data:
entity_id: media_player.1_sal
media_content_id: sensor.brandmand_sam_url
media_content_type: movie
I have also tried these:
media_content_id: {{ sensor.brandmand_sam_url }}
media_content_id: {{ state.sensor.brandmand_sam_url }}
with no luck.
Hi.
It is still not doing it. When I look at the attributes for the mediaplayer, it says:
media_content_id: {{ states.sensor.brandmand_sam_url.state }}
…So like it is not resolved to a url.
If I write in the url manuallay, it works fine. So the url is good.