Home Assistant able to check if my TV is turned on?

I would love to use the same command inside my Alexa system for switching channels like I do for turning on TV.

At the moment, I say through Alexa routines “Alexa, Channel 1” and Alexa will switch to HDMI1. But if the TV is not powered on I have to say “Alexa, turn on TV” beforehand. Would be cool to have it all combined without the need of saying something extra (goal: “Alexa, Channel 1” powers on the TV and then switches to HDMI1 if the TV wasn’t powered on).

I am using emulated hue switches in my Alexa routines.

Current configuration:

  - platform: template
switches:
 hdmionetwo:
   value_template: "{{ is_state('script.tv_hdmi_one', 'on')}}"
   turn_on:
     service: script.turn_on
     entity_id: script.tv_hdmi_one
   turn_off:
     service: script.turn_on
     entity_id: script.tv_hdmi_two

My scripts use the Logitech Harmony Hub and they send commands rather than starting activities. I stayed away from the Harmony activities because they don’t work well if I accidentally turned off the TV with the real remote (so it is still “on” inside the Harmony activities and can’t “turn on twice”).
So I need a way to

  1. make an appropriate if-condition in this
  2. find a way to let HASS check if my TV is on [Samsung Smart TV].

Any ideas? :slight_smile:

1 Like

Do what anyone with a Harmony should do and lock the device remotes away and then use Activities properly :slight_smile:

I check my TVs status by detecting when it joins or leaves the network but mine is one of the last few that has a proper power button and that may not work with the now normal always on standby type.

1 Like

I check the status of my Samsung TV with the Ping component:

binary_sensor:
  - platform: ping
    host: 192.168.2.36
    scan_interval: 30
    name: samsung_tv_status
3 Likes

I also use ping binary sensor on 2 of my dumb TV’s, one pings the Chromecast and another one pings a esp8266 both connected to the TV’s thought USB.

2 Likes

As a curiosity, what are you using the esp8266 for?

BTW, nice idea … I have a RPi with Kodi powered by USB on my “dumb” TV… will use it to check if the TV is on and make it glow on Floorplan :slightly_smiling_face:

The esp8266 connected to the TV usb port is flashed with esp easy I just use it to connect to my wifi and use ping sensor in Hass since I cant figure out a better outcome for him :smile:

Before having the esp connected to the TV, I used Kodi to update the status, since we use Kodi to watch television 99% of the times Kodi is off or idling for long time the TV is off or nobody watching it, my Kodi’s are installed in Android box and running 24/7 so I had automations looking for Kodi status change to update the TV.
But I find the ping sensor much more accurate.

2 Likes

I was trying to come up with an easy way to work out if the TV is on. Thats so simple that its damned genius!