So I’m doing my first steps with HA and I want to create a way to choose a radio station to play on my soundbar using TuneIn. I’ve got a rest service configured like this (using the station parameter):
rest_command:
change_station:
url: http://xx.xx.xx.xx:55001/CPM?cmd=giantCommand...{{ station }}restOfGiantCommand
method: GET
If I execute this service with developer tools it works great.
Using some information I got from these forum I added this to configuration
I think you’ve already discovered the difference empirically. The first one, data, doesn’t support templates whereas the second one, data_template, does.
If you use datawith templates, the templates are not evaluated but used literally (which usually means things fail to work as expected).
In contrast, if you use data_templatewithout templates, nothing bad happens and it behaves like data.
Hi there @Mariusthvdb, thank you for your input. I’m not actually using Option1 and Option2 it was just to simplify the post since they’re my country’s radio stations and they might not be understandable in english
I have Option1 = 3 (well actually it’s the station’s name and not Option1) because I can’t find a way to tell my Samsung soundbar to play a specific stream, so I used the multiroom app to save the stations as favorites and they use 0,1 and 2 as presets and 3 onward as favorites.
Next step is to find a way to join them into one card, since I don’t even have a chromecast I don’t think that topic is the right one to look for help right now, but you never know
I’m still starting to get around HA so I still have a lot to learn.