I am trying to detect the display power status of a HDMI connected display with a Raspberry Pi 3.


tvservice -s

gives the same state 0x12000a for a powered-on and powered-off display.

Are there solutions to this?

  • Try tvservice -n and see if that changes. I think the -s "status" refers to the pi, not the display. – goldilocks Sep 20 '16 at 18:31
  • 1
    tvservice -n displays device_name=SAM-SAMSUNG for both cases, display turned off by remote control and display powered off by unplugging. – alex Sep 20 '16 at 19:10
  • @alex did you get the solution for this? – Abhinandan Satpute Mar 2 '18 at 17:34
  • @AbhinandanSatpute No news, I did not pursue that issue since the time of posting. – alex Mar 3 '18 at 8:43
  • @alex oh okay. No problem. Thanks fro getting back. – Abhinandan Satpute Mar 5 '18 at 17:21

I use this Display - "17,3" LED Display Screen (non-glossy) Full HD LP173WF1 (TL)(B2)"

and this controller: - "HDMI + VGA + AV + USB + RF Eingang LCD Controller Board für B156HW01 LP173WF1 15,6 '' 17,3 '' 1920x1080 40Pins LCD".

I have a Magic Mirror with two displays. My problem was to know if they are running or not. Everything should be controlled by one of the two Rasps. So if the state is MAGIC Mirror ON. Check if the DISPLAY is on or off and set it to the correct state. The same for turning off. This helps a lot e.g. after booting to be sure both monitors are in the correct state.

I found a solution working perfectly for me.

Control the displays: I use two GPIO out to control the right and left monitor independently. The output of the pin is soldered to the display control bar. This enables me to turn on and of the display by GPIO out.

Figure out if the displays are on or off: To read out the status of the display I have two GPIO inputs connected to the infrared input. The infrared cable has five pins. The cable in the middle goes to low or high when the display is off or on. The output is 0V or 2,3V and could be connected directly to the GPIO input of the rasp.

With this configuration, i am able to use a PIR sensor and an Python program to controls the state of the displays.

It's a hardware solution, but works perfect. In my case perfect for two rasps and two display. Only one rasp with one display should be more easy. But this solution will works with many rasps and display you need. I would prefer a rasp with several hdmi outputs =;o)

P.S. Please NOTE, if you overlay one mirror glas over two displays, you will see a gray edge with normal TFT monitors where the display ends. Because this monitors are not displaying a perfect black value.

  • Perhaps you could format into sections/paragraphs so it is readable. – MatsK Apr 22 '18 at 13:27

I assume that in your /boot/config.txt


is set.

In that case, also on my Raspberry Pi 3B with Raspbian stretch, tvservice –s will always report state 0x12000a independent of the status of the monitor or if a cable is connected at all to the HDMI port.
As far as I understand, if hdmi_force_hotplug=1 is set, no check is done, if a monitor is connected or not, but HDMI is always applied.


If you can live without the ability to boot the Raspberry Pi without monitor and plug it in later, you can simply remove the line


in /boot/config.txt.

Then bit0 (=1, if cable unplugged) and bit1 (=1, if cable plugged in) of the state output of tvservice –s will tell you whether a monitor is connected or not. For example, if I boot with a HDMI monitor attached, the state will be 0x12000a. As soon as I remove the monitor cable the state will go to 0x120009. You can find further details about the meaning of the different bits in the state variable here in the official Raspberry Pi forum.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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