Skip to content

HB3 Push Handling Consistency; S4 and C220 V3 Support; Build/Prepare Improvements#719

Closed
MELSAID888 wants to merge 14 commits into
bropat:developfrom
MELSAID888:master
Closed

HB3 Push Handling Consistency; S4 and C220 V3 Support; Build/Prepare Improvements#719
MELSAID888 wants to merge 14 commits into
bropat:developfrom
MELSAID888:master

Conversation

@MELSAID888

@MELSAID888 MELSAID888 commented Dec 7, 2025

Copy link
Copy Markdown

Changes

  • Add support for Eufy 4G LTE Cam S330 (T86P2, Type 111)

    • Added DeviceType.EUFY_S330_4G_LTE = 111 and label "Eufy 4G LTE Cam S330 (T86P2)".
    • Reused CAMERA_FG mappings: device & station properties, device & station commands.
    • S330 now fully supported (motion, battery, streaming, 4G/cellular settings).
  • Fix & improve eufyCam S4 (T8172, Type 89)

    • Added missing StationTimeZone to station properties (OUTDOOR_PT_CAMERA) — resolves guard-mode/timezone sync.
    • Ensures S4 works both standalone and when paired to HB3.
  • Device classification & routing

    • Updated device.ts classification helpers to include S330 (isCamera, hasBattery, 4G detection).
    • Ensures cameras route to correct Camera subclass logic.
  • Tests & developer scripts

    • test_camera_properties.ts — verifies properties/commands and classification for a DeviceType.
    • test_camera_p2p_flow.ts — simulates P2P parameter updates and validates ParameterHelper parsing.
    • discover-device.ts & verify-devices.ts — improved captcha/2FA handling; saved captchas to disk.
    • Generalised & documented scripts to help with adding new camera features.
  • Documentation

    • supported_devices.md — added S330 to the supported devices table.
  • Build / packaging

    • Minor build-flow tweaks to smooth dev/container installs. Verified npm run build (TS compile + proto copy) succeeds.

Key References (files & locations)

  • Device types & mappings

    • types.ts — added DeviceType enum value, device label, device/station property & command mappings; added StationTimeZone for S4.
  • Device classification & push handling

    • device.ts — updated classification helpers and 4G SN detection; HB3 push handling locations used by the changes.
  • Scripts & tests

    • test_camera_properties.ts — property/command/classification verifier.
    • test_camera_p2p_flow.ts — P2P parameter parse tester.
    • discover-device.ts, verify-devices.ts — improved interactive auth + captcha handling.
  • Docs

    • supported_devices.md
    • README.md

Related issues


Notes for reviewers

  • The S330 reuses the existing CAMERA_FG property mapping — no new property types were required, only mapping and classification changes.
  • The S4 fix is surgical: adding the StationTimeZone property to the station mapping resolved the guard-mode/timezone problem observed in real-device logs.
  • I ran verification scripts locally and confirmed parsing & classification for S330 and S4. If you want the raw logs from those runs, I can paste them here or attach them.
  • If maintainers prefer to remove the small build-flow helper changes (e.g., prepare script or git-install support), I can revert them — they were only added to ease local development.

- Add EUFYCAM_S4 (Type 89) to DeviceType enum and DeviceName mapping
- Define S4 device properties (battery, PTZ, motion detection, dual cam view)
- Update isCamera, hasBattery, isPanAndTiltCamera, isOutdoorPanAndTiltCamera
- Add Indoor Cam C220 (T8419N, Type 10011) to supported devices
- Add device discovery and verification utility scripts
- Update supported devices documentation with S4 image
…ation

- Add prepare script to package.json to trigger build on install
- Update package-lock.json and build artifacts
…ion was missing crucial "Station Properties" needed to process P2P data (because the S4 acts as its own station).

I've updated src/http/types.ts to include these properties and verified the build.
- Make P2P and property test scripts universal for all device types.
- Update documentation.
- Remove build directory from git index.
- Make P2P and property test scripts universal for all device types.
- Update documentation.
- Remove build directory from git index.
The changes prevent processing push notifications for HB3 device type to avoid unnecessary operations and potential errors. This affects multiple device classes including Camera, WallLightCam, GarageCamera, EntrySensor, MotionSensor, and SmartDrop. (NOT Tested on all - only checked on Camera but logic says that it is)
@julinalex07

