@fuatakgun Hello, many thanks for creating this integration as this is something I have been searching for for awhile. I am looking to use this to write temperature values to an electric radiator which has bluetooth, so I can control it with home assistant
I am becoming stuck on a couple of things because I am very unfamiliar with how Bluetooth works and I am not that great at coding but have been trying all day to figure this out and I think I am so close to getting this working and hopefully with a small bit of your help I can get this to finally work!
So FYI I have used an iOS app called LightBlue to interrogate the BLE device and I have managed to determine which characteristics specify the temperature of the device. I was then able to use this app to write to this characteristic to change its temperature!
At this moment I became very excited thinking I might be able to make this work using your integration! but I am struggling to decipher the correct information (UUID and Data values) for the integration you have made This is what I need help on.
Here’s what I know so far:
I have attached the screenshots from the Bluetooth sniffer app (LightBlue) you can see there are alot of what I think are called “characteristics” (in Screenshot 3) for this device and I know that if I write to the one called “0x1003” which the app tells me is UUID 1003 (in Screenshot 4) then it changes the temp on the radiator. From the screen shots you can see that the value for this characteristic is “0x0015” for 21 degrees Celsius and “0x0017” for 23. I know those values “0x0017” are Hex values and in the app I can display different formats for the characteristics and the format that displays the value in Celsius is called “2 byte Unsigned Int Little Endian”(in Screenshot 5) I am abit confused as to what to put in the “data” field in your integration and any help on this part would be appreciated.
I am unsure which UUID to use as there are multiple ones shown under this device on the LightBlue app screens, there’s one at the top of the device page starting “AFA1047A-…” , (in Screenshot 1). One further down above all the characteristics ending “…34FB” (in Screenshot 2). and one inside the characteristics page which is just “1003” (in Screenshot 4)- as you can tell I am very confused on this part as well, do you know which UUID I should be using for your integration to work
Update: I have obtained a full log below. However I think I know what might be wrong. It says towards the end of the log BleakError: Characteristic {char_specifier} was not found
The UUID I have used is 00000000-0000-1000-8000-00805F9B34FB and I think the characteristic value I need to use is “1003” from before. How do I input the characteristic value in the the YAML service call? is there a way to do this?
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 782, in handle_execute_script
script_result = await script_obj.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1578, in async_run
return await asyncio.shield(run.async_run())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 420, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 470, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 493, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2067, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2104, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 833, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 878, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/config/custom_components/generic_bt/binary_sensor.py", line 50, in write_gatt
await self._device.write_gatt(target_uuid, data)
File "/config/custom_components/generic_bt/generic_bt_api/device.py", line 54, in write_gatt
await self._client.write_gatt_char(uuid, data_as_bytes, True)
File "/usr/local/lib/python3.11/site-packages/bleak/__init__.py", line 769, in write_gatt_char
raise BleakError("Characteristic {char_specifier} was not found!")
bleak.exc.BleakError: Characteristic {char_specifier} was not found!