Get app specific notifcations from android phone to HA instance

I’m looking to get app specific notifications from the phone as entity states in HA. For example, an on/off switch entity for a new message or missed phone call.
After some googling i found some old threads about doing this with tasker, is this still the preferable approach or are there any newer solutions for this?

If you use the HA companion app, you can whitelist apps to allow their notifications to appear in the last_notification sensor then pipe those values wherever you want using trigger-based template sensors or automations.

  - trigger:
      - platform: state
          - sensor.phone_last_notification
          - unknown
      - name: "Discord Notifications"
        state: >-
          {% set current = this.state %}
          {% if trigger.to_state.attributes.package != "com.discord") %}
          {{ current | default('No Notifictions') }}
          {% else %}{{ trigger.to_state.state }}
1 Like

Thank you, this is probably a lot easier than doing it with tasker.