its just the state attribute so: {{states("media_player.livingroom_tv")}}
works for me and returns ‘on’
You might be better off doing a negative check for ‘off’ - I need to confirm, but I think at times, if I’m chrome casting, or in smart tv, the state might not be ‘on’ but something else. I need to test/confirm this though so I can raise an accurate issue if that is the case
e.g.
{% if is_state("media_player.livingroom_tv","off") -%}
off
{%- else -%}
on
{%- endif %}
Its connected through wlan, but want to get the real status. not a reply from a ping. i am making an automation that sends me a message on the TV when its on and a certain motion sensors goes off when my child is in bed.
Just a small info for everyone using this great component and also wants to have the new input option for TV source for homekit ( Homekit new options TV Source ):
it seems like the custom icons and for apps and tv channels are not recognized by iOS and the list of sources will be empty. Removing them or replacing with some standard characters does the trick and you can have a nice shortcut for switching between different apps / channel directly from iOS control center.
Great work @nstrelow !!!, just installed it here, after installing a debian server just to get the user / pass pulled
I’m just dabbling with it so far, but the source list refreshes all the time, so I can’t scroll down through it.
I have an older 2016 Philips tv (40PFT5500/12) in the bedroom, so it would be nice to have that properly integrated.
One of the annoying things about my TV is that you can’t select the HDMI / TV input directly, but have to scroll through list of inputs, I was hoping it could be solved with this, but that doesn’t seem to be the case.
but the source list refreshes all the time, so I can’t scroll down through it.
Hmm, the function the refresh the source list is executed quite often, but the last time I used it, it did not refresh the list UI. Sadly I my TV is at a friends place, as I am away for a year. Will be back with my TV probably in March sometime. Sorry for that.
One of the annoying things about my TV is that you can’t select the HDMI / TV input directly
That is something I would have loved too, but I think not even the app can do it.
Best way to do it for me, is to hook up a device (a RPI with homeassitant running on it in my case), which supports HDMI-CEC. The HDMI-CEC component is a bit buggy, but often it works when switching.
(The RPI sends a HDMI-CEC request trough HDMI and tells it to switch to HDMI 3 for example)
but shouldn’t the .txt file be changed and have version 2.21.0 in stead of 2.13.0? or is that too simple. I see that the file dates back to 2017. I wouldn’t know how to do this!
Thanks for the work you put in the custom component! The component recognizes my PSUS 8303 TV and everything works fine for me except the wake on lan feature. I guess it is my TV though:
It just turns off ethernet and wifi interfaces after I press the power button on my TV remote. I have all energy saving options turned off and wakeOnWlan turned on. Even if I configure the TV to keep the internal chromecast available it woult turn off… It seems to me that this is buggy on some phillips TVs… at least I read about a lot of similar problems. Maybe someone reading here has a hint for me? Nevertheless, I solved the “wake” problem with a IR blaster now.
I was able to switch input sources by sendind input keyevents via adb to the TV, but I cannot use the androidtv component, because it always disconnects from the TV when powererd off. Is there a way to send adb commands through this component in the future maybe? I might try to look into it myself, I have programming experience but I am not familiar with all the APIs and I don’t have the free time at the moment.
what is the secret to getting the Philips TV to show as a TV in HomeKit? when I try to add it I just get a bunch of switches! are you able to explain this all?
in configuration.yaml i have set what domains to include with include_domains and with entity_config I set feature: on_off for the tv so I get only the power switch added to homekit.
media_player.philips_tv:
device_class: tv
source_list:
- _ HBO GO
- _ Kodi
- _ Netflix
- _ YouTube
- _ TV
This adds the source list in the “Input” selector from homekit. Note that I modified the component to use “_” instead of the custom icons for tv and apps.
I forgot one important step.
I removed the media_player domain from homekit, restarted homeassistant, and re-added it so it is recognized as device_class tv. Because you had it without device_class before and it does not refresh in homekit.