Skip to content

mmomasters/the_keys

 
 

Repository files navigation

The Keys Integration

GitHub Release GitHub Activity License

hacs Project Maintenance BuyMeCoffee

Community Forum

Integration to integrate with KevinBonnoron/the_keys.

This integration will set up the following platforms.

Platform Description
lock Allow to change and see the lock status.
sensor Show accurate battery percentage (calibrated from real data).
button Buttons for calibrate and sync operations (visible in Controls dashboard).

Buttons:

  • Calibrate - Calibrate the lock mechanism
  • Sync - Sync lock state with the cloud

Custom Services:

Service Description
the_keys.calibrate Calibrate the lock mechanism (for automations/scripts)
the_keys.sync Sync lock state with the cloud (for automations/scripts)

Note: Both button entities (for manual use in UI) and services (for automations) are available for calibrate and sync operations.

Installation

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called the_keys.
  4. Download all the files from the custom_components/the_keys/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "The Keys"

Configuration is done in the UI

Configuration Options

  • Username: Your phone number in international format (e.g., +33...)
  • Password: Your The Keys account password
  • Gateway IP (optional): Manual gateway IP/hostname if auto-discovery fails
  • Scan Interval: How often to poll for updates (minimum 10 seconds, default 60 seconds)

Recent Improvements

v1.2.0 (2026-01-30)

  • Battery Accuracy Fix: Battery percentages now accurately reflect real values (±1% accuracy)
    • Previous version overestimated by 5-9%
    • Uses linear regression calibrated from real device data
  • Gateway Rate Limiting: Prevents timeouts and gateway overload
    • Heavy operations (open/close/calibrate/status): 8 second delay
    • Light operations (status/list/sync): 2 second delay
    • Per-gateway instance rate limiting

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines


About

TheKeys integration for Home Assistant

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 97.9%
  • Shell 2.1%