Skip to content

feat(govee): add H5121 motion sensor contact support#54

Open
svc-finitelabs[bot] wants to merge 1 commit into
mainfrom
agent/drv-40-govee-h5121-motion
Open

feat(govee): add H5121 motion sensor contact support#54
svc-finitelabs[bot] wants to merge 1 commit into
mainfrom
agent/drv-40-govee-h5121-motion

Conversation

@svc-finitelabs
Copy link
Copy Markdown
Contributor

@svc-finitelabs svc-finitelabs Bot commented Apr 17, 2026

Summary

  • add Govee H5121 motion sensor support to the Govee BLE parser
  • use native Control4 AES-128-ECB for H512x payload decryption instead of any external runtime
  • expose H5121 motion as a CONTACT_SENSOR in the esphome_govee driver

Details

This implementation is intentionally close to the Home Assistant / govee-ble parser behavior because the device is not available locally for validation.

Implemented behavior:

  • detect and parse H5121 via the H512x encrypted advertisement path
  • validate encrypted packet CRC
  • decrypt the 16-byte payload using native C4:Decrypt("AES-128-ECB", ...) with the same reverse-key / reverse-data / reverse-output flow used by upstream govee-ble
  • interpret H5121 motion from the decrypted event byte
  • map motion to a dynamic CONTACT_SENSOR binding in Control4
  • send OPENED on motion, then auto-send CLOSED after 30 seconds
  • if another motion event arrives before timeout, restart the clear timer

Notes

  • no Python or external decrypt helper is used
  • this is still a best-effort testing PR intended to produce an artifact for real device validation
  • ticket: DRV-40

@svc-finitelabs svc-finitelabs Bot force-pushed the agent/drv-40-govee-h5121-motion branch from ac76b6c to 12a5751 Compare April 17, 2026 04:25
@svc-finitelabs svc-finitelabs Bot force-pushed the agent/drv-40-govee-h5121-motion branch from 12a5751 to 19946f5 Compare April 17, 2026 04:33
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.

0 participants