简体   繁体   English

在Linux上获取已连接电视的电源状态

[英]Get the power status of a connected TV on linux

I'm currently trying to turn my display off and on when I leave / enter the house. 我目前正在尝试离开/进入房屋时关闭和打开显示器。

I'm running an Ubuntu HTPC which is connected to a Samsung TV by HDMI (Intel HD4600). 我正在运行通过HDMI(Intel HD4600)连接到三星电视的Ubuntu HTPC。 Using 'xset dmesq ...' results in switching the HDMI output off/on and doesn't change the power status of the TV (it just looses the signal). 使用“ xset dmesq ...”会导致HDMI输出的开/关,并且不会更改电视的电源状态(只会使信号松动)。 Therefore I connected an IR transmitter which is able to turn the tv off or on - sadly both commands are using the same IR code, resulting in the power status to tip over. 因此,我连接了一个能够打开或关闭电视的IR发射器-可悲的是,两个命令都使用相同的IR代码,导致电源状态翻转。

The xset status also doesn't return the right status, it's always seen as "On", regardless of the power status: xset状态也不会返回正确的状态,无论电源状态如何,它始终显示为“ On”:

<hashworks:~> DISPLAY=:0 xset q | grep 'Monitor is'
Monitor is On

I could save the last display status, but this will result in wrong values when I turn the TV off using the remote etc. The IR transmitter isn't getting anything back as well. 我可以保存最后的显示状态,但是当我使用遥控器等关闭电视时,这将导致错误的值。红外发射器也无法恢复任何状态。

Is there any other way to check the current status? 还有其他方法可以检查当前状态吗?

It sounds like what you need is CEC. 听起来您需要的是CEC。

This thread ("Turn on / off TV via HDMI CEC") appears informative: 该线程(“通过HDMI CEC打开/关闭电视”)看起来很有用:

http://www.raspberrypi.org/forums/viewtopic.php?f=35&t=15749 http://www.raspberrypi.org/forums/viewtopic.php?f=35&t=15749

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM