philips tv with domoticz

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
stevefury
Posts: 2
Joined: Tuesday 04 June 2019 11:15
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

philips tv with domoticz

Post by stevefury »

hi all,

Im now using domoticz for 2years and now I want to share some work of me I did for my philips oled803 television.
I searched for controlling my tv in domoticz but I didnt find what was needed.
After some time looking on the net I found eslavnov python script Pylips.
Working with it and after some testing We where able to control my tv in terminal.
But i wanted to have it working from domoticz but again nothing to find how to implement that.

So I did give it a shot, im not a programmer so the code maybe isnt that good, but it works.

I want to help all the people to integrate the tv.

This is my how-to!

In terminal:

-cd domoticz/scripts

-git clone https://github.com/eslavnov/pylips.git pylips //clone all files to scripts

-cd pylips //enter the map you just download all the files to

-sudo nano settings.ini //go into this file

-fill in and save: [TV] // the rest is filled in automatiq after the auth
host = 192.168.1.***

-python pylips.py // run this when your tv is powered ON and then you recieve a 4digit code,

fill that code in terminal.
now you get a username and password in return. Save that somewhere!

-sudo nano settings.ini //run again, now you see all settings are filled in, then your good!

-sudo nano tvphilips.sh //make this file and save this inside with your username and password.


-paste the script below in the file and fill in your host,username and password in and save it:

#!/bin/sh

# make sure we're running as the user

RUN_AS="pi" # Enter username here

if [ "$USER" != "$RUN_AS" ]
then
echo ""
echo " This script must run as $RUN_AS, trying to change user..."
exec sudo -u $RUN_AS $0 $1
fi

echo $1

case $1 in
standby)
python3 /home/pi/domoticz/scripts/pylips/pylips.py --host 192.168.1.*** --user <username> --pass <password> --command standby &
exit 0
;;
power_on)
python3 /home/pi/domoticz/scripts/pylips/pylips.py --host 192.168.1.*** --user <username> --pass <password> --command power_on &
exit 0
;;
mute)
python3 /home/pi/domoticz/scripts/pylips/pylips.py --host 192.168.1.*** --user <username> --pass <password> --command mute &
exit 0
;;
volumeup)
python3 /home/pi/domoticz/scripts/pylips/pylips.py --host 192.168.1.*** --user <username> --pass <password> --command volume_up &
exit 0
;;
volumedown)
python3 /home/pi/domoticz/scripts/pylips/pylips.py --host 192.168.1.*** --user <username> --pass <password> --command volume_down &
exit 0
;;
*)
exit 1
;;
esac


-sudo chmod +x /home/pi/domoticz/scripts/pylips/tvphilips.sh //make executable

-now make a dummy switch in domoticz on/off or selector
and put this commands in on/off

script:///home/pi/domoticz/scripts/pylips/tvphilips.sh standby
script:///home/pi/domoticz/scripts/pylips/tvphilips.sh power_on
script:///home/pi/domoticz/scripts/pylips/tvphilips.sh mute
script:///home/pi/domoticz/scripts/pylips/tvphilips.sh volumeup
script:///home/pi/domoticz/scripts/pylips/tvphilips.sh volumedown



more details and commands in this github page:

https://github.com/eslavnov/Pylips#setting-up-pylips
Attachments
philipstv.JPG
philipstv.JPG (161.47 KiB) Viewed 2648 times
Dingetje2004
Posts: 20
Joined: Saturday 04 June 2016 8:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: philips tv with domoticz

Post by Dingetje2004 »

Thanks to this hero (Stevefury) it is working!

1hr of Steve's time was spent on tweaking the code on my pc with teamviewer.

Finally he got it working.

Check the path very well, because that was my issue! Mind that you probably have 2 times Pylips in the path one time mentioned as a folder and one time mentioned as the file name.
Thanks Steve again!

Anyone who uses this script and has made some nice scenes or combinations?
User avatar
waltervl
Posts: 5152
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: philips tv with domoticz

Post by waltervl »

If you feel you want to expand your programming skills some more you can make a plugin out of this.
See for example https://github.com/GameDevHobby/Domotic ... bOS-Plugin

On the wiki there is an guide also with some example plugins. https://www.domoticz.com/wiki/Developin ... hon_plugin
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
tjabas
Posts: 564
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: philips tv with domoticz

Post by tjabas »

thank you for that guide but for a noob like me that programming seems a bit dificult, is there another way to just install this and do the settings in domoticz? mabee another plugin?
tjabas
Posts: 564
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: philips tv with domoticz

Post by tjabas »

i have now installed it as the description says, but it doenst work, is this plugin still working?
User avatar
waltervl
Posts: 5152
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: philips tv with domoticz

Post by waltervl »

What happens if you just run the python commands in a terminal window when standing in the folder where the pylips library is.
For example below (change the values to your situation)

Code: Select all

python3 pylips.py --host <TV-IP-address> --user <username> --pass <password> --command power_on
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest