91JJ
(91JJ)
May 14, 2021, 12:49pm
1
Hi all…
I’m currently using the Bravia PSK Integration which is working fine, along with Mini Media Player , again, working fine.
I use the Media Player to call a service to start up specific apps.
Ideally I’m wanting to add another button for a Facebook Video… The documentation (here ) shows you can call a service to show all the apps you can launch.
I’m struggling to do this and was curious whether I could create a sensor to return the available options?
braviatv_psk.bravia_open_app
If you have an Android TV you can use an uri to open the corresponding app.
You can use the following command to get all uri’s from the TV:
curl -H 'Content-Type: application/json' -H 'X-Auth-PSK:[psk]' -X POST -d "{'id': 1, 'method': 'getApplicationList', 'version': '1.0', 'params': ['']}" http://[IP]/sony/appControl
Change **[u][psk][/u]**
with your psk and **[u][IP][/u]**
with the IP address of the TV.
91JJ
(91JJ)
May 18, 2021, 7:29am
2
Can anybody help with this?
91JJ
(91JJ)
May 29, 2021, 4:14pm
3
So I tried the below, but still no luck…
sensor:
- platform: command_line
command: curl -H 'Content-Type: application/json' -H 'X-Auth-PSK:1234' -X POST -d "{'id': 1, 'method': 'getApplicationList', 'version': '1.0', 'params': ['']}" http://192.168.0.12/sony/appControl
name: curltest
koying
(Chris B)
June 2, 2021, 2:06pm
5
What happens if you try that curl on command-line, or use Postman to do the equivalent?
91JJ
(91JJ)
June 2, 2021, 2:30pm
6
I’m trying to make it dynamic within Home Assistant…
The goal is to have two ‘helpers’
YT Video URL : (input text box)
Media Player : (dropdown list - template of all available media players)
Then an automation, so you can input the URL, then when you select the media player an automation runs to cast the URL to the selected media player.
Issue I’m having is creating the dynamic list of available Media Players.
koying
(Chris B)
June 2, 2021, 2:55pm
7
Sure, but if the curl doesn’t work in the first place, it won’t work better in HA
1 Like
91JJ
(91JJ)
June 2, 2021, 4:12pm
8
ah, sorry… to slightly change the question…
So if they return ok, next step is to add them to a list.
If I run something similar to this in the Template, it looks fine.
But when I add that to an input list, it just returns the text.
["{{ states.media_player
| rejectattr('state', 'equalto', 'off')
| rejectattr('state', 'equalto', 'idle')
| map(attribute ='entity_id')
| join('", "')
}}"]
In the template
I think this is the issue…