Skip to content

[dahuadoor] Extend snapshot handling and align WebRTC URL - #20759

Merged
lsiepel merged 2 commits into
openhab:mainfrom
svnsssd:dahua-event-files
May 19, 2026
Merged

[dahuadoor] Extend snapshot handling and align WebRTC URL#20759
lsiepel merged 2 commits into
openhab:mainfrom
svnsssd:dahua-event-files

Conversation

@svnsssd

@svnsssd svnsssd commented May 19, 2026

Copy link
Copy Markdown
Contributor

Description

This PR extends the DahuaDoor binding snapshot pipeline:

  • add snapshotMode=dhip to download event files (ring, hangup, unlock, recordings, video messages) from the VTO SD card, with new path/toggle/maxEvents options and grouped cleanup
  • keep snapshotMode=api for live snapshots when no SD card/events are used, and update VTO3211 lock-aware naming
  • align the WebRTC URL to /dahuadoor/webrtc/session?thing=... and fall back to a default stream when no SIP client is available
  • update documentation and i18n labels to match the new options and file formats

Testing

  • mvn clean install -DskipTests (bundles/org.openhab.binding.dahuadoor)
  • functional test for VTO2202

Signed-off-by: Sven Schad <svnsssd@gmail.com>
@lsiepel
lsiepel requested a review from Copilot May 19, 2026 16:56
@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label May 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the DahuaDoor binding’s snapshot subsystem by adding a DHIP “event file” download pipeline (NewFile-based) alongside the existing live HTTP snapshot mode, and it standardizes the WebRTC SDP proxy URL around /dahuadoor/webrtc/session?thing=... with a fallback when no SIP client is available. It also updates thing definitions, i18n labels, and README documentation to expose/describe the new configuration options and file naming/retention behavior.

Changes:

  • Add snapshotMode=dhip and related download/toggle/path/retention configuration for DHIP NewFile event files (snapshots, hangup, unlock, recordings, video messages), plus grouped cleanup.
  • Align WebRTC URL publication to /dahuadoor/webrtc/session?thing=... and add a “default stream” fallback when no SIP client is free/available.
  • Update VTO3211 lock-aware snapshot naming and refresh README/i18n/thing XML to match new options and formats.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
bundles/org.openhab.binding.dahuadoor/src/main/resources/OH-INF/thing/vto3211.xml Adds new DHIP snapshot/event download configuration parameters for VTO3211.
bundles/org.openhab.binding.dahuadoor/src/main/resources/OH-INF/thing/vto2202.xml Adds matching DHIP snapshot/event download configuration parameters for VTO2202.
bundles/org.openhab.binding.dahuadoor/src/main/resources/OH-INF/i18n/dahuadoor.properties Adds i18n labels/descriptions/options for the new config parameters.
bundles/org.openhab.binding.dahuadoor/src/main/java/org/openhab/binding/dahuadoor/internal/media/PlayStreamServlet.java Implements /webrtc/session default-stream fallback when no SIP client is available.
bundles/org.openhab.binding.dahuadoor/src/main/java/org/openhab/binding/dahuadoor/internal/DahuaVto3211Handler.java Adds lock-aware channel/suffix mapping and bypasses API snapshot when in DHIP mode.
bundles/org.openhab.binding.dahuadoor/src/main/java/org/openhab/binding/dahuadoor/internal/DahuaVto2202Handler.java Bypasses API snapshot when in DHIP mode and reuses shared API snapshot helper.
bundles/org.openhab.binding.dahuadoor/src/main/java/org/openhab/binding/dahuadoor/internal/dahuaeventhandler/DahuaEventClient.java Adds DHIP FileManager.downloadFile support and refactors frame parsing to raw payloads.
bundles/org.openhab.binding.dahuadoor/src/main/java/org/openhab/binding/dahuadoor/internal/DahuaDoorConfiguration.java Introduces new config fields (mode/toggles/paths/maxEvents) with defaults.
bundles/org.openhab.binding.dahuadoor/src/main/java/org/openhab/binding/dahuadoor/internal/DahuaDoorBaseHandler.java Implements DHIP NewFile classification, download/store logic, retention cleanup, and WebRTC URL alignment.
bundles/org.openhab.binding.dahuadoor/README.md Documents new snapshot modes/options, storage layout, naming scheme, and updated WebRTC URL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bundles/org.openhab.binding.dahuadoor/README.md Outdated
Comment thread bundles/org.openhab.binding.dahuadoor/README.md Outdated
Signed-off-by: Sven Schad <svnsssd@gmail.com>

@lsiepel lsiepel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@lsiepel
lsiepel merged commit b43d8f3 into openhab:main May 19, 2026
2 checks passed
@lsiepel lsiepel added this to the 5.2 milestone May 19, 2026
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request May 19, 2026
)

* Improve snapshot handling and add VTO file retrieval, align WebRTC URL

Signed-off-by: Sven Schad <svnsssd@gmail.com>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Jun 13, 2026
)

* Improve snapshot handling and add VTO file retrieval, align WebRTC URL

Signed-off-by: Sven Schad <svnsssd@gmail.com>
darkscout pushed a commit to darkscout/openhab-addons that referenced this pull request Jul 5, 2026
)

* Improve snapshot handling and add VTO file retrieval, align WebRTC URL

Signed-off-by: Sven Schad <svnsssd@gmail.com>
olemr pushed a commit to olemr/openhab2-addons that referenced this pull request Aug 8, 2026
)

* Improve snapshot handling and add VTO file retrieval, align WebRTC URL

Signed-off-by: Sven Schad <svnsssd@gmail.com>
Signed-off-by: olemr <olemr@olemr.com>
cipianpascu pushed a commit to cipianpascu/openhab-addons that referenced this pull request Aug 16, 2026
)

* Improve snapshot handling and add VTO file retrieval, align WebRTC URL

Signed-off-by: Sven Schad <svnsssd@gmail.com>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature for an existing add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants