Skip to content

EN Home Assistant

Guiyomee edited this page Nov 27, 2026 · 6 revisions

Home Assistant

Français

RustNVR joins Home Assistant through MQTT with automatic discovery: no integration to install, the entities show up by themselves. Checked with a real Home Assistant installation. The example automations below use these entities; check the exact identifiers in Settings → Devices & services → Entities.

1. Connecting RustNVR

  1. In Home Assistant: install the Mosquitto broker add-on and the MQTT integration; create a dedicated Home Assistant user (for example rustnvr), which the broker accepts.
  2. In RustNVR: Settings → MQTT / Home Assistant, tick « Connect », enter the address of Home Assistant, port 1883 (or 8883 with TLS), the user and the password, then Save and connect. The state becomes « Connected ».
  3. In Home Assistant: Settings → Devices & services → MQTT: a « RustNVR » device and one device per camera.

Topics, TLS, behaviour on failure (in French): docs/MQTT.md.

2. Entities

The entity names are in French (Home Assistant does not translate them), so are their identifiers. For a camera named « Jardin » (garden):

Entity Identifier Use
Mouvement (motion) binary_sensor.jardin_mouvement trigger for automations
Connexion (connection) binary_sensor.jardin_connexion camera offline
Enregistrement continu (recording) binary_sensor.jardin_enregistrement_continu state
Détection de mouvement switch.jardin_detection_de_mouvement turn detection on / off
Enregistrement du son switch.jardin_enregistrement_du_son record sound or not
Vision nocturne (night vision) binary_sensor.jardin_vision_nocturne the camera films in infrared (black and white picture) (since 2026.11.07)
Redémarrer la caméra (restart) button.jardin_redemarrer_la_camera cameras with an ONVIF port (since 2026.11.07)
Caméra active switch.jardin_camera_active off: camera paused (no connection, no recording) until switched on again or RustNVR restarts (since 2026.11.07)
Notifications switch.jardin_notifications off: no more notifications (webhooks) of its motion, objects and crossings; it still records, failures still go through (see Notifications) (since 2026.11.09)
Personne (person) binary_sensor.jardin_personne (with AI) person recognized during the motion
Dernier mouvement (last motion) camera.jardin_dernier_mouvement picture of the start of the last event
Dernière personne (last person) camera.jardin_derniere_personne (with AI) picture of the recognized person, with its box
Mode d'enregistrement select.jardin_mode_d_enregistrement « Continu », « Sur mouvement », « Arrêté »
Créer un événement (create an event) button.jardin_creer_un_evenement 30 s manual event (doorbell, alarm…)
Prendre une capture (take a capture) button.jardin_prendre_une_capture a picture right now, on the « Capture » entity
Capture camera.jardin_capture last picture taken by the button
Position PTZ select.jardin_position_ptz motorised cameras: go to a saved position
PTZ gauche, droite, haut, bas, zoom avant, zoom arrière (left, right, up, down, zoom in, zoom out) button.jardin_ptz_gauche… motorised cameras: each press moves the camera for a moment (since 2026.11.08)
Présents · line sensor.… and a reset button lines counting presence

« RustNVR » device: sensor.rustnvr_cameras_en_ligne (cameras online), sensor.rustnvr_disque_des_enregistrements (recordings disk, % used), « Low disk space » and « Degraded storage » (binary_sensor, « problem » class), and switch.rustnvr_detection_toutes_les_cameras: detection running or paused on all cameras.

Some identifiers follow Home Assistant's naming rule without having been read on a real installation: check them in the entity list. They all become « unavailable » when RustNVR stops.

3. Live video in Home Assistant

The MQTT camera entity is the still picture of the last motion. For live video, turn on the RTSP republication, then add the Generic Camera integration with the address shown in the camera's Configuration tab:

rtsp://<rustnvr-machine>:8554/jardin/sub     (sub-stream, lighter)
rtsp://<rustnvr-machine>:8554/jardin         (main stream)

Transport TCP; the republication's user name and password, or the camera's own if it has some. Home Assistant reads the stream RustNVR already receives: the camera still sees one connection, and nothing is converted (an H.265 camera stays H.265). If Home Assistant runs on another machine, the listening address must be 0.0.0.0:8554, with a password; do not expose it on the Internet.

Example dashboard:

