etekcity-esf551-ble


Nameetekcity-esf551-ble JSON
Version 0.1.6 PyPI version JSON
download
home_pageNone
SummaryAn unofficial Python package for interacting with Etekcity ESF-551 Smart Fitness Scales using BLE. Not affiliated with Etekcity, VeSync Co., Ltd., or any of their subsidiaries.
upload_time2024-08-25 22:50:54
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords ble bluetooth esf551 etekcity fitness scale health iot smart home smart scale weight
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Etekcity ESF-551 BLE

This package provides a basic unofficial interface for interacting with [Etekcity ESF-551 Smart Fitness Scale](https://etekcity.com/products/smart-fitness-scale-esf551) using Bluetooth Low Energy (BLE). It allows you to easily connect to the scale, receive weight and impedance measurements, and manage the display unit settings. It is a very basic library, providing access to just the most fundamental functionality of the scale.

It has only been tested on the ESF-551 model. I have no idea whether it might also work with some other bluetooth bathroom scale models from Etekcity. If you try it with a different model, please let me know whether it works or not.

**Disclaimer: This is an unofficial, community-developed library. It is not affiliated with, officially maintained by, or in any way officially connected with Etekcity, VeSync Co., Ltd. (the owner of the Etekcity brand), or any of their subsidiaries or affiliates. The official Etekcity website can be found at https://www.etekcity.com, and the official VeSync website at https://www.vesync.com. The names "Etekcity" and "VeSync" as well as related names, marks, emblems and images are registered trademarks of their respective owners.**

[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/ronnnnnnn)



## Installation

Install the package using pip:

```bash
pip install etekcity_esf551_ble
```


## Quick Start

Here's a basic example of how to use the library:

```python
import asyncio
from etekcity_esf551_ble import (
    IMPEDANCE_KEY,
    WEIGHT_KEY,
    EtekcitySmartFitnessScale,
    ScaleData,
    WeightUnit,
)

async def main():
    def notification_callback(data: ScaleData):
        print(f"Weight: {data.measurements[WEIGHT_KEY]} KG")
        print(f"Display Unit: {data.display_unit.name}")
        if IMPEDANCE_KEY in data.measurements:
            print(f"Impedance: {data.measurements[IMPEDANCE_KEY]} Ω")

    scale = EtekcitySmartFitnessScale("XX:XX:XX:XX:XX:XX", notification_callback)
    scale.display_unit = WeightUnit.KG  # Set display unit to kilograms

    await scale.async_start()
    await asyncio.sleep(30)  # Wait for measurements
    await scale.async_stop()

asyncio.run(main())
```


## API Reference

### `EtekcitySmartFitnessScale`

The main class for interacting with the scale.

#### Methods:

- `__init__(self, address: str, notification_callback: Callable[[ScaleData], None], display_unit: WeightUnit = None)`
- `async_start()`: Start scanning for and connecting to the scale.
- `async_stop()`: Stop the connection to the scale.

#### Properties:

- `display_unit`: Get or set the display unit (WeightUnit.KG, WeightUnit.LB or WeightUnit.ST). Returns None if the display unit is currently unknown (not set by the user and not yet received from the scale together with a stable weight measurement).
- `hw_version`: Get the hardware version of the scale (read-only).
- `sw_version`: Get the software version of the scale (read-only).

### `WeightUnit`

An enum representing the possible display units:

- `WeightUnit.KG`: Kilograms
- `WeightUnit.LB`: Pounds
- `WeightUnit.ST`: Stones

### `ScaleData`

A dataclass containing scale measurement data:

- `name`: Scale name
- `address`: Scale Bluetooth address
- `hw_version`: Hardware version
- `sw_version`: Software version
- `display_unit`: Current display unit (concerns only the weight as displayed on the scale, the measurement itself is always provided by the API in kilograms)
- `measurements`: Dictionary of measurements (currently supports: weight in kilograms and impedance in ohms)


## Compatibility

- Tested on Mac (Apple Silicon) and Raspberry Pi 4
- Compatibility with Windows is unknown


## Troubleshooting

On Raspberry Pi 4 (and possibly other Linux machines using BlueZ), if you encounter a `org.bluez.Error.InProgress` error, try the following in `bluetoothctl`:

```
power off
power on
scan on
```
(See https://github.com/home-assistant/core/issues/76186#issuecomment-1204954485)


## Support the Project

If you find this unofficial project helpful, consider buying me a coffee! Your support helps maintain and improve this library.

[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/ronnnnnnn)


## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.


## Disclaimer

This is an independent project developed by the community. It is not endorsed by, directly affiliated with, maintained, authorized, or sponsored by Etekcity, VeSync Co., Ltd., or any of their affiliates or subsidiaries. All product and company names are the registered trademarks of their original owners. The use of any trade name or trademark is for identification and reference purposes only and does not imply any association with the trademark holder of their product brand.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "etekcity-esf551-ble",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "ble, bluetooth, esf551, etekcity, fitness scale, health, iot, smart home, smart scale, weight",
    "author": null,
    "author_email": "Ron <ronnnnnnn@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d8/86/b489a184e9fbe63dc2d596e11f2f32eb4faf4ef96c95613e94f2a82fe01f/etekcity_esf551_ble-0.1.6.tar.gz",
    "platform": null,
    "description": "# Etekcity ESF-551 BLE\n\nThis package provides a basic unofficial interface for interacting with [Etekcity ESF-551 Smart Fitness Scale](https://etekcity.com/products/smart-fitness-scale-esf551) using Bluetooth Low Energy (BLE). It allows you to easily connect to the scale, receive weight and impedance measurements, and manage the display unit settings. It is a very basic library, providing access to just the most fundamental functionality of the scale.\n\nIt has only been tested on the ESF-551 model. I have no idea whether it might also work with some other bluetooth bathroom scale models from Etekcity. If you try it with a different model, please let me know whether it works or not.\n\n**Disclaimer: This is an unofficial, community-developed library. It is not affiliated with, officially maintained by, or in any way officially connected with Etekcity, VeSync Co., Ltd. (the owner of the Etekcity brand), or any of their subsidiaries or affiliates. The official Etekcity website can be found at https://www.etekcity.com, and the official VeSync website at https://www.vesync.com. The names \"Etekcity\" and \"VeSync\" as well as related names, marks, emblems and images are registered trademarks of their respective owners.**\n\n[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/ronnnnnnn)\n\n\n\n## Installation\n\nInstall the package using pip:\n\n```bash\npip install etekcity_esf551_ble\n```\n\n\n## Quick Start\n\nHere's a basic example of how to use the library:\n\n```python\nimport asyncio\nfrom etekcity_esf551_ble import (\n    IMPEDANCE_KEY,\n    WEIGHT_KEY,\n    EtekcitySmartFitnessScale,\n    ScaleData,\n    WeightUnit,\n)\n\nasync def main():\n    def notification_callback(data: ScaleData):\n        print(f\"Weight: {data.measurements[WEIGHT_KEY]} KG\")\n        print(f\"Display Unit: {data.display_unit.name}\")\n        if IMPEDANCE_KEY in data.measurements:\n            print(f\"Impedance: {data.measurements[IMPEDANCE_KEY]} \u03a9\")\n\n    scale = EtekcitySmartFitnessScale(\"XX:XX:XX:XX:XX:XX\", notification_callback)\n    scale.display_unit = WeightUnit.KG  # Set display unit to kilograms\n\n    await scale.async_start()\n    await asyncio.sleep(30)  # Wait for measurements\n    await scale.async_stop()\n\nasyncio.run(main())\n```\n\n\n## API Reference\n\n### `EtekcitySmartFitnessScale`\n\nThe main class for interacting with the scale.\n\n#### Methods:\n\n- `__init__(self, address: str, notification_callback: Callable[[ScaleData], None], display_unit: WeightUnit = None)`\n- `async_start()`: Start scanning for and connecting to the scale.\n- `async_stop()`: Stop the connection to the scale.\n\n#### Properties:\n\n- `display_unit`: Get or set the display unit (WeightUnit.KG, WeightUnit.LB or WeightUnit.ST). Returns None if the display unit is currently unknown (not set by the user and not yet received from the scale together with a stable weight measurement).\n- `hw_version`: Get the hardware version of the scale (read-only).\n- `sw_version`: Get the software version of the scale (read-only).\n\n### `WeightUnit`\n\nAn enum representing the possible display units:\n\n- `WeightUnit.KG`: Kilograms\n- `WeightUnit.LB`: Pounds\n- `WeightUnit.ST`: Stones\n\n### `ScaleData`\n\nA dataclass containing scale measurement data:\n\n- `name`: Scale name\n- `address`: Scale Bluetooth address\n- `hw_version`: Hardware version\n- `sw_version`: Software version\n- `display_unit`: Current display unit (concerns only the weight as displayed on the scale, the measurement itself is always provided by the API in kilograms)\n- `measurements`: Dictionary of measurements (currently supports: weight in kilograms and impedance in ohms)\n\n\n## Compatibility\n\n- Tested on Mac (Apple Silicon) and Raspberry Pi 4\n- Compatibility with Windows is unknown\n\n\n## Troubleshooting\n\nOn Raspberry Pi 4 (and possibly other Linux machines using BlueZ), if you encounter a `org.bluez.Error.InProgress` error, try the following in `bluetoothctl`:\n\n```\npower off\npower on\nscan on\n```\n(See https://github.com/home-assistant/core/issues/76186#issuecomment-1204954485)\n\n\n## Support the Project\n\nIf you find this unofficial project helpful, consider buying me a coffee! Your support helps maintain and improve this library.\n\n[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/ronnnnnnn)\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n\n## Disclaimer\n\nThis is an independent project developed by the community. It is not endorsed by, directly affiliated with, maintained, authorized, or sponsored by Etekcity, VeSync Co., Ltd., or any of their affiliates or subsidiaries. All product and company names are the registered trademarks of their original owners. The use of any trade name or trademark is for identification and reference purposes only and does not imply any association with the trademark holder of their product brand.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "An unofficial Python package for interacting with Etekcity ESF-551 Smart Fitness Scales using BLE. Not affiliated with Etekcity, VeSync Co., Ltd., or any of their subsidiaries.",
    "version": "0.1.6",
    "project_urls": {
        "Bug Tracker": "https://github.com/ronnnnnnnnnnnnn/etekcity_esf551_ble/issues",
        "Documentation": "https://github.com/ronnnnnnnnnnnnn/etekcity_esf551_ble#readme",
        "Homepage": "https://github.com/ronnnnnnnnnnnnn/etekcity_esf551_ble",
        "Source Code": "https://github.com/ronnnnnnnnnnnnn/etekcity_esf551_ble"
    },
    "split_keywords": [
        "ble",
        " bluetooth",
        " esf551",
        " etekcity",
        " fitness scale",
        " health",
        " iot",
        " smart home",
        " smart scale",
        " weight"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7861165a8de0e16ff2f416e03b78e4c71184f5e3a040daa7ac10b839cbf6a203",
                "md5": "8c2a0392679d50d1494086773f85529e",
                "sha256": "63446b4dfb8aa7449d86676b76e8b69f5e68674032c37206851ec6d50cee977c"
            },
            "downloads": -1,
            "filename": "etekcity_esf551_ble-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8c2a0392679d50d1494086773f85529e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 8795,
            "upload_time": "2024-08-25T22:50:52",
            "upload_time_iso_8601": "2024-08-25T22:50:52.732471Z",
            "url": "https://files.pythonhosted.org/packages/78/61/165a8de0e16ff2f416e03b78e4c71184f5e3a040daa7ac10b839cbf6a203/etekcity_esf551_ble-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d886b489a184e9fbe63dc2d596e11f2f32eb4faf4ef96c95613e94f2a82fe01f",
                "md5": "584e0a9e14e599acc66e3bd91744dc78",
                "sha256": "6a8eebf5d157d8c9f6508ee565eb61d4d68ed1efbcd25457f7ca15d7b305c280"
            },
            "downloads": -1,
            "filename": "etekcity_esf551_ble-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "584e0a9e14e599acc66e3bd91744dc78",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 8459,
            "upload_time": "2024-08-25T22:50:54",
            "upload_time_iso_8601": "2024-08-25T22:50:54.325715Z",
            "url": "https://files.pythonhosted.org/packages/d8/86/b489a184e9fbe63dc2d596e11f2f32eb4faf4ef96c95613e94f2a82fe01f/etekcity_esf551_ble-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-25 22:50:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ronnnnnnnnnnnnn",
    "github_project": "etekcity_esf551_ble",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "etekcity-esf551-ble"
}
        
Elapsed time: 1.01978s