Ok, I’ve used another (working) ESP32 device and I’ve built up a new file using the ble_client and ble_sensor. However, when I set up the characteristic_uuid’s that the ble_client finds none of them appear to be the values I want. Reviewing the C source code from the custom sensor which works the values seem to be casted from char to float but I’m guessing that the ble_sensor doesn’t do this for us (I can’t find it in the docs anywhere).
Anyone know how to make this work?
Here’s my current config file:
substitutions:
node_name: radon
friendly_name: Radon
board: esp32doit-devkit-v1
log_level: DEBUG
library_priority: '1'
garage_priority: '0'
esphome:
name: ${node_name}
platform: ESP32
board: ${board}
build_path: ./build/${node_name}
captive_portal:
logger:
level: ${log_level}
api:
password: ${node_name}
ota:
password: ${node_name}
packages:
wifi: !include common/wifi.yaml
# device_base: !include common/device_base_esp32.yaml
esp32_ble_tracker:
ble_client:
- mac_address: FF:FF:FF:FF:FF:FF
id: radon2
on_connect:
then:
- lambda: |-
ESP_LOGD("ble_client_lambda", "Connected to radon2 BLE device");
on_disconnect:
then:
- lambda: |-
ESP_LOGD("ble_client_lambda", "Disconnected from radon2 BLE device");
sensor:
- platform: ble_client
ble_client_id: radon2
name: "Radon2_big24"
service_uuid: '00001523-1212-EFDE-1523-785FEABCD123'
characteristic_uuid: '00001524-1212-EFDE-1523-785FEABCD123'
- platform: ble_client
ble_client_id: radon2
name: "Radon2_big25"
service_uuid: '00001523-1212-EFDE-1523-785FEABCD123'
characteristic_uuid: '00001525-1212-EFDE-1523-785FEABCD123'
- platform: ble_client
ble_client_id: radon2
name: "Radon2_big26"
service_uuid: '00001523-1212-EFDE-1523-785FEABCD123'
characteristic_uuid: '00001526-1212-EFDE-1523-785FEABCD123'
- platform: ble_client
ble_client_id: radon2
name: "Radon2_1800_2a00"
service_uuid: '1800'
characteristic_uuid: '2a00'
- platform: ble_client
ble_client_id: radon2
name: "Radon2_1800_2a01"
service_uuid: '1800'
characteristic_uuid: '2a01'
- platform: ble_client
ble_client_id: radon2
name: "Radon2_1800_2a04"
service_uuid: '1800'
characteristic_uuid: '2a04'
- platform: ble_client
ble_client_id: radon2
name: "Radon2_180a_2a29"
service_uuid: '180a'
characteristic_uuid: '2a29'
Here is what the log file looks like when it connects and starts spewing results:
[10:52:12][W][ble_sensor:110]: [Radon2_1800_2a01] Cannot poll, not connected
[10:52:12][W][ble_sensor:110]: [Radon2_1800_2a04] Cannot poll, not connected
[10:52:16][W][ble_sensor:110]: [Radon2_1800_2a00] Cannot poll, not connected
[10:52:17][W][ble_sensor:039]: [Radon2_big24] Disconnected!
[10:52:17][D][sensor:099]: 'Radon2_big24': Sending state nan with 0 decimals of accuracy
[10:52:17][W][ble_sensor:039]: [Radon2_big25] Disconnected!
[10:52:17][D][sensor:099]: 'Radon2_big25': Sending state nan with 0 decimals of accuracy
[10:52:17][W][ble_sensor:039]: [Radon2_big26] Disconnected!
[10:52:17][D][sensor:099]: 'Radon2_big26': Sending state nan with 0 decimals of accuracy
[10:52:17][W][ble_sensor:039]: [Radon2_1800_2a00] Disconnected!
[10:52:17][D][sensor:099]: 'Radon2_1800_2a00': Sending state nan with 0 decimals of accuracy
[10:52:17][W][ble_sensor:039]: [Radon2_1800_2a01] Disconnected!
[10:52:17][D][sensor:099]: 'Radon2_1800_2a01': Sending state nan with 0 decimals of accuracy
[10:52:17][W][ble_sensor:039]: [Radon2_1800_2a04] Disconnected!
[10:52:17][D][sensor:099]: 'Radon2_1800_2a04': Sending state nan with 0 decimals of accuracy
[10:52:17][W][ble_sensor:039]: [Radon2_180a_2a29] Disconnected!
[10:52:17][D][sensor:099]: 'Radon2_180a_2a29': Sending state nan with 0 decimals of accuracy
[10:52:17][D][ble_client_lambda:053]: Disconnected from radon2 BLE device
[10:52:17][W][ble_client:115]: connect to ff:ff:ff:ff:ff:ff failed, status=133
[10:52:17][D][esp32_ble_tracker:180]: Starting scan...
[10:52:18][D][ble_client:045]: Found device at MAC address [FF:FF:FF:FF:FF:FF]
[10:52:18][I][ble_client:083]: Attempting BLE connection to ff:ff:ff:ff:ff:ff
[10:52:18][I][ble_sensor:033]: [Radon2_big24] Connected successfully!
[10:52:18][I][ble_sensor:033]: [Radon2_big25] Connected successfully!
[10:52:18][I][ble_sensor:033]: [Radon2_big26] Connected successfully!
[10:52:18][I][ble_sensor:033]: [Radon2_1800_2a00] Connected successfully!
[10:52:18][I][ble_sensor:033]: [Radon2_1800_2a01] Connected successfully!
[10:52:18][I][ble_sensor:033]: [Radon2_1800_2a04] Connected successfully!
[10:52:18][I][ble_sensor:033]: [Radon2_180a_2a29] Connected successfully!
[10:52:18][D][ble_client_lambda:049]: Connected to radon2 BLE device
[10:52:19][I][ble_client:159]: Service UUID: 0x1800
[10:52:19][I][ble_client:160]: start_handle: 0x1 end_handle: 0x7
[10:52:19][I][ble_client:339]: characteristic 0x2A00, handle 0x3, properties 0xa
[10:52:19][I][ble_client:339]: characteristic 0x2A01, handle 0x5, properties 0x2
[10:52:19][I][ble_client:339]: characteristic 0x2A04, handle 0x7, properties 0x2
[10:52:19][I][ble_client:159]: Service UUID: 0x1801
[10:52:19][I][ble_client:160]: start_handle: 0x8 end_handle: 0x8
[10:52:19][I][ble_client:159]: Service UUID: 000015231212EF-DE15-2378-5FEA-BCD123
[10:52:19][I][ble_client:160]: start_handle: 0x9 end_handle: 0x11
[10:52:19][I][ble_client:339]: characteristic 000015241212EF-DE15-2378-5FEA-BCD123, handle 0xb, properties 0xa
[10:52:19][I][ble_client:339]: characteristic 000015251212EF-DE15-2378-5FEA-BCD123, handle 0xd, properties 0x12
[10:52:19][I][ble_client:339]: characteristic 000015261212EF-DE15-2378-5FEA-BCD123, handle 0x10, properties 0x12
[10:52:19][I][ble_client:159]: Service UUID: 0x180A
[10:52:19][I][ble_client:160]: start_handle: 0x12 end_handle: 0xffff
[10:52:19][I][ble_client:339]: characteristic 0x2A29, handle 0x14, properties 0x2
[10:52:19][D][esp32_ble_tracker:180]: Starting scan...
[10:52:21][D][esp32_ble_tracker:620]: Found device E8:99:43:2E:84:99 RSSI=-87
[10:52:21][D][esp32_ble_tracker:641]: Address Type: RANDOM
[10:52:21][D][esp32_ble_tracker:643]: Name: 'N007U'
[10:52:21][D][esp32_ble_tracker:620]: Found device C0:9A:08:AC:93:5F RSSI=-69
[10:52:22][D][esp32_ble_tracker:641]: Address Type: RANDOM
[10:52:26][D][sensor:099]: 'Radon2_180a_2a29': Sending state 70.00000 with 0 decimals of accuracy
[10:52:27][D][sensor:099]: 'Radon2_big25': Sending state 80.00000 with 0 decimals of accuracy
[10:52:36][D][sensor:099]: 'Radon2_big24': Sending state 80.00000 with 0 decimals of accuracy
[10:52:36][D][sensor:099]: 'Radon2_big26': Sending state 0.00000 with 0 decimals of accuracy
[10:53:12][D][sensor:099]: 'Radon2_1800_2a01': Sending state 0.00000 with 0 decimals of accuracy
[10:53:12][D][sensor:099]: 'Radon2_1800_2a04': Sending state 6.00000 with 0 decimals of accuracy
[10:53:16][D][sensor:099]: 'Radon2_1800_2a00': Sending state 70.00000 with 0 decimals of accuracy
[10:53:26][D][sensor:099]: 'Radon2_180a_2a29': Sending state 70.00000 with 0 decimals of accuracy
[10:53:27][D][sensor:099]: 'Radon2_big25': Sending state 80.00000 with 0 decimals of accuracy
[10:53:36][D][sensor:099]: 'Radon2_big24': Sending state 80.00000 with 0 decimals of accuracy
[10:53:36][D][sensor:099]: 'Radon2_big26': Sending state 0.00000 with 0 decimals of accuracy
[10:54:12][D][sensor:099]: 'Radon2_1800_2a01': Sending state 0.00000 with 0 decimals of accuracy
[10:54:12][D][sensor:099]: 'Radon2_1800_2a04': Sending state 6.00000 with 0 decimals of accuracy
[10:54:16][D][sensor:099]: 'Radon2_1800_2a00': Sending state 70.00000 with 0 decimals of accuracy
[10:54:26][D][sensor:099]: 'Radon2_180a_2a29': Sending state 70.00000 with 0 decimals of accuracy
[10:54:27][D][sensor:099]: 'Radon2_big25': Sending state 80.00000 with 0 decimals of accuracy
[10:54:36][D][sensor:099]: 'Radon2_big24': Sending state 80.00000 with 0 decimals of accuracy
[10:54:36][D][sensor:099]: 'Radon2_big26': Sending state 0.00000 with 0 decimals of accuracy
[10:55:12][D][sensor:099]: 'Radon2_1800_2a01': Sending state 0.00000 with 0 decimals of accuracy
[10:55:12][D][sensor:099]: 'Radon2_1800_2a04': Sending state 6.00000 with 0 decimals of accuracy
[10:55:16][D][sensor:099]: 'Radon2_1800_2a00': Sending state 70.00000 with 0 decimals of accuracy
[10:55:26][D][sensor:099]: 'Radon2_180a_2a29': Sending state 70.00000 with 0 decimals of accuracy
[10:55:27][D][sensor:099]: 'Radon2_big25': Sending state 80.00000 with 0 decimals of accuracy
[10:55:36][D][sensor:099]: 'Radon2_big24': Sending state 80.00000 with 0 decimals of accuracy
[10:55:36][D][sensor:099]: 'Radon2_big26': Sending state 0.00000 with 0 decimals of accuracy
[10:56:12][D][sensor:099]: 'Radon2_1800_2a01': Sending state 0.00000 with 0 decimals of accuracy
[10:56:12][D][sensor:099]: 'Radon2_1800_2a04': Sending state 6.00000 with 0 decimals of accuracy
[10:56:17][D][sensor:099]: 'Radon2_1800_2a00': Sending state 70.00000 with 0 decimals of accuracy
[10:56:26][D][sensor:099]: 'Radon2_180a_2a29': Sending state 70.00000 with 0 decimals of accuracy
[10:56:27][D][sensor:099]: 'Radon2_big25': Sending state 80.00000 with 0 decimals of accuracy
[10:56:36][D][sensor:099]: 'Radon2_big24': Sending state 80.00000 with 0 decimals of accuracy
[10:56:36][D][sensor:099]: 'Radon2_big26': Sending state 0.00000 with 0 decimals of accuracy
[10:56:40][I][ota:046]: Boot seems successful, resetting boot loop counter.
[10:57:12][D][sensor:099]: 'Radon2_1800_2a01': Sending state 0.00000 with 0 decimals of accuracy
[10:57:12][D][sensor:099]: 'Radon2_1800_2a04': Sending state 172.00000 with 0 decimals of accuracy
[10:57:16][D][sensor:099]: 'Radon2_1800_2a00': Sending state 70.00000 with 0 decimals of accuracy
[10:57:26][D][sensor:099]: 'Radon2_180a_2a29': Sending state 70.00000 with 0 decimals of accuracy
[10:57:27][D][sensor:099]: 'Radon2_big25': Sending state 80.00000 with 0 decimals of accuracy
[10:57:36][D][sensor:099]: 'Radon2_big24': Sending state 80.00000 with 0 decimals of accuracy
[10:57:36][D][sensor:099]: 'Radon2_big26': Sending state 120.00000 with 0 decimals of accuracy
[10:58:12][D][sensor:099]: 'Radon2_1800_2a01': Sending state 0.00000 with 0 decimals of accuracy
[10:58:12][D][sensor:099]: 'Radon2_1800_2a04': Sending state 6.00000 with 0 decimals of accuracy
[10:58:17][D][sensor:099]: 'Radon2_1800_2a00': Sending state 70.00000 with 0 decimals of accuracy
[10:58:26][D][sensor:099]: 'Radon2_180a_2a29': Sending state 70.00000 with 0 decimals of accuracy
[10:58:27][D][sensor:099]: 'Radon2_big25': Sending state 80.00000 with 0 decimals of accuracy
[10:58:36][D][sensor:099]: 'Radon2_big24': Sending state 80.00000 with 0 decimals of accuracy
[10:58:36][D][sensor:099]: 'Radon2_big26': Sending state 0.00000 with 0 decimals of accuracy
The values that are dumped by the sensors don’t seem to contain enough information to represent the float values I’d expect. I’m thinking that either big26
or 1800_2a01
are the monthly value because that value is blank at the moment, the other two are in the 1.5-2.0 range. With values like 80, 120, 70, it seems I have too little info to build up an accurate float.