Hi all,
I am new to the community and hope to get some help. I am quiet new to homeassistant but have got many things to work already and I am really pleased with the product.
My problem is using the RESTful command with a variable. What I want to achieve is to change the program on my Sony Bravia TV. So I have a working piece of code in the configuration.yaml:
rest_command:
tv_playcontent:
url: http://192.168.132.156/sony/avContent
method: POST
headers:
X-Auth-PSK: 'myKeyHere'
content_type: 'application/json'
payload: '{"method": "setPlayContent","id": 101,"params": [{"uri": "tv:dvbs?trip=1.1019.10302&srvName=arte HD"}],"version": "1.0"}'
verify_ssl: false
When I run the service from the frontend without any parameters it is working well and it changes the program on Bravia TV to Arte. But I would like to amend the code that I only pass the program name to the service I am calling. So I changed the payload parameter to:
payload: '{"method": "setPlayContent","id": 101,"params": [{"uri": {{ uri }}}],"version": "1.0"}'
and when I call the service I enter the service data tp pass with service:
{"uri": "tv:dvbs?trip=1.1019.10302&srvName=arte HD"}
But nothing happens and I donĀ“t even get logs in HA or in the console.
Can someone point me into the right direction please?
Thanks and regards
Alexander