Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9bbe053
Add HomeKit Secure Video recording to HomeKit cameras
RaHehl Nov 5, 2026
6220d8c
Stop the recording stderr reader before killing ffmpeg
RaHehl Nov 5, 2026
0e3891d
Redact URLs from logged recording ffmpeg output
RaHehl Nov 5, 2026
c21a055
Bound the wait for ffmpeg and log recordings without video
RaHehl Nov 5, 2026
a0f7c08
Bump HAP-python to 5.2.0
RaHehl Nov 7, 2026
d757a0d
Merge remote-tracking branch 'origin/homekit-bump-hap-python-5-2-0' i…
RaHehl Nov 7, 2026
69d7c75
Advertise selectable recording formats and copy only H.264 sources
RaHehl Nov 7, 2026
ee1012f
Trust the copy setting and stop streams when the camera is turned off
RaHehl Nov 7, 2026
09be270
End live sessions fully when the camera is turned off
RaHehl Nov 7, 2026
f405be8
Check the recording container before starting ffmpeg
RaHehl Nov 7, 2026
ab5796f
Keep draining recording stderr after an overlong line
RaHehl Nov 7, 2026
313f42c
Wait for the first recording fragment as long as for the camera
RaHehl Nov 7, 2026
996221e
Merge branch 'dev' into homekit-recording-ffmpeg-recipe
bdraco Nov 7, 2026
5f3b43e
Use one recording timeout
RaHehl Nov 7, 2026
e0736dc
Merge recording tests that share their setup
RaHehl Nov 7, 2026
f1731a6
Simplify the recording loop and share the transport fixture
RaHehl Nov 7, 2026
611224a
Keep reading recording stderr after an overlong line
RaHehl Nov 7, 2026
76d7b71
Merge branch 'dev' into homekit-recording-ffmpeg-recipe
RaHehl Nov 7, 2026
fdeb759
Keep source video filters in recordings
RaHehl Nov 7, 2026
e790d39
Quote the recording video filter
RaHehl Nov 7, 2026
7cb2170
Apply source video filters in the order live streams use
RaHehl Nov 7, 2026
ab1e0fd
Drop the tail of overlong ffmpeg lines and warn on each failure kind
RaHehl Nov 7, 2026
49bfeb0
Log a filter flag without a filter instead of failing
RaHehl Nov 7, 2026
15a0101
Keep the next ffmpeg line after an overlong one and drain stderr first
RaHehl Nov 7, 2026
aa6a966
Tie the HomeKit camera recording tasks to the config entry
RaHehl Nov 11, 2026
8159fd0
Choose the HomeKit camera mode from a list instead of a switch
RaHehl Nov 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions homeassistant/components/homekit/accessories.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,10 @@ def async_reload(self) -> None:
(self.entity_id,),
)

def diagnostics(self) -> dict[str, Any]:
"""Return accessory specific diagnostics."""
return {}

@ha_callback
def async_stop(self) -> None:
"""Cancel any subscriptions when the bridge is stopped."""
Expand Down
53 changes: 34 additions & 19 deletions homeassistant/components/homekit/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
from homeassistant.loader import async_get_integrations