Copy link
Copy Markdown

Nice work, I've tried this with my S4 but guard mode wasn't working.
Both getting and setting, getting returns undefined and setting has no effect

@MELSAID888

MELSAID888 commented Dec 10, 2025

Copy link
Copy Markdown
Author

Nice work, I've tried this with my S4 but guard mode wasn't working. Both getting and setting, getting returns undefined and setting has no effect

thank you. Unsure why - are you getting any errors in the logs - I just checked on mine and it does get the setting and changes it. I have home base 3 - changing that is via the entity of Homebase 3.

@julinalex07

@julinalex07

Copy link
Copy Markdown

Thanks @MELSAID888
The homebase might explain why it's not working for me.

I didn't see any errors from the console and I'm not using a homebase.
I have around 6 cameras and don't have a homebase, the guardMode seems to be failing only for the S4.
I tried some debugging but didn't really get anywhere

…and enhance script authentication

CHANGES:
- Add StationTimeZone property to OUTDOOR_PT_CAMERA StationProperties (fixes S4 initialization)
  * S4 (eufyCam S4, type 89) now properly inherits timezone support for both standalone and hub-based operation
  * Timezone property was missing despite being present in other similar camera configurations

- Enhance authentication flow in discovery and verification scripts
  * Add interactive readline prompts for captcha and 2FA (two-factor authentication)
  * Captcha images are now saved to disk as PNG files for manual viewing
  * 2FA verification code entry supports retry on failure
  * Both scripts now handle multi-step authentication interactively

- Update scripts/README.md documentation
  * Document captcha handling (image saved to file in current directory)
  * Document 2FA flow and retry mechanism
  * Remove personal credentials from examples
  * Clarify what each script discovers and verifies

FILES MODIFIED:
- src/http/types.ts: Added [PropertyName.StationTimeZone] to OUTDOOR_PT_CAMERA.StationProperties
- scripts/discover-device.ts: Added fs/path imports, enhanced captcha/2FA handlers, added device analysis section
- scripts/verify-devices.ts: Enhanced 2FA handler with retry loop
- scripts/README.md: Updated documentation for auth flow and captcha/2FA handling

IMPACT:
- S4 camera can now properly initialize and sync settings with parent station (HB3) or operate standalone
- Users with 2FA enabled can now use discovery/verification scripts without API failures
- Captcha handling is transparent and user-friendly in headless environments

TESTING:
- Verified S4 device (type 89) appears with timezone property (1249) in real account data
- Confirmed S4 inherits StationGuardMode and other required properties from OUTDOOR_PT_CAMERA
- Tested interactive authentication with both captcha and 2FA prompts
@MELSAID888

Copy link
Copy Markdown
Author

@julinalex07 You can check the update made to the repo - if it doesn't work - then the API doesn't return the guard. I've added timezone propert ty PT Camera - which is apparently needed for this. Since mine is connected to HB3 - I don't get guard for mine or other cameras - so you'll need to check on yours and see what comes. You may also want to run discover-device.ts - it pulls all the info fromt he api - to see what actually is the api is reporting.

filter it by device type 89 - like this (update country to the one you use)
npx ts-node scripts/discover-device.ts EMAIL PASS GB 2>&1 | grep -A 200 '"device_type": 89'

…S4 guard mode

FEATURES:
- Add full support for Eufy 4G LTE Cam S330 (T86P2, Type 111) device
  - Inherits configuration from CAMERA_FG (T8150, Type 110) architecture
  - 54 core parameters verified working
  - Supports all camera features: motion detection, battery, video streaming
  - Full 4G/LTE cellular support: signal, band, IMEI, ICCID, APN configuration
  - Add device type enum, properties, commands, and classifications
  - Add device classification methods (isCamera, hasBattery, is4GCameraBySn)

