SmartThings: how to select media input source for TV?

Hi,

I’ve set-up the Samsung SmartThings integration successfully in Home Assistant and can turn my Samsung Q9 TV on and off. I previously tried the Samsung integration but it kept getting the power state of my TV wrong.

I’d like to be able to add to a script the ability to change the input source of the TV. This apppears to be possible in the SmartThings API but I can’t see how to do this in a Home Assistant Script.

Any ideas?

Many thanks,

Neil.