Skip to content
Nowlark
Guides menu

Home Assistant alerts on your iPhone and Apple Watch

One rest_command sends any Home Assistant automation to your iPhone and Apple Watch, each alert with its own sender and priority.

N
GARAGE · nowThe garage door is still openOpen since 21:40
An automation's alert, on the Lock Screen and, when your iPhone is locked, on your wrist.

Each alert names its own sender, such as Garage or Washer, and its own priority, so the garage can break through a Focus while the washing machine stays quiet. When your iPhone is locked, your Apple Watch shows it too, as it does any iPhone notification.

What you need#

  • Nowlark on your iPhone, and your key from Settings › Connect an App › Create Your Key. Copy it when it is shown, because it is shown once. It starts nlk_.
  • Home Assistant, and a way to edit the files in its config folder. secrets.yaml sits beside configuration.yaml; create it if it is missing.

1. Store your key#

Add this line to secrets.yaml, with your own key in place of nlk_…:

nowlark_api_key: "nlk_…"

2. Add the command#

Add this to configuration.yaml. If the file already has a rest_command: line, put the nowlark: part under that one instead:

rest_command:
  nowlark:
    url: https://nowlark.com/v1/notify
    method: post
    headers:
      X-Nowlark-Key: !secret nowlark_api_key
    content_type: application/json
    payload: >
      {{ {"source": source | default("Home Assistant"),
          "title": title,
          "body": message | default(""),
          "priority": priority | default(0)} | to_json }}

Your key travels in the X-Nowlark-Key header, which Nowlark takes the same as Authorization: Bearer. This gives every automation an action called rest_command.nowlark that takes a title, and optionally a message, a source (the sender name on your phone) and a priority.

3. Use it in an automation#

This one tells you when the garage door has been open for ten minutes. Add it to the end of automations.yaml, change binary_sensor.garage_door to your own sensor, then restart Home Assistant:

- alias: Garage door left open
  triggers:
    - trigger: state
      entity_id: binary_sensor.garage_door
      to: "on"
      for: "00:10:00"
  actions:
    - action: rest_command.nowlark
      data:
        source: Garage
        title: The garage door is still open
        message: "Open since {{ as_local(states.binary_sensor.garage_door.last_changed).strftime('%H:%M') }}"
        priority: 1

Pick a priority per alert#

priority On your iPhone
-1
Low: silent, no sound
0
Normal: sound and a banner
1
High: breaks through a Focus
2
Urgent: breaks through a Focus and repeats until you open it

Priority and repeat until opened has the details. Give each kind of alert its own source, such as Garage, Washer or Alarm, and the app's Sources tab lets you mute or colour each one on its own.

Send a notification lists every other field the command can pass on, such as a link to open.

Get Nowlark free