github rroller/dahua 2.1.0

2 hours ago
  • Illuminator entities: A named white-light row without a MiddleLight, NearLight or FarLight brightness bank no longer creates an Illuminator entity. This removes controls whose writes target a nonexistent brightness field and are refused. Review affected automation/dashboard references.
  • VTH camera-related entities: A monitor with no Local0 camera declaration and an explicitly refused VideoInput table loses the nonworking camera-related entities, including motion controls. Retire affected dashboard and automation references. Session failures leave the capability undecided.
  • HTTP indoor monitors: This release migrates generated identities to the real serial. The log names a private directory containing copies of the three persisted registries. Keep your Home Assistant backup; resolve any logged identity conflict or backup failure before retrying setup.
  • Alarm inputs: Retarget automations and dashboards from the old per-camera Alarm Local sensors to the corresponding recorder terminal sensors. The old sensors become unavailable; their registry entries remain for reference.
  • Relay outputs: Update automations and dashboards that used duplicate per-channel relay switches to use the recorder's relay switches.

2.1.0 is a stable release, promoting the reviewed 2.1.0 RC series. Requires Home Assistant 2026.8.0 or newer.

Image controls and camera actions

  • Mirror and Image Rotation: Add capability-gated configuration entities for the channel’s reported VideoImageControl fields. Mirror writes only Mirror; Image Rotation offers 0° and 180° and writes only Flip. Capability detection, state and writes use the coordinator’s own channel. Rotation changes are refused when Rotate90 is unsupported or unknown. Temporary polling failures preserve the last known image-control values. (#1160)
  • Gamma: Add a 0–100 slider when the device reports Gamma for the channel’s general VideoColor profile. Reads and writes target that channel, profile and field. (#1154)
  • Video Color Style: Add a configuration select with Soft, Standard and Vivid when the channel reports Style. Unknown returned values remain unknown; unsupported requested values are rejected before reaching the device. VideoColor probing and polling work when Select is enabled without Number. (#1154)
  • Autofocus: Add dahua.autofocus for motorized lenses using the parameter-free autoFocus CGI command. Device errors reach the caller. (#1165)
  • Keep H.265 when live view works: The playback repair offers an explicit choice to keep H.265 and dismiss its warning. The choice is remembered per entry and can be reversed in the entry’s options. (#1140)

Important

Image-control hardware coverage: The #1160 contributor reports physical-camera read-back confirming targeted Mirror and Flip writes preserve sibling settings; 90° and 270° were refused and are not offered. Recorder channel routing was verified with simulated responses. Targeted Gamma and Style writes have not been verified on physical hardware: the contributor’s browser capture shows Gamma changing from 50 to 53 and Style set to Standard, while the integration’s targeted CGI paths and Soft/Vivid writes still need device-side confirmation.

Autofocus limitations: The #339 reporter supplied the endpoint used on an HFW5241E-Z12E. Its exact response body and recorder behavior remain unverified. The action carries no channel and requires an exact OK response, matching the existing focus/zoom action.

Device clock and NTP actions

  • Set Device Clock: Add dahua.set_time, defaulting to Home Assistant’s current local time when no time is supplied. An aware supplied time is converted to Home Assistant’s local timezone. This sets the whole device, including every channel of a recorder. The contributor measured the clock write and revert on a VTO2000A. (#1139)
  • Set NTP Server: Add dahua.set_ntp_server for devices reporting an NTP server field. It uses the reported flat/primary-list fields, preserves the secondary fallback, and checks every requested setting in the read-back, including enable flags, ports and a requested update period. Unsupported requested fields are rejected before writing. (#1139)

Important

NTP configuration has not been verified on hardware. Its table shapes were measured on a DHI-NVR5464-16P-EI and a VTO2000A; write and read-back behavior was tested with simulated device responses. Some doorbells have no NTP server field and refuse that action; dahua.set_time is the available clock-setting path on those devices.

Doorbell events and diagnostics

  • Identify the device on raw events: Add the Home Assistant registry device_id to dahua_event_received on both CGI and DHIP transports when the device can be resolved. Recorder channels use their own registered device; the field is absent before registration. Existing event fields and entity triggers continue to work. The README shows how to filter by device_id. (#1161)
  • Select DoorbellPressed for access controllers with a call button: Enable the event in the entry’s event selection to get the Button Pressed binary sensor and Doorbell event entity, including on devices not classified as doorbells. CGI DoTalkAction events ring only for Invite; answering or ending a call does not generate another press. The missing-State Pulse path works without changing BackKeyLight’s state checks. (#1147)
  • Subscribe to the raw sources behind selected events: The CGI request includes sources of selected derived events, covering DoorbellPressed and Smart Motion selections. Diagnostics reports the actual wire subscription. Duplicate doorbell sensors are avoided when DoorbellPressed is explicitly selected. Existing event selections are preserved. This targets CGI streams; RPC2-only polling does not gain derived-source expansion. (#1147)
  • Correct shared-session diagnostics: Read RPC2 session, keepalive and refusal state using the client’s actual key, including the port. Devices sharing an address on different ports remain separate. Diagnostics adds no device requests. (#1163)

The #1147 owner confirmed one ring per call and a five-second Button Pressed indication on two access controllers, with no extra rings on Answer or Hangup.

Setup, migration and reliability

  • Make serial-migration conflicts actionable: Permanent registry collisions stop setup with a notification instead of retrying indefinitely. A confirmation repair is offered only when its proposed removals would clear every migration blocker. Otherwise, manual guidance names the unresolved conflicts and explains when to reload the entry. Messages identify both sides of a conflict. (#1146, #1144)
  • Validate before any removal: The repair lists affected records and unrelated entities it preserves, backs up the registries, and compares the complete plan with the displayed confirmation and again after backup. Changed ownership, holders, collision eligibility or remaining blockers stop removal. Unrelated attached entities keep their IDs and can migrate onto the surviving serial device. Review proposed removals before confirming: deleting a record can break automation or dashboard references. (#1146)
  • Ask getSerialNo before generating an identity: Cameras that refuse getSystemInfo get the alternate CGI serial read before falling back to a generated identity. Existing registry rows migrate while preserving entity IDs and device metadata. Once a reported serial is adopted, the policy persists across reloads; if neither serial read later succeeds, setup retries instead of creating duplicate entities under the old generated identity. (#1141)
  • Keep manual guidance visible: A known remaining blocker raises its notification directly, including after the backup check. An unrelated failed reload cannot dismiss that guidance. Nothing is deleted on this route. (#1149)
  • Unblock upgrades with disabled duplicate records: A disabled legacy row or device blocked by an enabled record already carrying the reported serial is left intact and no longer prevents setup. The decision is recomputed after registry backup, immediately before migration. Enabled conflicts and disabled-versus-disabled conflicts still stop migration. Retained disabled records are not offered by the cleanup repair. The contributor reported restored startup on the affected recorder with 44 duplicate pairs before the additional backup-race checks were added. (#1145)
  • Avoid a stuck channel-search dialog on fast searches: Discovery gets up to two seconds to finish before showing progress. Searches finishing during that grace go directly to the naming form or available-channel selection, preserving the result. Slower searches keep their progress dialog and continue without cancellation. This targets the VTH2421F-P report in #949; #1000 has not been confirmed to share the same cause. The existing exclusion of a monitor’s Local0, Vto00 and Ipc display rows from recorder channel discovery is also covered by regression tests. (#1150)
  • Retry challenged audio uploads: Fix dahua.play_audio when a device challenges the audio POST with HTTP 401. The complete clip retries once with the fresh challenge and per-attempt state under the same speaker lock. A second refusal is reported. The contributor reports owner verification on the affected Empiretech Color4M. (#1137)
  • Home Assistant compatibility: Remove the deprecated CONNECTION_CLASS config-flow attribute. The manifest continues to declare local_polling. (#1153)

Important

Channel-search limitation: The two-second grace mitigates the existing progress-subscription race; a search finishing just beyond it can still hit that race. The upstream frontend catch-up fix is tracked in home-assistant/frontend#54866.

Documentation and development

  • Clarify silent-audio troubleshooting using contributor measurements on a DHI-VTO2211G-WP-S2 running 4.810.0000000.3.R: nine CGI multipart pushes were silent while two go2rtc RTSP backchannel pushes were audible. The workaround was tested through go2rtc 1.9.14’s own API; Home Assistant’s embedded go2rtc has not been verified for this use. This documentation does not add backchannel playback to dahua.play_audio. (#1148)
  • Update the development Black dependency to 26.10.1. This tooling dependency is not part of the HACS integration ZIP. (#1142)
  • Remove an event-test listener-order assumption while continuing to assert the exact sender-to-device-ID mapping. (Test follow-up)

No automatic entity removals or entity-ID renames are introduced compared with 2.0.0. The additional removal notices below apply when upgrading from 1.x.

Warning

Illuminator entities removed on affected channels: Channels that explicitly report a white emitter without a supported brightness bank no longer get an Illuminator light entity. Check automations and dashboards that reference it and remove or update affected references before upgrading.

Indoor monitors with no camera: Affected VTH monitors that do not describe a local camera and explicitly refuse the VideoInput table no longer get camera-related entities. Existing registry rows can remain unavailable. Review automations and dashboards that reference them.

Take a Home Assistant backup before upgrading. Existing HTTP indoor monitors now migrate their registry identities to their reported serial. Entity IDs are preserved. An unresolved registry conflict stops setup and raises repair or manual guidance; a backup failure retries without mutating the registries.

Affected recorder automations and dashboards need updating. This release removes the old per-camera Alarm Local sensors on recorders with the new terminal sensors and consolidates duplicate per-channel relay switches on the recorder.

Validation

The release code passes 5,735 tests, including all three real-ffmpeg conversion cases. All 359 Python files pass Black 26.10.1. Independent review checks cover image-control channel routing, unsupported-rotation refusal, polling failure recovery, autofocus through Home Assistant’s service registry, and event device-registry ownership. Deliberate handler-name, diagnostics-key and event-order regressions make their checks fail. Release CI validates HACS, Hassfest, formatting, the full test suite, tag/manifest agreement, ZIP layout and HACS visibility. The downloadable ZIP is verified byte for byte against the tagged integration files.

Hardware measurements were supplied by contributors; remaining hardware limitations are stated above.

2.0.0 release notes and upgrade instructions

Full changelog: 2.0.0...2.1.0

Don't miss a new dahua release

NewReleases is sending notifications on new releases.