[BETA] AndroidTV Notifier

A very small driver that provides "notification" capability to your TV (running Android) expanding the notification ability of your HE! It requires the install of a server component that runs on your TV and a small driver on HE.

Features

  • Ability to raise notifications to your TV (running Android) from within your HA rules
  • Preferences to configure where your notification should appear on the screen and font size
  • Sound notification and duration of how long the message should appear on the screen can be controlled by the Notifications for Android TV server component.

Setup

(a big thank you to Christian Fees who wrote this application - without it, this little driver and notification capability wouldn't have been possible!)

You do not need to install or configure anything on your mobile device for this to work. The server component effectively acts as a listener to the HE and throws up notifications onto the TV.

  • On your HE, add the androidtv_notifier_driver.groovy to your drivers code section and click save.
  • Create a virtual device setting the type to AndroidTV Notifier Driver.
  • Enter the IP address of your AndroidTV
  • The name of the notifier (title of the notification), screen position and font size have default values - feel free to change.
  • Click Save Preferences

To test all is working, within the device enter a message and click the Device Notification button.
Screenshot 2021-03-21 at 15.14.34

If all is working then your message will appear:

Hope you find this useful. I was looking for something like this yesterday and couldn't find anything so knocked this up.

Enjoy!

16 Likes

Thanks for this! I will use it to send notifications to areas where ambient noise levels (home theater equipment) is too high for audio notifications and for "silent" notifications when appropriate.

1 Like

This looks pretty useful. Thanks for that. Wonder if it works with a firestick....

1 Like

I think it could - just need access to the Google Play AppStore. The app you install from there says these devices are supported:

Supported devices: Nexus Player, Nvidia Shield, Philips Android TV devices, Sony Android TV devices, Xiaomi MI Box 4K and other Android TV devices.

Let us know how you get on (my TV is in use so can’t check on my stick).

1 Like

Hopefully I'll get half an hour to myself to give it a shot. As soon as I do, I'll update.

Cheers.

adds to never-ending list

1 Like

Very Cool! There is a PushTV app that works with pushover, but of course it's not free.
and it is troublesome getting it to keep running in the background with the newer chromecast with google TV. I will be trying this out for sure.

2 Likes

I'm not getting any sound with the notification. Is this working for you?

Sound is controlled from within the AndroidTV application that you install onto your TV. It works for me and I believe was enabled by default - worth checking.

I was using Pushover + PushTV to handle this previously, but I like this solution a whole lot more. Quick testing this morning reveals that the TV notificatoins appear much more quickly since they are generated directly by Hubitat->Chromecast w/Google TV, as opposed to making the round-trip to Pushover + waiting for push notification.

In short, I plan on converting my TV-based notifications over to this approach as soon as I click reply.

Thanks a ton!

1 Like

My experience with Pushover+PushTV has been the same as yours: "Mostly works".

Every once and awhile, I tend to receive PushTV notifications in bunches. I've always assumed (as you suggested) that the PushTV application is getting terminated in the backgroun by Android. But even when I'm receiving notifications normally, my experience is that it still takes a few seconds to get from Hubitat->Pushover->PushTV.

I'm expecting that since this cuts Pushover out of the middle that the notifictions will appear closer to real-time. And I'm hoping that the TV-side application is a little more friendly to the OS and doesn't get terminated in the background.

Side thought: I wonder why Android doesn't have an ability to flag specific applications to not be terminated in the background, similar to the ability for us to disable Battery Optimizations for specific applications. Would improve implementations such as this that require a background application.

So far so good, installed and tested. I get no sound even though the app settings are set to high volume and long notification length (which doesn't seem to change the length noticeably over the short setting). Thanks for the app. -Joel

1 Like

Ok, I have this implemented. Some commentary and perhaps a feature request. :slight_smile:

The Google TV app has a checkbox for "allow notification to turn on TV", but it isn't working for me on Chromecast w/Google TV. The CCGTV is able to turn my television on with HDMI-CEC (ie, hitting "Home" on the CCGTV remote when the TV is off does indeed turn it on) so it would be great if it's possible to make that work.

That said, I'd rather see this the above implemented as an "On" (and if possible, "Off") command on the driver itself. That would make it trivial to separate the On/Off vs the Notify actions in Rules, etc.

Do you know if the Google TV API the TV-side app this uses even has the ability to command CCGTV to send HDMI-CEC on/off commands?

1 Like

Certainly for my Sony TV (KD-55AG9), having the TV off and sending a notification to it, it would switch on. I disabled that within the AndroidTV app.

I think for what your wanting to do, may be another driver can provide this ability... on, off and other commands.

https://community.hubitat.com/t/release-sony-bravia-tv-rest-control/

I'll look at the driver you linked, but won't that be specific to Sony Bravia? I have a Chromecast w/Google TV on the TV I was hoping to use HDMI-CEC to turn/off, not a Sony Bravia.

That said, I do I have a Sony television with Google TV built-in downstairs. I wonder if the deciding factor is whether you have "built-in" Google TV (works) and "external" Google TV (which appears[?] not to work). I'll give this a try later and see if this makes a difference; I suspect yes.

1 Like

Sorry your right... may be I thought everyone had a Sony TV... !! :wink:
Apologies. Yes suspect it will make a difference.

Double checked the settings, set to default sound and 100% volume. Still nothing. I'm guessing it's because the chromecast w/ google tv is not officially supported.

1 Like

In the spirit of closing the loop on this, yes, this driver+Notifications for Android TV app is indeed able to turn the TV on.

2 Likes

Ah yes. I saw the shout-out to the developer of the TV-side app in the intial post here, but didn't realize these two things weren't developed together. Furthermore, I see the TV-side app hasn't been updated since 2018. So I suspect you're right, CCGTV isn't going to fully work unless we write our own TV-side application.

I've cobbled together a few Android applications, perhaps this is something I could pursue.

The other thought about audio specific to your situation is that depending on your setup, CC can't actually drive the TV audio. For example, in my setup the CCGTV remote actually sends IR volume change commands directly to the Sonos soundbar. If I try to adjust the volume in Chromecast via "software" mechanism (ie, using Lean Remote or Android TV Control apps) I get a toast on the TV telling me that the audio cannot be changed by Chromecast. On previous setups I was able to drive TV audio, though; I seem to recall the difference-maker was whether the audio was standard 2.0 or 5.1+.

Even though the app hasn't been updated since 2018, I did notice that the author does appear to still be responding to reviews left on the Play Store. With that in mind, I reached out to him about the power on/off and audio notifications issues we've discussed above; I figure it can't hurt to ask.

4 Likes

Yeah, I did the same -- and he replied super quickly.

Short version is that his TV-side app is being built with an older API, back when the Android TV side allowed "draw over apps". I guess this is no longer the case with the current API, so once Google sunsets the API version he's using, we're going to lose this functionality. Which really stink.