type: vertical-stack
cards:
  - type: picture-entity
    entity: camera.jardin_dernier_mouvement
    name: Garden — last motion
    camera_view: auto
  - type: entities
    entities:
      - binary_sensor.jardin_mouvement
      - binary_sensor.jardin_connexion
      - switch.jardin_detection_de_mouvement
      - sensor.rustnvr_cameras_en_ligne
      - sensor.rustnvr_disque_des_enregistrements

4. The interface in the side panel (since 2026.11.08)

The whole RustNVR interface (live view, playback, events, settings) can open in Home Assistant's side panel, like Frigate with « Frigate Proxy ». It is the RustNVR Proxy app, shipped in the RustNVR repository, for Home Assistant OS or Supervised. RustNVR keeps running where it is (Docker, Proxmox, Debian): the app only relays. No extra port to open: everything goes through Home Assistant, including from its mobile app and remotely.

  1. Settings → Apps → App store → ⋮ → Repositories: add https://github.com/Guiyomee/RustNVR-HomeAssistant (since 2026.11.11; before: https://github.com/Guiyomee/RustNVR). Already installed from the old repository: add the new one, install « RustNVR Proxy » from it with the same options, then uninstall the old one and remove the old repository.
  2. Install RustNVR Proxy. In Configuration, set server to the address of RustNVR as Home Assistant sees it, without a path, for example http://192.168.1.10:8080 (or https://… if RustNVR serves HTTPS itself). Since app 1.1.0, two more options:
    • page: the page the panel opens on, overview (the default), wall (video wall), events, images or playback. It applies to every device; left on overview, each browser follows its own home page (Settings → General, since 2026.11.09);
    • users (optional): the Home Assistant users who may open the panel, administrators included (see below).
  3. Start the app and tick « Show in sidebar ». The RustNVR panel opens the interface; if accounts are set up, sign in once (the session is kept).

Who sees the panel (since app 1.1.0): every Home Assistant user, administrator or not. What each one can do depends on their RustNVR account: give a viewer account to those who should only watch (see Accounts and security).

  • Without users, the app opens the interface only when RustNVR asks for a login. With no accounts there, the panel shows a page explaining it, otherwise any Home Assistant user could change everything: first create an administrator account by opening RustNVR at its address.
  • With users, only those users get in (the user name, not the display name), even when RustNVR has no accounts. A refused user sees their user name on the refusal page: copy it into users.

If accounts are set up, declare Home Assistant as a trusted proxy: failed logins then lock out the person who mistyped, not the whole of Home Assistant (see Accounts and security).

[web]
trusted_proxies = ["192.168.1.5", "172.30.32.0/23"]   # Home Assistant's IP, internal network of its apps

