On device recordings - cbrightly/hass-aidot-cameras GitHub Wiki

On-device recordings (SD card)

Cameras with an SD card list what is on it in the Home Assistant Media panel, under AiDot -> <camera name> -> On device. This works with no cloud storage plan and no internet - it asks the camera directly.

Recordings are listed, not played. Pulling video off the card is a protocol this integration has not exercised, so the entries are not playable. Cloud clips are playable - see Cloud recordings. Tapping an entry does not play it; it tells you the recording is on the SD card and to open it in the AiDot app to watch.

What the folder is called tells you the state

The folder name carries the answer, so you do not have to open it:

Folder reads What it means
On device - as of 14:32 A listing was taken at that time. Open it for day folders.
On device - no card The camera reports there is no SD card in the slot.
On device Nothing has been listed yet, or the camera did not answer. Open it for which.

The time is shown because browsing never refreshes the list - see the cost below - so a list you are looking at may be old, and a folder that could not say how old would be worse than one that says nothing.

Why browsing does not refresh

Reading the card requires an open connection to the camera: 15-21 seconds on a mains camera, up to 70 on a battery one, and it wakes the camera. Reading the cloud, by contrast, is a fraction of a second.

So the listing is taken only when a connection already exists for some other reason - a live view, or a motion event - and the cached list is at least 15 minutes old. Opening the folder just shows you the last one taken.

Getting it now

Every camera has a Refresh on-device recordings button. That one path is allowed to open a connection on purpose, because a person asked for it. Expect it to take as long as a cold live view on that camera.

An empty folder always says which kind of empty

Four situations produce no recordings and they call for different actions, so each says which:

  • "There is no SD card in this camera." The camera reports an empty slot. Nothing to do but put a card in.
  • "Not listed yet - press the 'Refresh on-device recordings' button, or open the live view." No listing has been taken. Either action takes one.
  • "The camera did not answer when asked what it holds." The request went out and the camera said nothing. Some models do not report their card contents at all; a camera that was offline or busy looks the same from here. Try Refresh again - and if it never answers, see below.
  • "The camera reports nothing recorded on its card in this window." The camera answered, and the answer was an empty card for the last 7 days.

A camera that did not answer is never reported as an empty card. Those are different facts and only one of them is something the camera actually said.

Known limitations

  • Some models never report their card. Fixed in library 1.0.0b34, which the integration picks up automatically. Cameras on the SDES transport send a long listing in several fragments, and the integration used to read each fragment as a complete reply: the first was rejected as truncated and the rest decoded as noise, so a reply that had arrived was reported as silence. Every camera tested now returns its listing. If you still see "The camera did not answer", it now means what it says - the request went out and nothing came back.
  • "No card" is only shown when the camera says so. Most cameras report nothing at all about their slot, and those keep the neutral wording. An absent reading is not evidence a model cannot report.
  • The list is capped by what one reply carries. The reply is paged and there is no continuation request, so a truncated list says "The camera sent a partial list - there may be more on the card than is shown" rather than silently looking complete.
  • No playback, as above.