# Set up alerts

> What Frigate needs before it can alert your iPhone, how Server Notification Setup makes those changes for an administrator, the steps by hand for anyone else, why Frigate restarts, and how to prove alerts arrive.

Alerts come from your server, not from the app: Frigate decides something is worth telling you
about and sends it to your iPhone. Before it can, a few things have to be true on the server and
on the iPhone. **Settings › Server Notification Setup** checks every one of them, says which are
missing, and, with an administrator account, fixes them for you. The welcome walkthrough opens
the same screen at its **Alerts from Frigate** step.

## What has to be true

| | What | Why |
|---|---|---|
| On this iPhone | **Notifications allowed** | iOS delivers nothing to an app that isn't allowed to send them. |
| On this iPhone | **Signed in to Frigate** | The app needs an account to read the server's settings and register. |
| In Frigate | **A notification contact address** | Frigate sends nothing without one. Nothing is ever emailed to it. |
| In Frigate | **Notifications on for each camera** | Each camera has its own switch, and only the cameras with it on can alert you. |
| In Frigate | **Object detection on** | An alert starts as something a camera detected. |
| In Frigate | **Recording on** _(recommended)_ | Lets an alert open the clip of what happened. |
| In Frigate | **Snapshots on** _(recommended)_ | Puts the full picture in an alert, not a small crop. |
| Then | **This iPhone registered** | Gives Frigate the address this iPhone's alerts go to. Any account can do this. |
| Then | **Frigate restarted** | Frigate reads its settings and its list of registered devices only when it starts. |

Each iPhone and iPad registers separately, so each one runs through this list once. A second
device signed in to the same server skips everything already done on the server.

## Let the app do it

With an administrator account, the screen opens with **Set it all up for me**.

_Picture: Server Notification Setup with the Set it all up for me card: it explains that an administrator's account lets the app make every change and restart Frigate once, lists the five cameras with a switch each, and has a Set up automatically button. Below it, I'd rather do it myself · 2 restarts by hand._

1. **Set it all up for me**: makes every change on the list, registers this iPhone, and restarts Frigate once.
2. **Cameras that alert you**: which cameras get their notifications turned on. All of them, to begin with.
3. **Set up automatically**: starts it. The app asks before it restarts anything.
4. **I'd rather do it myself**: the same changes as a list of steps, for doing by hand.

1. Open **Settings › Server Notification Setup**.
2. Under **Cameras that alert you**, turn off any camera you never want alerts from. You can choose more finely later, per object, zone and time of day, without touching the server: see [Notification filters](https://mobile.fregata.app/docs/alerts/filters/).
3. Tap **Set up automatically**.
4. Read what it will do, and tap **Set up and restart**.
5. Keep the screen open while each step ticks over. Frigate is down for a few seconds while it restarts.
6. When the screen says **All set**, an alert has reached this iPhone and you're done.

_Picture: The confirmation before setting up: Restart Frigate? It turns on what Frigate needs, registers this iPhone, then restarts Frigate, which goes down for a few seconds and stops recording until it is back. Buttons: Set up and restart, and Cancel._

The restart is the only disruption: Frigate stops for a few seconds, recording pauses, and
anyone watching is disconnected until it's back. The app never restarts your server without
asking first.

While it works, a card at the top says what's happening, and every step below it ticks over:

_Picture: Setting it all up: Frigate is restarting, waiting for it to come back. Below it, the restart count reads 1 of 2 done and the steps for this iPhone and the contact address are ticked._

If a step fails, setup stops before the restart and opens that step, saying what Frigate
answered. Fix it there, or tap **Try again**.

## Do it yourself

With a viewer account, or after **I'd rather do it myself**, the screen is a numbered list.
Work down it: each step opens when the one before is done.

_Picture: The full list of steps: a card saying You'll restart Frigate 2 times, then On this iPhone with two ticked steps, In Frigate with the contact address step open and the cameras, detection, recording and snapshot steps, and Restart, register, prove it with two restarts, registering this iPhone and Prove it works._

1. **You'll restart Frigate 2 times**: how many restarts the list needs, and how many are done. Each restart is a step of its own.
2. **The open step**: what it's for, with **Show me the Frigate Settings UI steps** for doing it in Frigate's web interface, **Show me the YAML to apply** for doing it in `config.yaml`, and a link to Frigate's documentation. When it's done, tap **I've made this change**.
3. **Restart Frigate · 1 of 2**: finishes by itself when Frigate comes back with the change in place.
4. **Prove it works**: the last step, ticked when a real notification arrives.

Steps already done on the server are ticked as soon as the screen opens, so you'll often have
fewer than the full list. **Recording** and **snapshots** are marked **Recommended**: tap
**Skip** on either if you'd rather not use the disk space; alerts still work, with a cropped
picture and no clip.

The app checks each change for itself. Tapping **I've made this change** moves you on, and
the step is checked again when Frigate restarts. If it's still off then, the step reopens with
**Frigate restarted, but this is still off**.

### Restarting by hand

When the list reaches a restart, restart Frigate however you usually do: in its web interface
choose **Restart Frigate** from the ⚙ menu, or restart its Docker container or Home Assistant
add-on. The step notices by itself when Frigate is back. With an administrator account,
**Restart Frigate now** does it from the app.

### With a viewer account

A viewer can't change Frigate's settings or restart it, so the list starts with a card saying
so, and **Share these steps** sends the whole list, Settings steps and YAML included, to whoever
runs the server. Registering this iPhone is the one step any account can do, so do it once
they've made their changes, and ask for the last restart.

## The contact address

Frigate won't send a notification without a contact address, and it puts that address in every
one it sends, so the relay that delivers alerts and the push services behind Frigate's browser
notifications receive it too. Nothing is ever emailed to it.

When it sets the address up, the app uses `fregata-mobile@example.com`, a placeholder that
belongs to no one. If your server already has a real email address there, the step offers
**Use a placeholder instead**. Nothing restarts, and notifications carry the new address within
the hour.

## Prove it works

The last step finishes only when a real notification reaches this iPhone, because that's the
only proof that every part works. Two ways to get one:

- **Ask Frigate for a test notification**: an administrator on Frigate 0.18 or later. It goes
  to every device registered with the server, not just this one, so warn anyone else who'd
  get it. Frigate 0.17 doesn't accept the request.
- **Walk past a camera**: works on any version, with any account.

**Send a test to this iPhone only** is different: it checks that this iPhone can receive an
alert at all, without Frigate involved, so it doesn't finish the step. It's useful for telling
an iPhone problem from a server problem.

A notification can take up to 30 seconds to be counted after it arrives.

## Later

**Settings › Server Notification Setup** is safe to open any time: it re-reads the server and
changes nothing until you ask. If alerts ever stop, it's the first place to look, because it
reopens whichever step is no longer true. Then see [Alerts don't arrive](https://mobile.fregata.app/docs/troubleshooting/alerts/).

**Register this iPhone again**, at the bottom once everything is done, is only for when alerts
have stopped and you can't see why. It gives Frigate a new address for this iPhone, which needs
another restart.

### Safe mode

If Frigate started in safe mode, its `config.yaml` has an error, often a line indented one step
too far or too little, and the app can't change anything until it's fixed. In Frigate's web
interface, open the ⚙ menu › **Configuration Editor**, fix the line it points to, and tap
**Save & Restart**. The list picks up again when Frigate is back.
