CarPlay Support

New TestFlight build with CarPlay improvements available :v:t2:

3 Likes

Thanks! weird scrolling in my audi multimedia is fixed :ok_hand:

Played a little this morning and it seems very promising. Open/close door works, maybe the most important feature for me. Thanks a lot for your efforts.

The “action” sections is empty, do not know if there should be something there.

I suppose it’s already on the roadmap, but a great improvement would be the ability to edit which entities you want to display on CarPlay, for example, only the garage door or a specific light.

I suppose it’s already on the roadmap, but a great improvement would be the ability to edit which entities you want to display on CarPlay, for example, only the garage door or a specific light.

That’s exactly what you can achieve with iOS Actions! You’ll need to define those using the iPhone app or via configuration.yaml

ios:
  actions:
    - name: Open garage
      background_color: "#000000"
      label:
        text: "Open garage door"
        color: "#ff0000"
      icon:
        icon: garage-open
        color: "#ffffff"

The name (eg ‘Open garage’) needs to be used as actionName in an
ios.action_fired event, eg:

automation:
  - alias: "Open garage iOS event action triggered"
    initial_state: true
    trigger:
      - platform: event
        event_type: ios.action_fired
        event_data:
          actionName: "Open garage"
    action:
      - service: switch.turn_on
        entity_id: switch.garage_door
4 Likes

Thanks!! tested and working :slightly_smiling_face:

Hello everyone, I am also using the well version, I must say everything works correctly, the only thing I did not understand with what criteria the devices are shared, for on e.g. 10 devices on only 2 are visible, like all type switches are not there. Do you have to configure something in particular? Other thing I use the code below to create a cover, theoretically it should also work are cellular network ?

- platform: template
  covers:
    garage_door:
      device_class: garage
      friendly_name: "Garage Door"
      position_template: "{{ states('binary_sensor.garage_contact') }}"
      open_cover:
        - service: switch.turn_on
          data:
            entity_id: switch.sonoff_garage
      close_cover:
        - service: switch.turn_on
          data:
            entity_id: switch.sonoff_garage
      stop_cover:
        service: switch.turn_on
        data:
          entity_id: switch.sonoff_garage
      icon_template: >-
        {% if states('binary_sensor.garage_contact') %}
          mdi:garage-open
        {% else %}
          mdi:garage
        {% endif %}

When using iOS actions (eg for CarPlay, Apple Watch, widgets…), no actual HA status is visible in the action itself. To overcome this, it might often be desired to have an action which will trigger a notification (or even an ‘actionable notification’) to be returned immediately. Such actionalable notifications can have many more actions and may include information on the actual status of your home.

With the new carplay support, you’ll notice HA notifications are only shown in the car if these are pushed as critical. Yet, when the same action would be launched from another source (eg Apple Watch) it might probably not be desired to get the notification as a critical (making a lot of noise).

So to make sure the notification is send as a critical one when the iOS action is launched from car (triggerSource carPlay), while still sending it as a standard (actionable) notification when send from Apple Watch, below little example can be used.

This makes the iOS actions very powerfull (especially for Apple Watch, see also these action tricks for Apple Watch). In the car the actions of the actionable notification can not be used, yet, critical notifications will be visible and the message can be read aloud by Siri.

ios action:

ios:
  actions:
    - name: AlarmStatus
      background_color: "#000000"
      label:
        text: "Alarm status info and actions"
        color: "#ff0000"
      icon:
        icon: alarm_light
        color: "#ffffff"

automation:

alias: Alarm status iOS event action
description: ""
trigger:
  - platform: event
    event_type: ios.action_fired
    event_data:
      actionName: AlarmStatus
  - platform: event
    event_type: ios.notification_action_fired
    event_data:
      actionName: AlarmStatus
condition: []
action:
  - variables:
      critical_desired: >-
        {% if states('sensor.iphone_activity') == 'Automotive' or 
        (trigger is defined and trigger.event is defined and
        trigger.event.data.triggerSource == 'carPlay') %}1{% else %}0{% endif %}
  - service: notify.iphone_notification_group
    continue_on_error: true
    data:
      title: Alarm status
      message: >-
        {{now().strftime("%H:%M:%S %d/%m/%Y")}}
        Alarm status: {{states('alarm_control_panel.home_alarm')}}
      data:
        push:
          sound:
            name: default
            critical: "{{critical_desired}}" #1 for cticial, 0 for non critical
        entity_id: camera.doorbell
        attachment: #show image as attachment
          content-type: jpeg
        url: /lovelace-alarm/alarm
        group: alert #combine notifications together visually
        tag: alarm #replace previous alarm notification
        actions:
          - action: AlarmBlock
            title: Temporary block the alarm
            activationMode: background
            authenticationRequired: true
            destructive: false
            behavior: default
          - action: AlarmSirene
            title: "Sirenes en light ALARM"
            activationMode: background
            authenticationRequired: true
            destructive: true
            behavior: default

I confirm the flickering issue is solved. I am not sure tough what is supposed to be here in the upper right corner

Thanks again for your work!!

Thank you for this detailed description. It’s really helpful.
My usecase is opposite however. An actionable notification is being sent by HA automation (NodeRed in fact but it doesn’t matter). Under normal circumstances I need it to be non-critical. However as you said, such a notification cannot reach CarPlay.
I think it might have be possible to check if my HA client is connected to AppleCar, and then turn critical mode on for such a notification. Not sure yet, whether HA collects such information from HA iOS application.

As for background, this is a notification about the need to pull the trashcan for trash collection. I’m getting it when arriving home.

It’s one feature. Receive actionable notifications when in CarPlay mode, and be able to choose an option. For example, HA sends a notification when leaving the home area, that some lights have been left turned on, providing an option to turn them off. AFAIK CarPLay gives no such option. But HA CarPlay app potentially could mimic such a scenario.

Nice Update :slight_smile:

Now we need a sorting for CarPlay and an option to hide entries in CarPlay

Good Job

3 Likes

I see. Can’t you use the trigger ‘leaving zone’ or ‘entering zone’ to identify you’re probably in your car and thus would like to get the notification as a critical one?

Great work. Thank you.

Indeed CarPlay support is very impressive and working well!
I just noticed the latest version now even has an option to define if the iOS action should be visible on watch and/or carplay! Much appreciated!
IMG_5778

1 Like

I can’t because I can enter the zone walking too :slight_smile:
If the app could provide a sensor about it’s CarPlay connected then it would be a way.

But still, there is no option to execute actions from actionable notification, isn’t it?

You could use the entering/leaving zone in combination with sensor.iphone_activity which has states such as ‘automative’ or ‘walking’ etc.

which Companion app are you using? How do you enabled it? I haven’t it!

For me it would be very convenient if the server is automagically set to the closest server. I have multiple HA instances at work locations, home, etc… All of them with automated doors…

Can you see the value of a sensor on the CarPlay dashboard? Temperature, humidity etc…

I’m not able to find sensors anywhere on the UI, is this possible?

1 Like

For me the same.
I created 3 actions, enabled for iWatch and CarPlay.
They are all working on iWatch but under CarPlay list i 'm not able to include HomeAssistant even if is the latest App version, my iPhone has latest iOS …
What can be done, more, to understand why it’s not working ( or better HA is not present under the CarPlay’list ?)
Thanks !

for on/off sensor types, status is shown. Eg Light is on/off, door is open/closed, etc.

I believe it’s still only available in the Beta version of the iOS app. You may need to subscribe on the TestFlight.