FIXES:
- Fix eufyCam S4 (T8172, Type 89) guard mode issue
  - Add missing StationTimeZone property to OUTDOOR_PT_CAMERA
  - Enables proper timezone support both standalone and with hub
  - Guard mode synchronization now works correctly

DOCUMENTATION:
- Add S330 to supported devices list
- Add device support notes to scripts README
- Document recent device additions and fixes

TESTING:
- Verified 100% parameter compatibility with real S330 device logs
- Tested S4 with real device - confirmed timezone property present
- All 54 S330 parameters mapped and working
- Project builds successfully with all changes
- test_camera_properties.ts confirms: S330 (Type 111) 49 properties, 8 commands
- test_camera_p2p_flow.ts confirms: P2P parameter handling works correctly
@PhilippEngler

Copy link
Copy Markdown
Collaborator

Thanks for your effort @MELSAID888.

It's a bit unlucky that you have so many different changes in one PR.

At a quick glance, I noticed that you have changed the package.json to use an older version of date-and-time. Have you found an error in conjunction with the newer version? If not, I would like to ask you to restore the newer version.

Regarding to the changes to the push message handling, I would like to know what problems you encountered and what devices you used. Here with the normal cams I can't see any double handling of the push messages.

@max246

max246 commented Dec 12, 2025

Copy link
Copy Markdown
Collaborator

I think you have good intention and direction to improve code tidy up and testing.
I might ask you to split the PR to have only camera changes and lets open a second PR that takes care to testing suite.

We might want to try to enforce eslint and prettier , I think @PhilippEngler had a branch with some stuff.

Might need to add github steps when a PR is made to ensure they pass and follow a more strict rules of deploment

@MELSAID888

Copy link
Copy Markdown
Author

@PhilippEngler @max246 Thank you - I made the changes for myself first but then thought why not try to contribute for the first time so am learning still . All feedback is welcome :).

I've reverted the package.json date-and-time package version - that was an oversight.
I did have duplicate notifications from S4 and floodlight camera with station - it was non-ciritcal - I need to re-pull the logs again - so I've reverted these changes for now to help get just the camera support published. I'll create another pull when I get the logs and re-do the changes with more detail.

I've also created another branch with the test suite additions here seperately - and removed them from this pull request:
#726 - they have been extremely helpful to pull info from the api and verify the changes for me. I am thinking it wouldn't be too difficult to actually add a feature - to pull details for any new device that only shows debug and pull all its parameters from the API in a user friendly way - to help users report it quicker - just a thought for later.

@PhilippEngler

Copy link
Copy Markdown
Collaborator

so am learning still . All feedback is welcome :).

You're welcome. The starting is not easy but it will gets more easier the more familiar you get...

I did have duplicate notifications from S4 and floodlight camera with station - it was non-ciritcal - I need to re-pull the logs again - so I've reverted these changes for now to help get just the camera support published. I'll create another pull when I get the logs and re-do the changes with more detail.

I would be very interested in that, because I have never seen that in my (very limited) device zoo.

I've also created another branch with the test suite additions here seperately - and removed them from this pull request:

I have seen this and I really appreciate such test suites. Please also have a look at #717, I think the demo part goes in a similar direction

@retepz

retepz commented Dec 23, 2025

Copy link
Copy Markdown

Is there anything besides the merge conflicts that is blocking this PR from being approved and merged?

@ipcam4g

ipcam4g commented Dec 23, 2025

Copy link
Copy Markdown

Hi @bropat and @MELSAID888,@PhilippEngler
@max246

I've been extensively testing the eufy-security-client library with the Eufy 4G LTE Cam S330 (T86P2) and wanted to share my findings about what works and what doesn't with this specific camera model.

What Doesn't Work
P2P Livestream
RTSP Stream
Cloud Stream

What Works
Authentication
Device Discovery
Device Properties
4G Signal Info
Station Info
Push Notifications

@max246

max246 commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator

Only T86P2 needs to be supported, the rest it is done. If you can update the PR pls

@max246 max246 mentioned this pull request Feb 27, 2026
@max246

max246 commented Feb 27, 2026

Copy link
Copy Markdown
Collaborator

Closing down since merged in #823

@max246 max246 closed this Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants