I am using my Raspberry only for a Spotify connect client (Raspotify), the device connects to an AV Receiver which has a number of HDMI ports.
After 2 days of trial and error I managed to figure out a couple of commands to send over cec-client to switch on the device and to switch its input to a specific HDMI-in.
The command that I used is 1F:82:18:00 - the 18 part is the address of my port (I can go to other ports by using addresses 10, 11, etc.
But that means that if I later connect to a different HDMI input on the amp, I would need to change my script. Isn't there a way to say "switch to the HDMI port from which this request is coming"?