How to push event notifications to phone via Home Assistant

I am a pretty new Vikunja user, and I thought I would share details on how I configured self-hosted Vikunja to integrate with Home Assistant via webhooks to send push notifications for events like reminders and overdue notifications to your phone. I haven’t seen this option for getting push notifications discussed before so thought I would share.

It’s really pretty simple, but there are a couple gotchas so I wrote it up as a blog. But basically:

  • Create a webhook automation in Home Assistant that sends a push notification
  • Add webhooks in Vikunja
  • Be notified!

The automation in HA looks like this. This creates a webhook at http://172.16.2.100:8123/api/webhook/vikunja_reminder(assuming your HA instance is at 172.16.2.100)

- id: vikunja-reminder-notification
  alias: Vikunja reminder notification
  triggers:
    - trigger: webhook
      webhook_id: vikunja_reminder
      allowed_methods:
        - POST
      local_only: false
  conditions: []
  actions:
    # replace with your device's notify service
    - action: notify.mobile_app_pixel_10
      data:
        title:
          "{{ trigger.json.event_name | default('Task reminder') | replace('task.', '') | replace('tasks.', '') |
          replace('_', ' ') | title }}"
        message:
          "{{ trigger.json.data.task.title | default(trigger.json.data.tasks | map(attribute='title') | join(', ') |
          default('Task event')) }}"
  mode: single

In your Vikuja instance you need to configure VIKUNJA_OUTGOINGREQUESTS_ALLOWNONROUTABLEIPS: 'true' - otherwise webhook requests to nonroutable IPs will be dropped.

You need to configure the action with the entity ID for your phone. Then just add that URL as a webhook in Vikunja.

That’s about it! Hope this is useful to others.

1 Like

Thanks for writing this up and including actual yamls for HA :slight_smile:

My pleasure! I made some improvements to the template to handle different event types better and include an icon in the push, check the blog for the most recent version since I can no longer edit the post.