Troubleshooting

  • Blank page or « 502 »: Home Assistant cannot reach RustNVR; check server (the app's log).
  • « … will not allow the page to be displayed when embedded by another site » (or « refused to connect »): RustNVR serves HTTPS itself and server starts with http://. RustNVR then sends the browser to its direct address, which refuses to be shown in a frame. Set server to https://… and restart the app.
  • The interface shows but no video: the live view uses a WebSocket; a reverse proxy in front of Home Assistant must let them through (Home Assistant itself already needs that).
  • Back to the login page with no message: the browser refuses the session cookie. A rustnvr_session cookie left by a direct HTTPS visit to the same address can get in the way: clear the cookies of Home Assistant's site.
  • « cross-origin request refused »: a reverse proxy in front of Home Assistant must pass the original Host header (or X-Forwarded-Host).

RustNVR inside Home Assistant: the « RustNVR » app (BETA, since 2026.11.11)

No other machine needed: the RustNVR app runs RustNVR itself in Home Assistant OS (mini-PC, NUC, VM on x86-64, or Raspberry Pi 4 and 5). It is its first public version: it is marked « experimental » in the app store, tell us what goes wrong.

  1. Same repository as above (https://github.com/Guiyomee/RustNVR-HomeAssistant), then install RustNVR (not « RustNVR Proxy »).
  2. Configuration: the password of RustNVR's admin account (at least 8 characters).
  3. Start the app, tick « Show in sidebar », open the panel, log in as admin and add your cameras.

Recordings go to /media/rustnvr (the « Media » folder, outside Home Assistant's backups); a NAS added in Home Assistant (Settings → System → Storage → Network storage, usage « Media ») is then chosen in RustNVR's Settings → Storage. MQTT is set in the app's Configuration tab: without a broker address, Home Assistant's Mosquitto is used by itself; the app shows there as rustnvr-ha, so as not to disturb another RustNVR on it. Port 8080 (the app's Network tab, closed by default) opens the interface outside Home Assistant, over HTTP. ONVIF discovery (multicast) does not work from the app: enter the cameras' address by hand if needed.

5. Automations

Replace mobile_app_my_phone with your device.

Notification with the motion picture. The delay lets RustNVR publish the picture (taken less than a second after the start):

alias: Motion in the garden
triggers:
  - trigger: state
    entity_id: binary_sensor.jardin_mouvement
    to: "on"
actions:
  - delay: "00:00:02"
  - action: notify.mobile_app_my_phone
    data:
      title: Motion — Garden
      message: "{{ now().strftime('%H:%M:%S') }}"
      data:
        image: /api/camera_proxy/camera.jardin_dernier_mouvement
mode: single

Notification when a person is recognized (AI, see Detection and AI): the picture is the one where the person was recognized, with its box, published before the sensor turns on.

alias: Person in the garden
triggers:
  - trigger: state
    entity_id: binary_sensor.jardin_personne
    to: "on"
actions:
  - action: notify.mobile_app_my_phone
    data:
      title: Person detected — Garden
      message: "{{ now().strftime('%H:%M:%S') }}"
      data:
        image: /api/camera_proxy/camera.jardin_derniere_personne
mode: single

Pausing all detection while someone is at home, resuming when everyone leaves, without touching the cameras' settings:

alias: RustNVR by presence
triggers:
  - trigger: state
    entity_id: zone.home
actions:
  - action: >-
      {{ 'switch.turn_off' if states('zone.home') | int(0) > 0 else 'switch.turn_on' }}
    target:
      entity_id: switch.rustnvr_detection_toutes_les_cameras

For one camera only, the same on switch.jardin_detection_de_mouvement. To turn an indoor camera off completely while someone is home (no connection, no recording), the same automation on switch.salon_camera_active: RustNVR resumes it when everyone leaves, or at its next restart.

Doorbell: create an event and take a picture when someone rings (replace binary_sensor.doorbell with your doorbell):

alias: Doorbell
triggers:
  - trigger: state
    entity_id: binary_sensor.doorbell
    to: "on"
actions:
  - action: button.press
    target:
      entity_id:
        - button.entree_creer_un_evenement
        - button.entree_prendre_une_capture
  - delay: "00:00:03"
  - action: notify.mobile_app_my_phone
    data:
      title: Someone is ringing
      message: "{{ now().strftime('%H:%M:%S') }}"
      data:
        image: /api/camera_proxy/camera.entree_capture
mode: single

An event of another length: mqtt.publish on rustnvr/entree/event/create with payload: "120" (seconds).

Recording everything while the alarm is armed (« Sur mouvement » the rest of the time):

alias: Recording by alarm
triggers:
  - trigger: state
    entity_id: alarm_control_panel.home
actions:
  - action: select.select_option
    target:
      entity_id: select.jardin_mode_d_enregistrement
    data:
      option: >-
        {{ 'Continu' if is_state('alarm_control_panel.home', 'armed_away') else 'Sur mouvement' }}

Camera offline for 5 minutes, disk nearly full:

alias: Camera offline
triggers:
  - trigger: state
    entity_id: binary_sensor.jardin_connexion
    to: "off"
    for: "00:05:00"
actions:
  - action: notify.mobile_app_my_phone
    data:
      message: The Garden camera has not answered for 5 minutes.
alias: RustNVR disk nearly full
triggers:
  - trigger: numeric_state
    entity_id: sensor.rustnvr_disque_des_enregistrements
    above: 90
actions:
  - action: notify.mobile_app_my_phone
    data:
      message: "Recordings disk at {{ states('sensor.rustnvr_disque_des_enregistrements') }} %."

The detection switch has the same effect as the checkbox in the interface: the setting is saved and survives a restart. Turning detection off does not stop continuous recording; a camera « on motion » records nothing while detection is off.

6. Limits

  • No playback in Home Assistant cards: open the RustNVR interface, in the side panel (see above) or through a button card with a url action.
  • Entity names are in French.
  • The recording mode can only be changed for cameras added from the interface (those of config.toml stay as the file says).
  • Only « Personne » and « Dernière personne » are entities: the other recognized objects are in the MQTT event message, and their picture in rustnvr/<camera>/<object>/snapshot (to declare yourself as an MQTT camera).

Clone this wiki locally