Skip to content

Conversation

@USA-RedDragon
Copy link
Contributor

@USA-RedDragon USA-RedDragon commented Oct 22, 2024

https://companion.home-assistant.io/docs/notifications/notifications-basic/#notification-channels

This passes through to be a specific notification category (scrypted) on Android (I'm not sure how iOS handles these). Prior to this change, the notification comes in on the default Home Assistant Mobile App channel

In the future, the notification type (i.e. motion, person, etc) could be appended to the channel name to allow even more specific notification tuning. I didn't see this data in the NotifierOptions object passed in.

Edit: now based on draft koush/scrypted#1625

https://companion.home-assistant.io/docs/notifications/notifications-basic/#notification-channels

This passes through to be a specific notification category on Android (I'm not sure how iOS handles these).

In the future the notification type (i.e. motion, person, etc) could be appended to the channel name to allow even more specific notification tuning. I didn't see this data in the `NotifierOptions` object passed in.
@koush
Copy link
Contributor

koush commented Oct 22, 2024

I appreciate the pull request, but I think this really ought to be placed in the Scrypted SDK level, so callers of Notifier specify the channel themselves. Someone else mentioned this feature the other day in Discord, was that you?

@koush
Copy link
Contributor

koush commented Oct 22, 2024

Also not sure if this is similar to Android's notification categories and iOS notification channels. The iOS ones need to be defined up front in the iOS app.

Is HA doing its own thing here? Ie, this channel is something specific to companion app?

@USA-RedDragon
Copy link
Contributor Author

USA-RedDragon commented Oct 24, 2024

I think this really ought to be placed in the Scrypted SDK level, so callers of Notifier specify the channel themselves.

Ack. In this case would the HA plugin have a static prefix like scrypted_ to avoid any conflicts with existing channels? Or should the Notifier callers specify a prefix?

Someone else mentioned this feature the other day in Discord, was that you?

Nope :) I just started using Scrypted the day of this PR

Also not sure if this is similar to Android's notification categories and iOS notification channels.

Yep, sorry I should have clarified better. I have an automation that publishes with channel: steam_{steamname} and these translate directly to notification categories on the companion app
Screenshot_20241023_210017_Settings

The iOS ones need to be defined up front in the iOS app.
Is HA doing its own thing here? Ie, this channel is something specific to companion app?

I see where my confusion came from. Apparently these are Android specific, the HA docs on it have notification channels listed under Android-specific features, so it seems like data.channel is a no-op for iOS devices.

@koush
Copy link
Contributor

koush commented Oct 24, 2024

Alright looks like I'll need to add this to the SDK, and then callers can provide one, otherwise a default will be used. Will have no effect on iOS.

USA-RedDragon added a commit to USA-RedDragon/scrypted that referenced this pull request Oct 24, 2024
This change spins off from conversation at scryptedapp/homeassistant#1 and allows consumers of the `Notifier` interface to specify a channel for notifications to be sent to. Android platforms can use this to send notifications to a specific channel, allowing the user to have fine-grained control over the audio and priority of the notifications they receive.
@USA-RedDragon USA-RedDragon marked this pull request as draft October 24, 2024 23:53
@USA-RedDragon
Copy link
Contributor Author

Drafted a PR koush/scrypted#1625

USA-RedDragon added a commit to USA-RedDragon/scrypted that referenced this pull request Oct 25, 2024
This change spins off from conversation at scryptedapp/homeassistant#1 and allows consumers of the `Notifier` interface to specify a channel for notifications to be sent to. Android platforms can use this to send notifications to a specific channel, allowing the user to have fine-grained control over the audio and priority of the notifications they receive.
koush pushed a commit to koush/scrypted that referenced this pull request Oct 27, 2024
…1625)

* feat(sdk): add support for notification channel in NotifierOptions

This change spins off from conversation at scryptedapp/homeassistant#1 and allows consumers of the `Notifier` interface to specify a channel for notifications to be sent to. Android platforms can use this to send notifications to a specific channel, allowing the user to have fine-grained control over the audio and priority of the notifications they receive.

* chore(sdk): place Android notification channel under the android object

* fix(automation-actions): remove channel from UI
@koush koush marked this pull request as ready for review October 27, 2024 06:39
@koush koush merged commit ba89e94 into scryptedapp:main Oct 27, 2024
@koush
Copy link
Contributor

koush commented Oct 29, 2024

published

apocaliss92 pushed a commit that referenced this pull request Oct 19, 2025
…-mapping

Add MotionSensor interface mapping for Home Assistant binary sensors
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

Successfully merging this pull request may close these issues.

2 participants