Page 1 of 1

Python Plugin Philips TV 2016

Posted: Saturday 22 April 2017 16:57
by Brutus
I have been looking at the Wiki page to find new stuff that I can use :) I landed at this page:
http://www.domoticz.com/wiki/Philips_tv

At the bottom of the page there is a section about Philips TV's with android from 2016:

The 2016 Android based TVs from Philips expose a subset of the Jointspace JSON API, however it is protected behind a pairing mechanism. The following features are supported:

Audio parameters control
Ambilight control
Read out system parameters
Send basic RC commands

The pairing mechanism has been reverse engineered and a basic python script to control these TVs can be found at: https://github.com/suborb/philips_android_tv


Is it possible to change this script so it can be used as a Python plugin for Domoticz?

Re: Python Plugin Philips TV 2016

Posted: Saturday 22 April 2017 17:59
by GuyTreepbush
Have been thinking about doing the same. It should not be too difficult what the plug-in should do. Challenge is the auto creation of buttons etc.

At the moment I use the json api to set the volume depening on which source is selected and to turn of the tv when radio is turned on, we go to sleep or left home but 'forgot' to turn of the TV.

I know there are some other tv plug-ins but have no idee what functionality they include.

What would we want the plug-in to do?
- state detection: off/source/Chanel
- turn of (on is not possible via API)
- set volume via slider

There is an app that can basically do all buttons and all this could potentially be added but makes really not fitting the domoticz setup.
Using the Sony tv plug-in as a start already gives manager st of the code.

Re: Python Plugin Philips TV 2016

Posted: Thursday 12 October 2017 14:21
by miroslavpetrov
Hello,

I have Philips 49PUS7181 2016 with Android Tv. Can you give some guidance on how to control it from domoticz?

Re: Python Plugin Philips TV 2016

Posted: Friday 01 December 2017 19:51
by cipriani
Hi miroslavpetrov,

I have looking for this for more than one day...
And finally that's what i've done :
  • Pairing my raspberry to my philips TV with mention script (https://github.com/suborb/philips_android_tv)

    Code: Select all

    ./philips.py --host <IP_ADRESS> pair
     # this should return username:password. Don't forget to enter code mentioned on TV Screen
     
  • Make a shell script in order to execute some command over JointSpace API. Example to put volume to 6 :

    Code: Select all

    curl -s --insecure --anyauth --user <username>:<password> -H "Accept: application/json" -X POST -d  "{\"muted\":false,\"current\":6}" https://<ip_of_TV>:1926/6/audio/volume
     
    JointSpace API documentation is available here : http://jointspace.sourceforge.net/proje ... c/API.html
    In most of the case, just replace http://<ip_of_TV>:1925/1/ by https://<ip_of_TV>:1926/6/
    For ambilight status, HTTP works. No need of HTTPS.
  • For starting TV ON and OFF, I use cec-client commands in my shell

    Code: Select all

    echo "on 0" | cec-client -s 
    echo "standby 0"  | cec-client -s
    
  • Finally, I use a virtual switch in domoticz for my TV, a deamon on my raspberry to check current state of TV and to update it in domoticz, and a lua script to control all of it with os.execute() command.
Just, if you use cec-client you will have to switch manually your TV OFF after rebooting raspberry pi.

Re: Python Plugin Philips TV 2016

Posted: Friday 18 May 2018 3:30
by miroslavpetrov
Thank you very much for your reply. I somehow had missed it and I was just looking again in the forum if someone has found a solution and I saw your reply :D

Re: Python Plugin Philips TV 2016

Posted: Wednesday 18 July 2018 15:03
by mcwieger
Thanks for the info provided.

I have a 55POS9002 (2017) and I believe that year onwards Jointspace is no longer supported. This is the message I get when I connect to port 1925:

Code: Select all

Not Found

The server has not found anything matching the request URI

You can get technical details here.
Please continue your visit at our home page.
Port 1926 gives a Page not found message.

The pairing script still works though...

Re: Python Plugin Philips TV 2016

Posted: Sunday 21 October 2018 16:52
by QSKONE
Philips PUS7150 (2016)

Code: Select all

pi@raspberrypi:~/philips_android_tv-master $ ./philips.py --host 192.168.31.7 pair
bash: ./philips.py: Permission denied
pi@raspberrypi:~/philips_android_tv-master $ chmod u+x philips.py
pi@raspberrypi:~/philips_android_tv-master $ ./philips.py --host 192.168.31.7 pair
from: can't read /var/mail/__future__
from: can't read /var/mail/base64
from: can't read /var/mail/datetime
./philips.py: line 4: import: command not found
./philips.py: line 5: import: command not found
./philips.py: line 6: import: command not found
./philips.py: line 7: import: command not found
./philips.py: line 8: import: command not found
from: can't read /var/mail/Crypto.Hash
from: can't read /var/mail/requests.auth
./philips.py: line 11: import: command not found
./philips.py: line 20: syntax error near unexpected token `def'
./philips.py: line 20: `def createDeviceId():'