I’m at the bottom of a very steep learning curve… and perhaps i should have listened to Paul Hibbert and I really don’t have any business trying HA… but here we are. This time last week I didn’t know how to setup a virtual machine - so there is progress being made (I think?)
Having setup the Hue (x38), Sonos and Harmony (and Google cast instances, but those keep losing connection so I’m going to take the L on that one for awhile) - I’m getting more creative and looking at my nvidia Shield with Kodi and thinking I must be able to have some fun with that.
I’ve currently got a Google Home–IFTTT–webhooks–local server setup to control some of the inputs to Kodi - like changing the TV channel. (GoogleHomeKodi)
Using rest_command we can short circuit that and send JSON commands directly to my local server.
I’ve got most of it working. If I hard-code the name of the station into rest_command, everything works:
rest_command:
channel_7_run:
url: http://192.168.1.104:8099/playpvrchannelbyname?q=channel_7
method: POST
payload: '{"token":"blah"}'
content_type: 'application/json; charset=utf-8'
Ultimately, I’d like to be able to have an input_select drop down list in lovelace where you choose the station you want and that fires the rest_command through an automation. But I can’t work out how to soft code the current state of the input_select into the JSON.
This is as far as I’ve got
rest_command:
channel_7_run:
url: http://localhost:8099/playpvrchannelbyname?q={{ state('input_select.channel_selector') }}
method: POST
payload: '{"token":"blah"}'
content_type: 'application/json; charset=utf-8'
That’s clearly not right - and as I said I probably have no business trying. But thought I’d throw it out there in case anyone feels like giving me some pointers?