from .const import (
CAMERA_MODE_STANDARD,
CAMERA_MODES,
CONF_CAMERA_MODE,
CONF_ENTITY_CONFIG,
CONF_EXCLUDE_ACCESSORY_MODE,
CONF_FILTER,
Expand Down Expand Up @@ -566,6 +569,12 @@ async def async_step_cameras(
elif CONF_SUPPORT_AUDIO in entity_config:
del entity_config[CONF_SUPPORT_AUDIO]

camera_mode = user_input.get(CONF_CAMERA_MODE, CAMERA_MODE_STANDARD)
if camera_mode != CAMERA_MODE_STANDARD:
entity_config[CONF_CAMERA_MODE] = camera_mode
else:
entity_config.pop(CONF_CAMERA_MODE, None)

if not entity_config:
all_entity_config.pop(entity_id)

Expand All @@ -581,26 +590,32 @@ async def async_step_cameras(
if entity_config.get(CONF_SUPPORT_AUDIO):
cameras_with_audio.append(entity)

data_schema = probatio.Schema(
{
probatio.Optional(
CONF_CAMERA_COPY, default=cameras_with_copy
): selector.EntitySelector(
selector.EntitySelectorConfig(
multiple=True,
include_entities=(self.included_cameras),
)
),
probatio.Optional(
CONF_CAMERA_AUDIO, default=cameras_with_audio
): selector.EntitySelector(
selector.EntitySelectorConfig(
multiple=True,
include_entities=(self.included_cameras),
)
),
}
camera_selector = selector.EntitySelector(
selector.EntitySelectorConfig(
multiple=True, include_entities=self.included_cameras
)
)
schema: dict[probatio.Marker, selector.Selector] = {
probatio.Optional(
CONF_CAMERA_COPY, default=cameras_with_copy
): camera_selector,
probatio.Optional(
CONF_CAMERA_AUDIO, default=cameras_with_audio
): camera_selector,
}
# Accessory mode has a single camera.
if hk_options[CONF_HOMEKIT_MODE] == HOMEKIT_MODE_ACCESSORY:
camera_mode = all_entity_config.get(self.included_cameras[0], {}).get(
CONF_CAMERA_MODE, CAMERA_MODE_STANDARD
)
schema[probatio.Required(CONF_CAMERA_MODE, default=camera_mode)] = (
selector.SelectSelector(
selector.SelectSelectorConfig(
options=CAMERA_MODES, translation_key=CONF_CAMERA_MODE
)
)
)
data_schema = probatio.Schema(schema)
return self.async_show_form(step_id="cameras", data_schema=data_schema)

async def async_step_accessory(
Expand Down
7 changes: 7 additions & 0 deletions homeassistant/components/homekit/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
CONF_AUDIO_CODEC = "audio_codec"
CONF_AUDIO_MAP = "audio_map"
CONF_AUDIO_PACKET_SIZE = "audio_packet_size"
CONF_CAMERA_MODE = "camera_mode"
CONF_ENTITY_CONFIG = "entity_config"
CONF_FEATURE = "feature"
CONF_FEATURE_LIST = "feature_list"
Expand Down Expand Up @@ -110,6 +111,12 @@
DEFAULT_HOMEKIT_MODE = HOMEKIT_MODE_BRIDGE
HOMEKIT_MODES = [HOMEKIT_MODE_BRIDGE, HOMEKIT_MODE_ACCESSORY]

# #### Camera Modes ####
CAMERA_MODE_STANDARD = "standard"
CAMERA_MODE_SECURE_VIDEO = "secure_video"
DEFAULT_CAMERA_MODE = CAMERA_MODE_STANDARD
CAMERA_MODES = [CAMERA_MODE_STANDARD, CAMERA_MODE_SECURE_VIDEO]

# #### String Constants ####
BRIDGE_MODEL = "Bridge"
BRIDGE_NAME = "Home Assistant Bridge"
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/homekit/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ def _get_accessory_diagnostics(
}
if entity_state:
data["entity_state"] = async_redact_data(entity_state, TO_REDACT)
data.update(accessory.diagnostics())
return data
12 changes: 11 additions & 1 deletion homeassistant/components/homekit/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@
"cameras": {
"data": {
"camera_audio": "Cameras that support audio",
"camera_copy": "Cameras that support native H.264 streams"
"camera_copy": "Cameras that support native H.264 streams",
"camera_mode": "Camera mode"
},
"data_description": {
"camera_mode": "HomeKit Secure Video records when the camera's linked motion sensor detects motion. Requires a home hub and an iCloud+ plan."
},
"description": "Check all cameras that support native H.264 streams. If the camera does not output a H.264 stream, the system will transcode the video to H.264 for HomeKit. Transcoding requires a performant CPU and is unlikely to work on single-board computers.",
"title": "Camera configuration"
Expand Down Expand Up @@ -82,6 +86,12 @@
}
},
"selector": {
"camera_mode": {
"options": {
"secure_video": "HomeKit Secure Video (H.264 recording)",
"standard": "Standard (live view only)"
}
},
"climate_accessory_type": {
"options": {
"automatic": "Automatic",
Expand Down
Loading
Loading