Platform not found: sensor.ping

I never thought of pinging the TV to see if it’s on, since there’s no tele/state from it. D’s post gave me the idea.

So, I added this to my sensors.yaml file:

  - platform: ping
    name: OfficeTV
    host: 192.168.1.31
    scan_interval: 30

But Check Config reports:

Platform not found: sensor.ping

What am I missing?

Ping is a binary sensor, not a sensor :

Thanks- That works. I didn’t realize that they were different components.
My setup is similar to yours where I am using Broadlink to send IR commands from Home Assistant. Since “On” and “Off” are the same IR code, it will be nice for HA to know if the TV is on or not.

Have you figured out how to change the channel on the STB from Home Assistant/Broadlink?

I havn’t tried to be honest as my TV has a web API (the LG WebOS) the only reason i’m using the broadlink for on and off is that the powering on isn’t reliable via the API (something a bit hinky with the wake magic packet i think).

It should just be a matter of programming the broadlink to use the correct button presses… but it could be complicated as it would have to know where you are starting from (as in what input you are on)…

What TV do you have?

Edit: Just re-read and noticed you said STB… principal should be the same though… you’d just have to get the codes for the channel you want… My STB is a Zgemma and so again has a Web API i can plum in to … so i just have “cbeebies” as a switch (it’s a kids channel) in HA and it sends the command to my STB to change to that channel… just have to already be on the right input on the TV but again, i could sort that using the TV’s API if i wanted to…

I also have an LG with WebOS, but I couldn’t ever get the API to work. What is the secret?

All i have for mine is this :

- platform: webostv
  host: 192.168.2.230
  name: Living Room TV
  timeout: 5
  turn_on_action:
    service: switch.turn_on
    entity_id: switch.front_room_television
  customize:
    sources:
      - FREESAT
      - KODI
      - XBOX
      - YouTube

once you have it talking to HA, you can get the names of the sources from the developer section…

Thanks, I’ll try that.
How do you turn on the TV if the IP for the TV is not valid when it’s off?

Never mind- Since it’s on Ethernet, ‘Wake on Lan’ must be working.