Philips Android TV component

yes, i have it

The response itself is: {"values":[{"value":{"Nodeid":2131230774,"Controllable":true,"Available":true,"string_id":"Switch on","data":{"value":false}}}],"version":0}, where "value":false means Ambilight + Hue is off and "value":true - is on.

EDIT: wait, I’ve just realized: http://192.168.1.28:1925/6/ambihue_status is wrong. It should be a POST request like this one: Settings menu update (POST) · eslavnov/pylips Wiki · GitHub

Does python pylips.py --host %your_ip% --command ambihue_status work for you?

python3 pylips.py --host 192.168.1.28 --command ambihue_status

Sending POST request to http://192.168.1.28:1925/6/menuitems/settings/current

<html><head><title>Service Unavailable</title></head><body>Service Unavailable</body></html>

Request sent!

@warcanoid thanks for this and for the PM, I’ll look into it!

I can confirm the ambihue on/off command is working on the PUS7101/12 Model. Thanks @gyrga!

1 Like

@gyrga Just tried Pylips on my Philips TV and it works perfect! Thanks so much for the work, especially the control of Ambilight + Hue is very nice!

Just have one question: The python script works without any problems on my mac, I just needed to install dependencies and used pip3/pyhton3 to start the commands in Terminal - But how do I get this working on my Rasperry Pi Hassio? I copied the pylips.py in config/python_scripts and tried to install the dependencies via the SSH & Web Terminal Add-on, but get always an error:

How can I get the dependencies installed?

Sorry for the late reply - I’ve been moving and it took all my time… Unfortunately, I don’t have Hassio (precisely because of issues like this). I am pretty sure that it should be easy to fix, but since I can not test it I don’t have any advice for you, sorry! If you figure it out, please share the solution and I’ll add it to the Readme. Thanks!

Hi. Instead Python3, I would suggest to use Python2 (that helped me). Then I followed these steps

Hi,
I installed the script and can control the TV from the Hass dashboard.
Now I want to make a scene to change the source to Plex, but nothing happens.
What am I doing wrong here?

scene:
  - name: Mattias
    entities:
      media_player.tv:
        source: Plex

This is in the states section:

media_player.tv
media_content_id:
is_volume_muted: false
app_name: :iphone:
supported_features: 23997
source: :iphone: Plex
media_title: Plex
friendly_name: TV
media_content_type: app
volume_level: 0.25
source_list: :iphone: File Explorer,:iphone: Deezer,:iphone: Play Movies & TV,:iphone: Dailymotion,:iphone: Kodi,:iphone: MeteoNews.TV,:iphone: Manage apps,:iphone: How to…,:iphone: Cinetrailer,:iphone: Termux,:iphone: GameTreeTV GOLD,:iphone: SPB TV,:iphone: Help,:iphone: Cloud Explorer,:iphone: Install channels,:iphone: Videoland,:iphone: ES File Explorer,:iphone: BrowseActivity,:iphone: Plex,:iphone: Opera Browser,:iphone: ARTE,:iphone: Social TV,:iphone: Wireless and networks,:iphone: France24,:iphone: Popcorn Time,:iphone: Play Games,:iphone: App Gallery,:iphone: Update software,:iphone: Demo me,:iphone: Euronews,:iphone: App Starter for Netflix Button,:iphone: TV,:iphone: Settings,:iphone: Spotify,:iphone: Play Store,:iphone: Recordings,:iphone: Top picks,:iphone: VLC,:iphone: iConcerts,:iphone: TV5Monde,:iphone: Play Music,:iphone: Prime Video,:iphone: Developer Tools,:iphone: Media,:iphone: QuickSupport,:iphone: YouTube,:tv: Play Movies & TV

Thanks in advance!

Inlcude the icon and a space
:iphone: Plex”

Use the automation or script editor to put it in. Because yaml does not support the emojis, and the editors convert it automatically for you

Hello,

Where can I find those? I’m very new to this, sorry.

you can install the dependencies via apt-get (which is probably better anyway):

sudo apt-get install python3-crypto python3-requests

I changed the emoji the ‘APP_’, but now I’m getting an error:
reproduce_state: Unable to reproduce state &lt;state media_player.tv=select_source:APP_ YouTube

I opened a thread for it here, not to clutter this one: Set scene to change TV source

I added a better description of how to write scripts to change sources. Hope that it helps

so any chance that the pairing process will be built into the component in the future? From my understanding, skimming of the code and this thread that should be possible to accomplish right?

Awesome, thank you for the description and the great work on this script!

So I’m going to post a noob question here, maybe someone can point me in the right direction. I’ve been trying to make this work in the field below the IDE in Home Assist via the browser.

This looks like it’s working but I can’t get past this. I tried python as wel but it doesn’t seem to run Python3 for some reason

   philips_android_tv git:(master) ✗ python2 philips.py --host xxx.xxx.x.xx> pair
Traceback (most recent call last):
  File "philips.py", line 6, in <module>
    import requests
ImportError: No module named requests

Am I doing it all wrong? I tried to install Python 3.7 on my Windows laptop but it does’t make any sense to me (none of the commands work, it just sticks with >>> in the commandline).

Look at step 2

means it is in python shell mode
Python Interpreter: Shell/REPL

You need to install the “requests” pithon module (“pip3 install requests” or equivalent on Windows)