Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear Notifications on Android #41

Open
mrhr95 opened this issue Mar 20, 2024 · 3 comments
Open

Clear Notifications on Android #41

mrhr95 opened this issue Mar 20, 2024 · 3 comments

Comments

@mrhr95
Copy link

mrhr95 commented Mar 20, 2024

Notifications aren't cleared on other devices (Android). Is there a reason for only sending clear-commands to apple devices? If I edit out this condition in my blueprint, it works.

Description of this blueprint doesn't state this option to be only available for iOs, neither does the documentaion on notifications...

Extended request: Maybe you could add support for sticky notifications (Android)? docs...

@samuelthng
Copy link
Owner

samuelthng commented Mar 21, 2024

Hey @mrhr95, thank you for trying out the script.

Android Notifications Timeout

Screen_Recording_20240321_082935_Home.Assistant.mp4

Notifications are clearing just fine on Android (Samsung Galaxy S20FE) for me.

Do ensure that you have Enable timeout AND Clear notification on timeout set for the timeout parameter to be included in the notification.

A clear command has to be sent for iOS devices because they do not support timeouts on the notifications itself, so the HA automation has to handle the countdown instead for the feature to work on iOS.

Sticky Notifications

As for the request, I'll take that into consideration!

Upon reviewing the docs, you might want to try out the persistent notification option - which has already been included. That option is slightly similar to sticky notifications in that you won't be able to dismiss the notification until it has been acted upon.

@mrhr95
Copy link
Author

mrhr95 commented Mar 21, 2024

Hey @samuelthng
Thank you for elaborating. I think, I wasn't quite clear on my issue, sorry.

  • If I use the multi-device-blueprint as is and send one notification to multiple devices, deleting of notification through user-input on one device doesn't affect notification on other device. For using timeout your response is true, but not for deleting on user-input.

  • If on the other hand I delete the condition apple_device out of send clear notification command, then deleting a notification on one device deletes the same notification on every other device.

Maybe differenciating between iOS and Android belongs to another place within the code, only affecting timeout-events, not every event that clears notifications.

@samuelthng
Copy link
Owner

Ah I see what you mean now, yes that's right because the multi-device is not really a priority for me.

It works for apple devices only because Home Assistant facilitates the clearing of notifications, so it kind of "failed successfully".

From the Android point of view, they're all separate notifications.

So yes, what you are describing is technically doing what's intended, albeit not very polished at all...

The multi-device variant was only meant to facilitate sending the notifications rather than co-ordinate the notification state across the devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants