FD- / RPiPlay

An open-source AirPlay mirroring server for the Raspberry Pi. Supports iOS 9 and up.
GNU General Public License v3.0
4.93k stars 353 forks source link

Implement support for LG smart TVs off function #207

Open alecsandes opened 3 years ago

alecsandes commented 3 years ago

Hi,

I really like your work and I use the RPiPlay frequently. I was glad to use the CEC-support fork of this project though I stumbled on the issue that LG doesn't support power off via CEC. I have found a resource that can help me with the issue, a python script that can power off my tv. I was wondering how can I implement this in this project as a fork for LG TVs?

https://www.domoticz.com/wiki/LG_2012_smart_tv

I have made a bash script using this pyscript to alert my family back home to pickup the phone:

!/bin/bash

checksts="echo 'pow 0.0.0.0' | cec-client -s -d 1 | grep 'power status' " status=$(eval $checksts)

if [ "$status" = "power status: on" ] then for i in {0..50} do python3 /home/pi/apps/LGPWR/lgpwr.py "25" done

for i in {0..5} do python3 /home/pi/apps/LGPWR/lgpwr.py "24" done

cvlc -A alsa,none --alsa-audio-device default --play-and-exit --no-osd --no-version --run-time=10 /home/pi/apps/LGHey/alert.mp3 python3 /home/pi/apps/LGPWR/lgpwr.py "1" fi

if [ "$status" = "power status: standby" ] then echo 'on 0.0.0.0' | cec-client -s -d 1 sleep 5 echo 'p 0.0.0.0 1' | cec-client -s -d 1 sleep 5 for i in {0..50} do python3 /home/pi/apps/LGPWR/lgpwr.py "25" done

for i in {0..5} do python3 /home/pi/apps/LGPWR/lgpwr.py "24" done

cvlc -A alsa,none --alsa-audio-device default --play-and-exit --no-osd --no-version --run-time=10 /home/pi/apps/LGHey/alert.mp3

python3 /home/pi/apps/LGPWR/lgpwr.py "1"

fi

So you see, I use partially cec-client and partially the python script.

My knowledge is still limited but I would gladly take this if guided.