Philips Android TV component

HI,

i have a 55pus8503 and I was able to connect it to home assistant. but I only get the media player button. I am not able to get anything else.

What I am really searching for is a way to determine if the tv is powered on.
Is there a easy way to get this done?

i am not able to find it here.

Thanks!

try pressing on the 3 vertical dots icon on the right hand side of the media player card

Yes that works, any way to just get the powerstate? I want it in an automation.

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 %}

Thanks it worked,

I am still testing but for now it got the following states back:
TV on = On
Tv off = Off
Tv in apps = idle

i need to further test to see what other status i get back, if i have done this i will share it here.

1 Like

Is your TV also connected via LAN or WLAN? If so: you could check the online status that way.

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.

Migrated to HACS! (Replacement for custom_updater)

Also changed the repository name to ha_philips_android_tv.

You can find it now under:

3 Likes

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 :iphone: and :tv: 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.

Hia!
This is a Great job !!!
Just to let you know that the latest version gets HASS stuck(tested in docker and hassbian).

Tested several apps and the status stays idle.

So the 3 options we got here is as mentioned above.

TV on = On
Tv off = Off
Tv in apps = idle

Great work @nstrelow !!!, just installed it here, after installing a debian server just to get the user / pass pulled :slight_smile:
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.

Glad it mostly works for you.

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)

can someone help me out here: i get the following message when trying to do the following command:pip3 install -r requirements.txt

and at the end the following:

not sure what to do. Any help would be appreciated!

maybe consider using a virtualenv to run it!
https://virtualenv.pypa.io/en/latest/

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.

Greetings and thank you again!

Hi Chelule,

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.

homekit:
  filter:
    include_domains:
      - media_player
      - light
      - switch
      - alarm_control_panel
  entity_config:
    media_player.philips_tv:
      feature_list:
        - feature: on_off

and in customize.yaml I have

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.

1 Like

Thanks for sharing, I followed your example and configured my customise.yaml as below:

media_player.tv:
  app_name: TV
  device_class: tv
  source: ABCComedyKids
  source_list:
  - _ ABC iview
  - _ Netflix
  - _ Plex
  - _ Stan
  - _ TV
  - _ TV Guide

And my configuration.yaml as:

homekit:
  filter:
    include_domains:
      - alarm_control_panel
      - light
      - media_player
    include_entities:
      - binary_sensor.front_door
  entity_config:
    media_player.tv:
      feature_list:
        - feature: on_off
        - feature: play_pause
        - feature: play_stop
        - feature: toggle_mute

After re-adding the bridge in Homekit it still see my devices as switches and not as a TelevisionMediaPlayer icon.

Have I missed anything?