eslavnov / pylips

Control Philips TVs (2015+) and Ambilight (+ Hue) through their reverse-engineered API (+ MQTT support!)
MIT License
342 stars 60 forks source link

[FEAT] send text to TV #56

Closed busshi closed 4 years ago

busshi commented 4 years ago

Hello, I would like to send notifications on the TV screen. It is possible because there is a command to send text but it doesn’t work for me.

I have an Echo device and if I use the Alexa app in the TV to pair both devices (Alexa and TV) I can see notifications on the screen when I turn the TV off for example, the TV writes something like Goodbye on the screen. It could be very useful for those who do home automation (alarm for example...).

Does somebody know how this command works ?

I don’t know how to use a sniffer to catch the trafic but I think it is possible. If someone could help for that... Thanks

popy2k14 commented 4 years ago

I am using "Notifications for Android TV" see the fhem thread here: https://forum.fhem.de/index.php?topic=83065.0

With this i am sending notifications to my android tv since a year without any issue.

busshi commented 4 years ago

Ok i am gonna try this. I had an Android phone before and I used newtifry to get notifications from pushingbox service (1000 free requests per day!!!). I will try your app...

popy2k14 commented 4 years ago

The App i mention works local, without any cloud :-)

busshi commented 4 years ago

Waow really nice but is it possible to send notifications with url ? Or I have to own an Android phone for this to work ? I want to send notifications from my raspberry when a sensor triggers...

popy2k14 commented 4 years ago

yes! My local installation of fhem (running on rpi) is sending local requests to the tv ip address over my local network. Please see the source code of the fhem module here https://svn.fhem.de/trac/browser/trunk/fhem/FHEM/37_NotifyAndroidTV.pm

I think you can figure out how to "curl" local requests to send a notification :-)

busshi commented 4 years ago

Thanks for the informations. I installed this app fine, but at the end they say I have to continue setting up in an android phone or tablet. I don’t have any of this ! I have the option to manually set up, they says to go at this url : http://IP_TV but nothing appears... I try this url from the TV browser, same error... So I look into the code to find a way to curl : I try To send a test notification but nothin appear (no error with curl but nothing appear on the TV) : curl -X POST http://IP:7676 -d '{"message":"coucou","title":"test","data":{"fontsize":"large","position":"center","duration":2,"transparency":0,"color":"red","interrupt":1}}'

Do you have any idea ? What am I doing wrong ?

busshi commented 4 years ago

So apparently it is not possible to use this app without having an Android mobile or tablet according to the developper. I have to find another way...

popy2k14 commented 4 years ago

Take a look at PipUp:

https://play.google.com/store/apps/details?id=nl.rogro82.pipup https://github.com/rogro82/pipup https://forum.fhem.de/index.php/topic,106363.0.html

Good luck

busshi commented 4 years ago

Nice Popip does the job very well ! 👌 Thanks a lot

popy2k14 commented 4 years ago

Nice that it's working for you!