Join now - be part of our community!

How to get notifications from Android TV to smart home controller

profile.country.CZ.title
Esaras
New

How to get notifications from Android TV to smart home controller

Hi,

 

i have upgraded to Sony OLED android tv recently and i am trying to solve one big issue with smarthome integration. I need to get notifications from android TV for different events such as running app changed to xxx, volume changed to value, tv is shutting down etc. Had LG OLED WebOs TV previously and TV had two-way websocket interface. So when i subscribed topics i wanna receive, tv was sending those notification messages to my smart home controller over that websocket.

 

I am programmer, so i can do lot of things, but want ask you guys, if there is any possibility to get those messages from tv by native. I was looking documentation and there is one way only 2interface, where i can send commands to TV. Problem is, for example, when i change volume on remote controller, i do not get this information to my smart home controller and cant update volume on my smarthome wall tablet or react on this event other way, or when netflix is started (or running movie), my lights automaticly turn off/dim. (btw. this works well for installed KODI, where i have driver for my smarthome controller).

 

So only idea i had for now is to create service, which will be running directly in TV, it will provide REST/SOAP interface and will be managing those subscriptions. I have no idea if that is possible due to security. Is my app running at android tv get information about running applications etc?

 

Was hoping, that android tv will have solved such basic functionality, since it is smart tv and android was always opened platform, but it seems, i was mistaken.

 

If someone was having same issue, i would be glad if you give me some tips, otherwise i am going to write it by myself from blank.

 

Thanks,

M.

 

3 REPLIES 3
profile.country.GB.title
HannahEd01
Community Team

Hi Esaras, Sony only guarantees basic operations (turning on/ turning off, etc) with Alexa for example. What's the model of your TV? And the smart home system that you're using, maybe then I can find something for you.

profile.country.CZ.title
Esaras
New

Hi, 

 

thanks for answer!

 

I have Sony Bravia OLED KD-65A8, my smart home controller is Athom Homey Pro 2.0. My controller allows to run nodejs applications and device drivers, so there is not problem to script something, i programmed my LG WebOS TV driver too. I can even create background application for android tv, but has no experience with that, so i need to know, if my running android background service can get events like volume changed, focused application has changed etc. I can imagine, those events can be blocked due to security measures for example. If i can get those events, background service will forward those events through REST api to my smart home controller.

 

Basicly, i dont wanna pool for data, i want event driven communication. I can recognize if TV is on/off by power consumption change on wall plug (or when it connects to wifi, i can get this event to my smarthome controller too).

 

Problem is, i need to react when running application is changed, volume is changed etc. in real time (or near realtime). There is kodi driver for my controller i can get events like kodi hibernated/started/screensaver on/off, movie started/stopped playing, next episode started etc. I know, i can't get same functionality for example for netflix, because it needs to be supported by application directly, but i need basic information at least, such as application started (or became active ), volume changed, channel changed etc. 

 

Any existing solution would be great. I can't believe no-one was solving same issue already, because it seems like basic smart home integration functionality to me. That functionality should be native since its smart TV, especially with android tv inside.

profile.country.GB.title
HannahEd01
Community Team

Hi, I tried to find something to help you but nothing on the Manual mentions this at all. I'm sure you'll find another user that has more experience with this.