I’m in the process of developing an integration to connect Gladys to a home’s Android TVs and control them. It will work with the majority of televisions, set-top boxes, and Chromecast devices running Android TV/Google TV.
For now the integration only receives/controls volume values and power on/off.
@AlexTrovato I saw that you worked a lot on this area (TV features in Gladys + TV via broadlink) — I haven’t managed to keep up with everything that’s been done; there are quite a few issues and PRs that talk about TVs (and that an initial version of a remote had been in testing). Can you tell me where we stand on the Gladys side for controlling all TV features? Since I don’t see anything in the dashboard (other than power, volume, channels) I assume it hasn’t been finished yet. Do you need help with anything?
Hi @bertrandda, the remote on the dashboard was abandoned on my end, I don’t think I kept the code.
Today, you can have one line per feature/button on the dashboard.
I was in the process of adding compatibility with Google Home to have voice control.
Ok thanks, to start I’ll do like you and make one line per feature work in the first version. Are you able to display all the features on your dashboard? I took a lot of inspiration from your Broadlink integration, I declared all the buttons but on the dashboard I can only add On/off, the volume slider and the channels
Do you know which version of Android TV is running on it? From what I’ve seen, the local remote API was added in Android TV version 11; I hope you have at least that version and that it will work for you.
I looked a bit more closely at the Broadlink integration — actually I think I misunderstood how the TV works. How do you use the TV features, @AlexTrovato? Can you act on all the features in the Gladys dashboard, or is Gladys simply an intermediary between the physical remote and the TV? Because I’m trying to test, for example, my implementation of the Play button — is it possible to trigger it from Gladys?
For Broadlink, there is a « test » button on the integration page.
But indeed, the remote on the dashboard wasn’t finished due to UI/UX constraints, and I’m not even sure I kept the code on a branch somewhere
Ok thanks, I managed to check the features via the scenes, everything is working correctly. As for the remote control, maybe I’ll try to pick up development again if I have a bit of time, but front-end isn’t my strongest point.
@bertrandda I found a branch with the remote control on the dashboard, it’s very old, I just updated it with the latest version of the code, but I don’t think it works as-is.
I won’t have time to get back to working on it, but if it can inspire you.
Awesome, thanks Alex, I’ll see what I can do with it. It will probably be in a separate PR apart from Android TV but I think people will be interested.
In the meantime, for those who want to test the Android TV service, a first version is available
And on Docker bertrandda/gladys:android-tv
It works for Google TV/Android TV starting from version 11
Could you give me more info about the issues you had when connecting? The code displays but doesn’t work, the code doesn’t display…
Yes, it’s not very clear. You have two options: either you use a widget (to turn the TV on/off and volume only) or you can enable the functions equivalent to the remote control buttons via a scene (you run a scene with a sound that you send through a speaker; for example you can use the MUTE function to trigger your speaker and when it’s finished « send back » the MUTE to reactivate the sound on your TV)
What model of TV do you have? Is it Android TV or Google TV?
On my side I do everything via the emulator available in Android Studio so there may be differences between a real TV/TV box and the emulated system.
You’ll also see that among the features there is one in text format that reports the currently used application. By default it’s the app’s package name so I made a mapping between the package name and the app name Android TV remote service by bertrandda · Pull Request #1829 · GladysAssistant/Gladys · GitHub
If you have other apps installed can you tell me the packages that are displayed by this feature?
For now, this service only allows controlling the TV. But indeed in Home Assistant, they have a service for notifications Notifications for Android TV / Fire TV - Home Assistant so it should be possible to reproduce the equivalent in Gladys
This is indeed the case. It turned out that several codes had been created because once the operation was canceled on the TV, the following codes appeared.
Coincidence or not, the code that worked did not contain any letters, unlike the previous ones.
I will retest as soon as possible.
For the volume, can’t I/you use a controller such as the thermostat?
Normally the code is created and displayed only once when adding the Android TV (before entering the code in the Gladys form) and then manually when you click the « Reconnect » button. Did you press it? I’ll see if it’s possible to know the TV’s status before generating a new code and block it if necessary.
The widget associated with the VOLUME feature is the % widget, like for brightness. However, maybe we can associate the widget you’re talking about with the VOLUME_UP/VOLUME_DOWN feature, I don’t know if that’s possible, I can try
If you have applications like Netflix, Disney+, games… on your TV, can you launch them and tell me what is displayed in the text field? That will allow me to complete the mapping I mentioned above. That way when you launch these apps, Gladys will display « Netflix » instead of « com.blabla.netflix.androidtv » (and you might even be able to use them more easily in scenes)
Greetings!
I just went through the installed applications (mostly default) on my TCL Google TV (running Android 11)
I created a shared file with the texts returned by the integration for each app launched. It would probably be useful for this database to be expanded, so I left edit access open to this document. Maybe @pierre-gilles will prefer to use a system other than Google Sheets…