Philips Android TV component

@gyrga again: Forbidden :frowning:
@nstrelow opened the app, select tv, find tv with ip adress, and tv control was there, without code/pin

@warcanoid Now I am totally lost, this does not make any sense to me :frowning:

How comfortable are you with computers in general and how bad do you want to get this working? :slight_smile: I can potentially walk you through setting up a proxy to capture and decrypt the traffic between the iPhone app and the TV - then we’ll definitely know what’s going on and I’m 99% sure we’ll be able to solve your issue.

Besides that I’m all out of ideas… Maybe somebody else has any other thoughts?

@gyrga I want it really much! Let’s do all what’s needed! I have few experiences with proxy, had to listen with Charles between sonoff device and mac, to get the key.
The ios app show json version is 5, maybe this is also problem?

@warcanoid nice, I like your spirit! :slight_smile: Then I need you to do the following:

  1. Reinstall the iOS app (we need to start from scratch to figure out how it pairs to your TV)
  2. Connect your iPhone to Charles
  3. Pair the TV and the iOS app and press some random buttons (like changing the volume, for example)
  4. Save the captured traffic in Charles and share it with me

I’ll then analyze the traffic and we will know for sure what’s going on.

@warcanoid Please also install Charles’s certificate on your iPhone (http://www.charlesproxy.com/getssl) and enable SSL proxying from all locations in SSL proxying location settings in Charles => we need these steps to decrypt the traffic between the iPhone and the TV.

EDIT: I’ve just realized something - your TV does not have Android, does it? It will explain why the pairing does not work. We still need to capture the traffic to get it working, but at least this starts to make some sense…

@gyrga have sent you the data in personal message. I have deleted the app, and then when i started it, at bottom pop up windows, paired tv 55pus… I have also tried od ipad, same result. Tv has some weird version of android, can not find it to be sure.

@warcanoid Thank you, this is really useful! Looking at your data now, I think I start to understand what’s going on. Can you please do two more things:

  1. Go to http://192.168.1.28:1925/6/audio/volume in your browser, do you get any response?
  2. If you go to settings on your TV do you see an item “Android settings”?

Thank you again for investing your time!

@gyrga

  1. I get:
    {
    “muted”: false,
    “current”: 42,
    “min”: 0,
    “max”: 60
    }

  2. No android :slight_smile:, is it still possible to do it?

@warcanoid Awesome, thank you a lot! Yeah, it seems that there are two versions of the API: 6.1 - (non-Android) and 6.2 (Android TVs). Good news: I can make it work for you. Bad news: since I don’t have this TV, you’ll have to test an updated tool and tell me which commands work and which do not => then I’ll make a public version for everybody. I’ll pm you a link with an updated test version later today.

UPDATE: Seems like 6.1 can be with Android too…

@gyrga thank you very much!!! :partying_face:

Ok, so I’ve updated my tool to support both Android and non-Android Philips TVs (thanks to @warcanoid) and I also continue to add new commands (70+ so far), as well as updating the API reference.

@nstrelow, could you perhaps update your component to add support for non-Android TVs? It would allow people like @warcanoid to also enjoy your component! The changes are minor:

  1. No pairing required
  2. No authentication when sending requests (so no username/password)
  3. Http instead of https
  4. Port 1925 instead of 1926

Alternatively, here is how you can use my tool with Home Assistant:

  1. Add this to your configuration.yaml (change the path to your actual path to the script):
    shell_command:
       mute: python /home/homeassistant/helper_scripts/pylips.py --host %tv_ip_address% --user %username% --pass %password% --command mute

  2. Add this to your scripts:
    mute:
      sequence:
        - service: shell_command.mute

  3. Add this to your switches:
    mute:
      turn_on:
        service: script.turn_on
        entity_id: script.mute
      turn_off:
        service: script.turn_off
        entity_id: script.mute

This will give you a “mute” switch and you can use the same approach for any command…

By the way, has anyone tested “Ambilight + Hue” command yet? I want to make sure that it works on all TVs and not only on mine.

2 Likes

Hi @gyrga, I’ve tested “Ambilight+Hue” command and it works perfectly. There is only one question what would be the response that I need to include in the value template for command line switch if it is “on”, so it would be possible to have a real status for command line switch?

1 Like

Thanks for the feedback, glad to hear that it works!

I have future plans to implement an MQTT server support that will allow getting and storing real-time statuses to use in HA sensors and switches - that’s what I’ve been personally using for the last couple of years, but I need to rewrite it to generalize it and make it scalable. I would expect it to be ready some time mid-January.

GREAT WORK @gyrga. THANK YOU!
@Molodax I made a sensor for power state:

1 Like

@warcanoid Oh, thanks for sharing this! I totally forgot about the command line sensor in HA! I’ll update the tool so it gives a clean response that is easy to use with the command line sensor - that would be faster than integrating MQTT…

1 Like

Actually, my question was about command_line SWITCH. There is a possibility to include status check and as far as I can see there is a command ambihue_satus. My question is what response provide this command in the command line in case of ambilight+hue is on. I use Hass.io and it makes it very complicated to see what is the response when I send ambihue_status

Thanks, I get it! Right now my tool returns some feedback info like “sending a POST request” apart from the response itself, which will probably make the command line sensor a bit hard to setup (I’ll check it later). I’ll fix it in the coming days and then you’ll be able to use the command line sensor with my tool. I will also share an example of how to set it up!

(command line sensor/command line switch status are both affected by this)

@gyrga ambihue_status: Forbidden

http://192.168.1.28:1925/6/ambihue_status

Sorry for confusion, the question is about command_line SWITCH.What is in the response itself?

@warcanoid do you have “Ambilight + Hue” option in the TV / official app?