---
title: Home Assistant
description: The Kestrel integration for Home Assistant, its cameras, detections, controls and recordings, and how it pairs.
---

The Kestrel integration brings a Kestrel server's cameras into Home
Assistant. It's separate from the [Home Assistant app](/running#home-assistant),
which runs the server: the integration works with a server anywhere on
your network, and with the app, which offers itself to the integration.

It needs Kestrel 0.7.0 or later and Home Assistant 2026.10 or later.

## Installing

Install it from the Marketplace: add
`https://github.com/timmo001/ha-integration-kestrel` as a custom repository
of the Integration type, install Kestrel, then restart Home Assistant.

[![Open your Home Assistant instance and open a repository in the Marketplace.](https://my.home-assistant.io/badges/marketplace_repository.svg)](https://my.home-assistant.io/redirect/marketplace_repository/?owner=timmo001&repository=ha-integration-kestrel&category=integration)

It's written in this repository, in `home-assistant/integration`, and each
release copies it there. Its code that talks to the server is
[`kestrel-connector`](https://pypi.org/project/kestrel-connector/), from
`connector/python`, published to PyPI with each release.

## Pairing

The integration pairs with the server as a device of the `home-assistant`
kind, and shows up as **Home Assistant** in **Settings > Devices**.

- With the Home Assistant app, the server pairs Home Assistant itself and
  offers it through the Supervisor, so the integration shows as discovered
  and adds with no code.
- Anywhere else, Home Assistant finds the server over mDNS, or you enter its
  address. Then open **Settings > Devices** in Kestrel, select **Pair a
  device**, and enter the code in Home Assistant.

Remove the device in Kestrel and Home Assistant asks for a new code. It
doesn't send its version, so it keeps working across releases, and raises a
repair when the server is older than it needs.

Adding a server by hand asks for:

| Field        | What it is                                                                                                                 |
| ------------ | -------------------------------------------------------------------------------------------------------------------------- |
| Address      | The server's host name or IP address, such as `kestrel.local` or `192.168.1.20:7380`. Without a port, it's 7380.           |
| Pairing code | The code Kestrel shows under **Settings > Devices > Pair a device**, such as `ABCD-EFGH`. It works once, for five minutes. |

When the server moves, select **Reconfigure** on it in **Settings >
Devices & services > Kestrel** and enter its new address. It stays paired,
and refuses an address where a different Kestrel server answers.

## Supported devices

The integration shows whatever the server has, so it works with every kind
of [source Kestrel takes](/running#your-sources): Raysharp-made recorders,
such as a Swann DVR, Reolink cameras, hubs and recorders, the camera in a
Bambu Lab P1 or A1 printer, cameras listed by their stream address, and live
streams on web pages. What each camera gets depends on what its source can
do:

| Source            | Live video | Detections and alerts                                            | Recordings                 | Controls                                                  |
| ----------------- | ---------- | ---------------------------------------------------------------- | -------------------------- | --------------------------------------------------------- |
| Raysharp recorder | Yes        | Motion, PIR, alarm input, video loss, disk and recording reports | Yes                        | Picture settings                                          |
| Reolink           | Yes        | Motion, person, vehicle, animal                                  | Yes                        | Picture settings, PTZ, presets, tracking and clip uploads |
| Bambu Lab printer | Stills     | None                                                             | Yes                        | None                                                      |
| Stream            | Yes        | None                                                             | When the server records it | None                                                      |
| Web page          | Yes        | None                                                             | When the server records it | None                                                      |

Every camera also gets its Enabled switch, and the server and each source
their own sensors, whatever the source.

## What it adds

The server is a device, each source a device under it, and each camera a
device under its source. A source's device shows its model, firmware and
hardware version where the source says them, and the server's its Kestrel
version.

| Entity                                                       | What it is                                                                                           |
| ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
| Camera                                                       | Each camera, or each lens of a camera with two, such as a TrackMix                                   |
| Motion, PIR, Person, Vehicle, Animal, Alarm input            | What a camera sees now, or its alarm input, from live events                                         |
| Detection                                                    | An event entity, fired as each detection starts                                                      |
| Alert                                                        | A source's event entity, fired as video loss, an alarm input, or a disk or recording report comes in |
| Signal                                                       | Whether a camera has a picture                                                                       |
| Connected                                                    | Whether the server is connected to a source                                                          |
| Storage                                                      | Whether a source's disks are all right, with each disk's state                                       |
| Needs attention                                              | On while anything needs you, with what                                                               |
| Preset, Zoom, Go home, Stop moving, Tracking                 | A moving camera's controls                                                                           |
| Hue, Brightness and the rest, Reset picture                  | A camera's picture settings                                                                          |
| Enabled                                                      | Whether a camera is on in Kestrel                                                                    |
| Clip uploads                                                 | Whether a source's cameras send their clips to Kestrel                                               |
| Memory used, CPU used, Recordings disk free, Recordings size | How much of the machine Kestrel uses                                                                 |
| A sensor per job                                             | What each of the server's jobs is doing, such as recording a camera                                  |

Motion shows for every camera with events. The other detections and the
alarm input show the first time a camera reports one, since a source
doesn't say which it has, and stay after a restart. Alert shows for each
source with a camera that has events, and names the camera in the event
where there is one; disk reports don't. While the server's live events are
cut off, the detections, Detection and Alert are unavailable, since an end
may be missed, and start again from what the server says once they're back.

Memory used, CPU used, each job's sensor and the picture settings start
turned off, as most people don't need them. Turn one on under the entity's
settings in Home Assistant.

The **Move camera** action, `kestrel.ptz_move`, turns a camera that pans or
tilts for a number of seconds, then stops it. It fails on a camera that
can't pan or tilt.

| Field   | What it is                                                    | Default |
| ------- | ------------------------------------------------------------- | ------- |
| Pan     | How fast to turn, from -1, left at full speed, to 1, right    | 0       |
| Tilt    | How fast to tilt, from -1, up at full speed, to 1, down       | 0       |
| Seconds | How long to move for, from 0.1 to 60, before the camera stops | 1       |

```yaml
action: kestrel.ptz_move
target:
  entity_id: camera.driveway
data:
  pan: 0.5
  seconds: 2
```

## Live video

Live video plays over WebRTC from the server's go2rtc, through its
`/go2rtc/` WebSocket, signed in as Home Assistant. Home Assistant's own
stream, which recording, the record action and other integrations use,
reads the camera over [RTSP](/api#rtsp) on port 7383, so that port needs to
reach the server from Home Assistant. Stills are the camera's own where it
has them, else a frame of its small stream.

## Recordings

Every camera's recordings are under **Media > Kestrel**, by camera and day,
for this month and the two before. They play from the server, through Home
Assistant, so they need no shared folder.

## How it stays up to date

Detections, the alarm input and alerts come straight from the server's live
events as they happen. Should the events stream drop, the integration
connects again by itself, after 1, 2, 5 and 10 seconds, then every 30.

The rest is read from the server:

| What                                                               | How often                           |
| ------------------------------------------------------------------ | ----------------------------------- |
| Sources, cameras, signal, storage, clip uploads and what needs you | Every 30 seconds                    |
| Memory, CPU, disk and the server's jobs                            | Every minute                        |
| Zoom, presets, tracking and picture settings                       | Every 5 minutes, and after a change |

A source that's down turns its Connected sensor off and leaves its cameras'
entities unavailable, and the other sources carry on.

## Use cases

- Get a notification with a picture when someone comes to the door, from
  a Reolink camera's Person sensor.
- Turn on a light when a camera sees motion after dark.
- Hear about a full or failing disk, or a camera losing its picture, from a
  source's Alert.
- Turn a camera off while you're home, and on again when everyone leaves.
- Send a moving camera to a preset, or home, when a door opens.
- Watch the day's recordings from the media browser, or cast one to a TV.

## Examples

A notification when the front door camera sees a person, with its picture:

```yaml
alias: Person at the front door
triggers:
  - trigger: state
    entity_id: binary_sensor.front_door_person
    to: "on"
actions:
  - action: notify.mobile_app_phone
    data:
      message: Someone's at the front door
      data:
        image: /api/camera_proxy/camera.front_door
```

A notification when a recorder reports a disk alarm:

```yaml
alias: Recorder disk alarm
triggers:
  - trigger: state
    entity_id: event.swann_alert
conditions:
  - condition: state
    entity_id: event.swann_alert
    attribute: event_type
    state: disk_alarm
actions:
  - action: notify.mobile_app_phone
    data:
      message: The recorder has reported a disk alarm
```

Point a moving camera at the gate when it opens:

```yaml
alias: Look at the gate
triggers:
  - trigger: state
    entity_id: binary_sensor.gate
    to: "on"
actions:
  - action: select.select_option
    target:
      entity_id: select.driveway_preset
    data:
      option: Gate
```

## Known limitations

- A source doesn't say which detections it has, so only Motion shows at
  first. The others show the first time the camera reports one.
- The media browser lists this month's recordings and the two months'
  before. A camera's own SD card recordings show, but don't play.
- **Move camera** turns a camera at a speed for a while: it can't point it
  at a position. Presets can be gone to, but not saved or renamed.
- Home Assistant's own stream, used for recording and the record action,
  needs the server's RTSP port, 7383, to be open to Home Assistant.
- Removing the integration leaves Home Assistant paired in Kestrel.

## Troubleshooting

- **Couldn't reach a Kestrel server there**: check the server is running and
  that Home Assistant can reach its port, 7380 unless you changed it.
- **That code is wrong, used, or out of time**: a pairing code works once,
  for five minutes. Make a new one in Kestrel.
- **Home Assistant asks to pair again**: it was removed from Kestrel's
  devices. Make a new code in Kestrel and enter it.
- **A repair says the server is too old**: update Kestrel. The integration
  starts again by itself once the server is new enough.
- **Live video doesn't play**: the video goes from the server's go2rtc
  straight to your browser or app, so check Kestrel's own Live page plays on
  the same device. Recording in Home Assistant needs RTSP on port 7383.
- **Detections are unavailable**: the server's live events are cut off. They
  come back by themselves once the server answers again.

If it's still not right, download the diagnostics from the server's menu
under **Settings > Devices & services > Kestrel**, which leave out its
address and sign-in, and turn on debug logging there, then
[open an issue](https://github.com/timmo001/kestrel/issues) with both.

## Removing

Remove the integration in Home Assistant under **Settings > Devices &
services > Kestrel**: open the server's menu and select **Delete**. That
leaves Home Assistant paired in Kestrel, so remove it there too, under
**Settings > Devices** in Kestrel. With the Home Assistant app, the server
offers itself again until the app is removed. To remove the integration's
files, uninstall Kestrel in the Marketplace and restart Home Assistant.
