Skip to content

sk1234567891/ha_xiaomi_clock_sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xiaomi Clock Time Sync

This Home Assistant custom component allows you to synchronize the time on one or more Xiaomi LYWSD02 Bluetooth clocks directly from Home Assistant.

Features

  • Sync the time on multiple Xiaomi LYWSD02 clocks with a single service call.
  • Uses Bluetooth (via the bleak library) to communicate with devices.
  • Simple service for manual or automated time sync.

Installation

  1. Copy the files
    Place the xiaomi_clock_sync folder in your Home Assistant custom_components directory.

  2. Enable in configuration.yaml file add the following line to configuration.yaml:

    xiaomi_clock_sync:
  3. Restart Home Assistant
    After copying the files, restart Home Assistant to load the new component.

Note:
You do not need to install the bleak library manually. Home Assistant will automatically install all required dependencies as specified in manifest.json.

Configuration

add the following line to configuration.yaml:

xiaomi_clock_sync:

Usage

Service: xiaomi_clock_sync.sync_time

Sync the time on one or more Xiaomi LYWSD02 clocks.

Service Data

Field Type Required Description
macs list Yes List of MAC addresses of the clocks to sync

Example:

service: xiaomi_clock_sync.sync_time
data:
  macs:
    - "A4:C1:38:XX:XX:XX"
    - "3F:5B:7D:XX:XX:XX"

You can call this service from Developer Tools, automations, or scripts.

Troubleshooting

  • Ensure your Home Assistant host has a working Bluetooth adapter.
  • The clocks must be powered on and within Bluetooth range.

Credits

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages