And then define a BLE client sensor that accesses the raw bytes of the Device Name characteristic, converts it to a string and publishes it to the template text sensor:
Hi Koen.
Thanks for you reply.
Great job.
It works !
Only two questions:
Why "${node_name} ...
I’ve noted that even if the BLE ESP32 is OFF ( and disconnected) in HA’s dashboard the service’s characteristic name is ever displayed. (I’d like that when the BLE ESP32 is OFF even the name is not displayed).
Any idea?
Thanks in advance.
Just an addition for your second question. You could update the text sensor on disconnection of the client. This would look like this (untested, and you should merge this with the code you already have):
Hi Koen.
Thanks again for your support.
It works but with a simple modification: on-disconnect option isn’t allowed in ble sensor, but in ble client.
In this manner works fine when the ESP32 device is disconnected:
Hi i am trying to use it but its not working to send the raw data
the logs show
[15:48:06][D][sensor:094]: ‘device_name’: Sending state 20.00000 with 0 decimals of accuracy
[15:48:06][D][text_sensor:064]: ‘Bedjet Bet Notify’: Sending state ‘G’