Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Deembot Atick #92

Open
baz88ka opened this issue Sep 24, 2024 · 0 comments
Open

Add support for Deembot Atick #92

baz88ka opened this issue Sep 24, 2024 · 0 comments

Comments

@baz88ka
Copy link

baz88ka commented Sep 24, 2024

Atick - ble impulse counter.

minimum code to get values:

import array
import asyncio
from bleak import BleakClient

address = "XX:XX:XX:XX:XX:XX"
UUID_SERVICE_AG = "348634B0-EFE4-11E4-B80C-0800200C9A66"
UUID_AG_ATTR_VALUES = "348634B8-EFE4-11E4-B80C-0800200C9A66"


def truncate_float(n, places):
        return int(n * (10 ** places)) / 10 ** places

async def main(address, UUID_AG_ATTR_VALUES):
    async with BleakClient(address) as client:
        characteristic_value = (client
            .services.get_service(UUID_SERVICE_AG)
            .get_characteristic(UUID_AG_ATTR_VALUES))

        data = await client.read_gatt_char(characteristic_value)
        values = array.array('f', data).tolist()
        counter_a_value = truncate_float(values[0], 2)
        counter_b_value = truncate_float(values[1], 2)
        print(f"counter a:", counter_a_value)
        print(f"counter b:",counter_b_value)


asyncio.run(main(address, UUID_AG_ATTR_VALUES))

there is also an extension for HA
https://github.com/XNicON/hassio-atick/tree/main/custom_components/deembot_atick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants