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

Notification/Popup on Android Auto #3520

Closed
luizfelipepg opened this issue May 8, 2023 · 26 comments · Fixed by #3642
Closed

Notification/Popup on Android Auto #3520

luizfelipepg opened this issue May 8, 2023 · 26 comments · Fixed by #3642
Labels
Android Auto enhancement New feature or request

Comments

@luizfelipepg
Copy link

Is your feature request related to a problem? Please describe.

It is not related to any problem but a suggestion on how to enhance some of the automations we have using home assistant.

Describe the solution you'd like

When connecting my android to my car, I normamly get some popups on screen from different apps like maps and whatsapp. I would like to get popups from my android home assistant automation if possible so I can automate some popups to easy access like:
Do you wish to open your garage door ? (when getting close to your home )
Would you like to turn off your office ? (when leaving the house)
etc.....
At the moment I am already sending those notifications to my android but they are not showing up on my android auto screen. That would make it much more secure if I could interact with the android auto device instead of my mobile.

Describe alternatives you've considered, if any

At the moment, I have to get my mobile and click on the automations I have set to send notifications/popups but that represents a security risk as I am driving while looking at my phone

Additional context

Thanks a lot for the amazing work you are putting into this 👏

@luizfelipepg luizfelipepg added the enhancement New feature or request label May 8, 2023
@Bushrider
Copy link

I'd really like to have this feature enabled too. I think that would be a great improvement to, at least, get notifications to android auto screen, actionable or not.
Thx a lot for this fantastic work!

@Jinsin456
Copy link

+1 for this, the fact Home Assistant is on Android Auto is amazing but it has the potential to be incredible.

A way of selecting 'favourites' / dashboard and actionable notifications would make this a game change

Thanks to everyone for all their great work :)

@penright
Copy link

+1
First, let me echo the fact it is on AA is so cool. Great job.
actionable notifications +1 I would assume to wire all that through would be a huge task, but it would be cool.
You have the default tabs, for example, covers, buttons, etc. Could we create a tab with the buttons and covers that are important to the user? Then show it by default if exist, then the back key can take you to the screen with all the tabs. I can create a different request for this if needed.

@jpelgrom
Copy link
Member

Could we create a tab with the buttons and covers that are important to the user?

There is an open feature request for favorites which is basically what you're describing: #3219

@jpelgrom
Copy link
Member

jpelgrom commented Jul 7, 2023

Implementing this in #3642:

  • having a notification show up is as simple as adding car_ui: true to the notification
  • tapping a notification from Android Auto will open the driving interface
  • actions are supported however, so you could add simple buttons (they will currently always show a Home Assistant icon in pop up, but we can add options to change that later, action text is visible when you view notifications); image image

Example notification would be:

service: notify.mobile_app_<your_device_id_here>
data:
  title: "Door unlocked"
  message: "Everyone left home but the door is still unlocked"
  data:
    car_ui: true
    notification_icon: "mdi:door-open"
    channel: "Door unlocked"
    importance: high
    actions:
      - action: CLOSE_DOOR
        title: "Close door"

@luizfelipepg
Copy link
Author

Wowww !!!
That is awesome !!!
Thanks for looking into this !!!

I have soo many use cases ❤️

@Jinsin456
Copy link

Hi guys, I can't seem to get this working. Settings below

Pixel 7 Pro
2021 Mazda 3 (UK)

Companion App 2023.7.3-full (Beta Tester)
AAuto 9.8.632424
Home assistant running on pi 2023.07.1

Have copied the demo text into the developer services and can call a service. The notification appears on my phone but not on the car head unit. I get other notifications eg WhatsApp so that's all fine

@dshokouhi
Copy link
Member

@jpelgrom I think we forgot to update FCM repo for this new parameter right? 😂

@jpelgrom
Copy link
Member

jpelgrom commented Jul 11, 2023

@jpelgrom I think we forgot to update FCM repo for this new parameter right? 😂

Ooh good point, will submit a PR to fix that now! Edit: looks like you beat me to it :)

@dshokouhi
Copy link
Member

@jpelgrom I think we forgot to update FCM repo for this new parameter right? 😂

Ooh good point, will submit a PR to fix that now!

beat you to it 😛 home-assistant/mobile-apps-fcm-push#103

@dshokouhi
Copy link
Member

@Jinsin456 please try again in about 10 minutes, should be fixed by then 🤞 thanks for reporting!

@Jinsin456
Copy link

Working now guys 😀😀 thank you so much!!

@garysargentpersonal
Copy link

garysargentpersonal commented Jul 18, 2023

EDIT: Now resolved - see later comment.

I don't seem to be able to get this to work on Samsung S23 Ultra / Android 13.

I have HA Core 2023.7.2 and companion app 2023.7.6-full

I've tried copying notification calls that others are saying are working, but these seem to have no effect at all in Android Auto for me. They pop up on the phone, but not Android Auto.

Anything I can do to debug?

@Bushrider
Copy link

Bushrider commented Jul 18, 2023

This worked for me 👍

alias: Notification garage ouvert
description: ""
trigger:
  - platform: state
    entity_id:
      - <your_entity_id_here>
    from: closed
    to: opening
condition: []
action:
  - service: notify.mobile_app_<your_device_id_here>
    data:
      message: Le garage est ouvert
      data:
        car_ui: true
        notification_icon: mdi:garage-open
        channel: garage opened
        importance: high
        actions:
          - action: null
            title: Ouvrir garage

@garysargentpersonal
Copy link

Thanks @Bushrider that worked. Turns out I'd been stupid and used "car-ui" not "car_ui"!

@tmason818
Copy link

  • having a notification show up is as simple as adding car_ui: true to the notification

This is so slick! Only took me a few minutes to whip up some Notification Automations that briefly that show my Garage Door actively is Closing and then Closed- and I even have the notifications clear when the garage is confirmed Closed. Masterful!

  • actions are supported however, so you could add simple buttons (they will currently always show a Home Assistant icon in pop up, but we can add options to change that later, action text is visible when you view notifications);

I had no idea how new these changes were. I'd imagine the icon for the Actions are still limited to the Home Assistant icon and there is no way to change those as of yet?

Either way really nice work!

@Namanhuu
Copy link

Hi guys,

I've used example code above. Notifications are showing up on Android Auto but i can't see the actionable buttons. Is there something else i need to do to make the actionable buttons show up on the Android auto notiification.

@dshokouhi
Copy link
Member

Hi guys,

I've used example code above. Notifications are showing up on Android Auto but i can't see the actionable buttons. Is there something else i need to do to make the actionable buttons show up on the Android auto notiification.

It should show up when you view the actual notification like the screenshot above

@Namanhuu
Copy link

It should show up when you view the actual notification like the screenshot above

Thanks Daniel, my notification shows up as per the first screenshot, if i tap the notification it opens the Home Assistant app. How do I "view" the notification. I tried swiping up, down. etc.

@dshokouhi
Copy link
Member

It should show up when you view the actual notification like the screenshot above

Thanks Daniel, my notification shows up as per the first screenshot, if i tap the notification it opens the Home Assistant app. How do I "view" the notification. I tried swiping up, down. etc.

Are you sure the action syntax is correct?

@Namanhuu
Copy link

Namanhuu commented Aug 12, 2023

This is what i've got for it

action:
  - alias: Set up variables for the actions
    variables:
      action_openg1: "{{ 'openg1' ~ context.id }}"
      action_opengg2: "{{ 'opengg2_' ~ context.id }}"
  - alias: Ask to Open Gate?
    service: notify.mobile_app_namanh_phone
    data:
      message: You are nearly home, would you like to?
      data:
        car_ui: true
        notification_icon: mdi:garage-open-variant
        channel: CAR
        importance: high
        actions:
          - action: "{{ action_openg1 }}"
            title: OPEN GATE
          - action: "{{ action_opengg2 }}"
            title: OPEN GATE & GARAGE

@dshokouhi
Copy link
Member

@Namanhuu ok your syntax looks correct. The first screenshot is actually when the notification appears as a pop-up, you should still see the action icons to the side. The second screenshot is when you view your notifications by clicking on the numbered badge at the bottom right hand corner next to cell signal and the clock. That detailed view should show the actions for you there. If it doesn't try checking notification history details to make sure the app received the action appropriately.

@tmason818
Copy link

tmason818 commented Aug 23, 2023

Is there a way currently to change the display Icon for the Actions in the Android Auto message view or will they always default to the Home Assistant icon?

@jpelgrom
Copy link
Member

Is there a way currently to change the display Icon for the Actions in the Android Auto message view

No, this is not yet supported

@mdzhigarov
Copy link

mdzhigarov commented Nov 10, 2023

This is what i've got for it

action:
  - alias: Set up variables for the actions
    variables:
      action_openg1: "{{ 'openg1' ~ context.id }}"
      action_opengg2: "{{ 'opengg2_' ~ context.id }}"
  - alias: Ask to Open Gate?
    service: notify.mobile_app_namanh_phone
    data:
      message: You are nearly home, would you like to?
      data:
        car_ui: true
        notification_icon: mdi:garage-open-variant
        channel: CAR
        importance: high
        actions:
          - action: "{{ action_openg1 }}"
            title: OPEN GATE
          - action: "{{ action_opengg2 }}"
            title: OPEN GATE & GARAGE

Can you elaborate what is context.id? I suppose this should reference the garage opener cover which in my case is entity: cover.garage. Is that it?
I don't understand where do I reference the actual garage opener cover in this configuration...

@henfri
Copy link

henfri commented Mar 28, 2024

Hello,

I have the same intention:
When being close to home, HomeAssistant should open (1) and I should get the option to open the Garage Door.

It seems @mdzhigarov, @Namanhuu that you have some practical experience.

Does it work satisfactory?

On the opening of HA (1): Does a Pop-Up prominently come to the front, or is it like on the phone, that I need to "pull down" the notifications?
The first would be better, because otherwise the distraction would be too high.
Also: how well does the Location-Trigger work?

Greetings,
Hendrik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Auto enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.