Polling HDMI CEC status

Well I guess a quick search in the forum would have borught you to tvservice which should do the job.