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"?

  • Welcome to Raspberry Pi! Please take the tour and visit the helpcenter to see how things work here. Correct me if I am wrong but I understand that your question is rather about the AV Receiver not the Pi?
    – Ghanima
    Commented Oct 15, 2018 at 22:30
  • Thank you for the welcome. The question is rather about HDMI-CEC and cec-client library. I did a search across Stackexchange and it looked to me like 100% of CEC-related questions are discussed here. Commented Oct 15, 2018 at 22:57
  • We have a number of questions about CEC, true, but only a few have solid answers. Lets hope the best for this question.
    – Ghanima
    Commented Oct 15, 2018 at 23:04
  • You are right, it is a rather sad state of affairs when it comes to knowledge regarding CEC. It is a lot about what vendors choose to (not) reveal about their products and what they support. It is an important niche of technology which needs to gain momentum faster, but nobody seems interested. Commented Oct 15, 2018 at 23:12

1 Answer 1


Try this:

echo "as" | cec-client RPI -s -d 1

That should set the Raspberry Pi as the 'active source'.

The -d parameter specifies the debug level and requires a numeric value. 1 yields the least verbose output.

Tested on a Samsung Smart TV.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.