Changing switch state from command line

I was wondering if it’s possible to change the switch state from shell command?
I’am using HA for controlling internet radio stations and have three switches configured - every for one radio station. The issue is that when i press the radio station, the remaining switches state should be changed to “off”.
Is it possible to achieve this from shell command? Or just maybe via automation scirpt?

Thanks for your opinion.


From a shell command you can use something like curl to call the rest API. I don’t have any examples of using curl, but some examples of using the API from a smartphone are here,