API Notify timeout/icon options?

I have been playing around with the API notify feature and think it might be a very useful/annoying (depending on the message) addition to my Home Automation system. A Pop up message on screen (or screens) saying "Outside Movement" , "The Dishwasher has finished" or "Time to turn the TV off and go to bed" etc. It has all sorts of possibilities.

Is there any way of changing either the icon (which seems to default to an "!") or the timeout of the message by changing parts of the payload message to it?

Yep, per the docs, you can set an icon. The docs don't do a good job explaining how it works though. Actually they do, they just don't mention SF Symbol support. Check out the docs here: Channels Support - Channels API

You have the option of using SF Symbols or Font Awesome. Use their code, prefixed with the style you want, ie:

SF Symbols

sf:figure.walk.motion

Font Awesome

fa:person-walking

You're also in luck, there is a timeout, but it's undocumented. Just pass it a number in seconds.

These are also potentially only available on tvOS and not Android TV.

Excellent! Sorry, I honestly have been reading the docs and searching to try to find things out for myself before asking questions, I don't know how I missed the bit about the icon!

At least the timeout part was undocumented so it was maybe worth me bothering you for!!!

Thanks again for the support - my experience so far is that this is a great product backed by a great team. :+1:

1 Like

Looks like that is the case. I'm running on Android and adding a custom icon and timeout to the payload don't change anything sadly. I just get the "!" icon and the standard (what seems to be 5 secs?) timeout.

I tested that it wasn't just user error by cutting and pasting the example payload from the docs I just get the default "!" icon not the door.

Oh well. Is this something that will eventually feed through to the Android app, or is it not possible in Android?

When I implemented this in OliveTin-for-Channels, I sent successive messages with a sleep between and that worked fine to get whatever length was desired. 5 second sleep iirc, and the message remained on the screen.

Thanks, but I think that particular "OliveTin of worms" might have to wait until I'm a bit more savvy with the standard system! :crazy_face:

I think he’s just suggesting a strategy. Your script could just send the notification every 1s for N seconds to simulate the timeout.

Ah, OK, I get it now. Just tested and works perfectly. Thanks both.

Just the icon to sort out now........................................

And, on that subject (from memory as I'm on a train atm), favicons do work. I recall using a open door favicon, for an "I'm home" message test or the like.

Try a font awesome name without the name space. So just door-open

No go I'm afraid, still get the "!" icon.

If I can't specify an icon in Android for Notify, is there any way to have no icon or a blank icon? Maybe delete/change a file somewhere? I'm finding a lot of uses for the on screen message and in most of them it would be better without any icon rather than the default "!" which always looks like a warning/error message.

Update. I've now borrowed an Apple TV box to try out Channels on.
Channels v5.7.5
Apple TV 4K
tvOS 17.3

Sending this payload (the example in the docs with an added timeout)
{"title":"Alert","message":"Dad is home","timeout":25,"icon":"fa:door"}

The timeout works fine, staying on screen for 25s, but it didn't display any icon at all, just the text. Then I discovered that "door" isn't actually a font-awesome icon - door-open or door-closed are though and they both work fine on the Apple. So that problem is just a simple typo in the docs.

Sadly, "fa:door-open" still doesn't work on the Shield, which still shows the "!" icon regardless.

There is one thing that the Shield does better than the Apple on this though - I was able to get a multi-line message on screen by putting "\n" into the message and/or title strings, but on the Apple that just truncates the text to a single line ending at the first "\n". I don't know if a different line feed character would work or if that is just a limitation in the OS.

I know this will be very low priority but it would be a great feature to have fully working on Android, as I think I will be sticking with that for my clients.

Just updated to 4.6.6 Android app and noticed the Notify Timeout has been fixed/added.

Works perfectly. Thanks very much for that.

Any news on the icons? Is that possible in Android or not?

No news on icons

OK. No worries, it's a very minor problem.

Speaking of which :wink: I've just discovered that the notify doesn't like a £ sign in the message string (it displays as 2 ? symbols. $ seems to work fine. Is this a system language settings issue somewhere do you think?