Python Plugin Philips TV 2016

Python and python framework
Post Reply
User avatar
Brutus
Posts: 322
Joined: Friday 26 September 2014 9:33
Target OS: Windows
Domoticz version:
Location: Heerlen, The Netherlands
Contact:

Python Plugin Philips TV 2016

Post by Brutus » Saturday 22 April 2017 16:57

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?
1x Intel NUC D54250WYK (Windows 7 x64)
1x Aeon Labs USB Z-Stick S2
1x P1 Smart Meter USB
19x Fibaro Modules

GuyTreepbush
Posts: 19
Joined: Thursday 12 January 2017 14:26
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin Philips TV 2016

Post by GuyTreepbush » Saturday 22 April 2017 17:59

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.

miroslavpetrov
Posts: 30
Joined: Wednesday 03 February 2016 14:35
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin Philips TV 2016

Post by miroslavpetrov » Thursday 12 October 2017 14:21

Hello,

I have Philips 49PUS7181 2016 with Android Tv. Can you give some guidance on how to control it from domoticz?
Automation Hardware:
Domoticz on Raspberry Pi 3 with HomeBridge.
Zigbee2MQTT + Xiaomi sensors
Fibaro HomeCenter 2 + Fibaro Dimmer2 & Double Switch2 + Aeon Multisensor 6 + Remotec ZXT-120
Eastron SDM230

cipriani
Posts: 3
Joined: Friday 01 December 2017 20:16
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin Philips TV 2016

Post by cipriani » Friday 01 December 2017 20:51

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.
-------
Sorry for my english, i'm french :)

miroslavpetrov
Posts: 30
Joined: Wednesday 03 February 2016 14:35
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin Philips TV 2016

Post by miroslavpetrov » Friday 18 May 2018 3:30

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
Automation Hardware:
Domoticz on Raspberry Pi 3 with HomeBridge.
Zigbee2MQTT + Xiaomi sensors
Fibaro HomeCenter 2 + Fibaro Dimmer2 & Double Switch2 + Aeon Multisensor 6 + Remotec ZXT-120
Eastron SDM230

mcwieger
Posts: 84
Joined: Tuesday 08 December 2015 10:59
Target OS: NAS (Synology & others)
Domoticz version: 3.7243
Location: Netherlands
Contact:

Re: Python Plugin Philips TV 2016

Post by mcwieger » Wednesday 18 July 2018 15:03

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...
Synology DS414|Zwave.Me RC2|Harmony Elite|Imperihome|Alexa
Aeotec: Stick 5|3x MultiSensor 6|4x Smart Dimmer 6
Qubino: 6xZMNHDD1|4xZMNHAD1|1x ZMNHBD1
Fibaro: 6x FGRM222|3x FGS212|1x FGS223|2x FGWPE
Onkyo TX-NR616|D-Link DCS-825L|Kodi HTPC|SE4000|P1 Cable

QSKONE
Posts: 16
Joined: Monday 12 February 2018 13:56
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin Philips TV 2016

Post by QSKONE » Sunday 21 October 2018 16:52

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():'

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests