Hydrao Shower Head custom integration

Hello, I wanted to share a new custom integration I have created for the Hydrao shower head.

It is pretty simple, it reports basic info from the shower.

It is really experimental, so use it at your own risk.

Repository is here adizanni/hydrao (github.com)

Enjoy

1 Like

You can find more infor about Hydrao here, and this is the product I have tested and working

Hello,

For those of you who have not the home assistant bluetooth scanner close to the shower head, you can configure your Shower Head using BLE Client sensors, this way:

ESPHome

ble_client:
  - mac_address: <MAC Address of the device>
    id: hydrao_aloe_1

and the sensors (you can adjust the id, name and update_interval to your need and capacity of the ESP device):

Total Volume:

  - platform: ble_client
    type: characteristic
    ble_client_id: hydrao_aloe_1
    name: "Shower Total Volume"
    service_uuid: '180f'
    characteristic_uuid: 'ca1c'
    unit_of_measurement: 'L'
    device_class: 'water'
    update_interval: 2000ms
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[1] << 8) | x[0];
        return static_cast<float>(value);
      }
      return NAN;

Current Volume:

  - platform: ble_client
    type: characteristic
    ble_client_id: hydrao_aloe_1
    name: "Shower Current Volume"
    service_uuid: '180f'
    characteristic_uuid: 'ca1c'
    unit_of_measurement: 'L'
    device_class: 'water'
    update_interval: 2000ms
    lambda: |-
      if (x.size() >= 4) {
        uint16_t value = (x[3] << 8) | x[2];
        return static_cast<float>(value);
      }
      return NAN;

Average Temperature of the running shower:

  - platform: ble_client
    type: characteristic
    ble_client_id: hydrao_aloe_1
    name: "Shower Average Temperature"
    service_uuid: '180f'
    characteristic_uuid: 'ca32'
    unit_of_measurement: '°C'
    device_class: 'temperature'
    update_interval: 2000ms
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[3] << 8) | x[2];
        return static_cast<float>(value)/2;
      }
      return NAN;

Current Temperature of the running shower:

  - platform: ble_client
    type: characteristic
    ble_client_id: hydrao_aloe_1
    name: "Shower Current Temperature"
    service_uuid: '180f'
    characteristic_uuid: 'ca32'
    unit_of_measurement: '°C'
    device_class: 'temperature'
    update_interval: 2000ms
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[1] << 8) | x[0];
        return static_cast<float>(value)/2;
      }
      return NAN;

Duration of the running shower:

  - platform: ble_client
    type: characteristic
    ble_client_id: hydrao_aloe_1
    name: "Shower Current Duration"
    service_uuid: '180f'
    characteristic_uuid: 'ca26'
    unit_of_measurement: 's'
    device_class: 'duration'
    update_interval: 2000ms
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[1] << 8) | x[0];
        return static_cast<float>(value)/50;
      }
      return NAN;
2 Likes

Hello,

I feel like i’m on a dead end with my hydrao shower with esphome…
I cannot succeed to complete a BT connection with the shower head :sleepy:

My esphome yaml configuration is the following (if someone want to test : adapt the board, hydrao_mac, HA_api_key in substitutions chapter and ethernet according to your ESP board):

substitutions:
  name: hydrao-gateway
  board: esp32-poe-iso
  friendly_name: Hydrao gateway
  hydrao_mac: 11:F1:DD:XX:XX:XX
  HA_api_key: XXX

esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}

esp32:
  board: ${board}
  framework:
    type: esp-idf

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0
  power_pin: GPIO12

# Enable Home Assistant API
api:
  encryption:
    key: ${HA_api_key}

# Enable logging
logger:
  
ota:

globals:
  - id: ble_client_connected
    type: bool
    initial_value: 'false'

esp32_ble_tracker:

ble_client:
  - mac_address: ${hydrao_mac}
    id: hydrao
    auto_connect: true
    on_connect:
      then:
        - lambda: |-
            id(ble_client_connected) = true;
            ESP_LOGD("ble_client_lambda", "Connected to HYDRAO BLE device");
    on_disconnect:
      then:
        - lambda: |-
            id(ble_client_connected) = false;
            ESP_LOGD("ble_client_lambda", "Disconnected from HYDRAO BLE device");

button:
  - platform: safe_mode
    name: "Safe Mode Boot"
    entity_category: diagnostic

binary_sensor:
  - platform: template
    name: 'Shower Head Connection'
    id: shower_head_connection
    entity_category: diagnostic
    lambda: 'return id(ble_client_connected);'

sensor:
  - platform: ble_client
    type: rssi
    ble_client_id: hydrao
    name: "Shower Head RSSI"
    entity_category: diagnostic
    update_interval: 2000ms

  - platform: ble_client
    ble_client_id: hydrao
    service_uuid: '180f'
    characteristic_uuid: 'ca1c'
    update_interval: 2000ms
    type: characteristic
    id: "current_volume"
    name: "Current Volume"
    unit_of_measurement: 'L'
    icon: 'mdi:shower-head'
    device_class: "water"
    state_class: "measurement"
    force_update: true
    lambda: |-
      if (x.size() >= 4) {
        uint16_t value = (x[3] << 8) | x[2];
        return static_cast<float>(value);
      }
      return NAN;

  - platform: ble_client
    ble_client_id: hydrao
    service_uuid: '180f'
    characteristic_uuid: 'ca1c'
    update_interval: 2000ms
    type: characteristic
    id: "total_volume"
    name: "Shower Total Volume"
    unit_of_measurement: 'L'
    icon: 'mdi:shower-head'
    device_class: "water"
    state_class: "total_increasing"
    force_update: true
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[1] << 8) | x[0];
        return static_cast<float>(value);
      }
      return NAN;

  - platform: ble_client
    ble_client_id: hydrao
    service_uuid: '180f'
    characteristic_uuid: 'ca32'
    update_interval: 2000ms
    type: characteristic
    id: "current_temperature"
    name: "Shower Current Temperature"
    unit_of_measurement: '°C'
    icon: 'mdi:thermometer-water'
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[1] << 8) | x[0];
        return static_cast<float>(value)/2;
      }
      return NAN;

  - platform: ble_client
    ble_client_id: hydrao
    service_uuid: '180f'
    characteristic_uuid: 'ca32'
    update_interval: 2000ms
    type: characteristic
    id: "average_temperature"
    name: "Shower Average Temperature"
    unit_of_measurement: '°C'
    icon: 'mdi:thermometer-water'
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[3] << 8) | x[2];
        return static_cast<float>(value)/2;
      }
      return NAN;

  - platform: ble_client
    ble_client_id: hydrao
    service_uuid: '180f'
    characteristic_uuid: 'ca26'
    update_interval: 2000ms
    type: characteristic
    id: "current_duration"
    name: "Shower Current Duration"
    unit_of_measurement: 's'
    icon: 'mdi:timer-outline'
    device_class: 'duration'
    state_class: "measurement"
    accuracy_decimals: 1
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[1] << 8) | x[0];
        return static_cast<float>(value)/50;
      }
      return NAN;

But all the logs I get are :

[...]
[15:29:33][D][esp32_ble_client:110]: [0] [11:F1:DD:XX:XX:XX] Found device
[15:29:33][D][esp32_ble_tracker:661]: Found device 11:F1:DD:XX:XX:XX RSSI=-63
[15:29:33][D][esp32_ble_tracker:682]:   Address Type: PUBLIC
[15:29:33][D][esp32_ble_tracker:684]:   Name: 'HYDRAO_SHOWER'
[15:29:33][D][esp32_ble_tracker:687]:   TX Power: 2
[15:29:33][D][esp32_ble_tracker:215]: Pausing scan to make connection...
[15:29:34][V][esp32_ble:314]: (BLE) gap_event_handler - 18
[15:29:34][I][esp32_ble_client:067]: [0] [11:F1:DD:XX:XX:XX] 0x00 Attempting BLE connection
[15:29:34][W][ble_sensor:123]: [Shower Average Temperature] Cannot poll, not connected
[15:29:34][W][ble_sensor:123]: [Shower Current Duration] Cannot poll, not connected
[15:29:34][W][ble_sensor:123]: [Shower Current Temperature] Cannot poll, not connected
[15:29:35][W][ble_rssi_sensor:061]: [Shower Head RSSI] Cannot poll, not connected
[15:29:35][W][ble_sensor:123]: [Current Volume] Cannot poll, not connected
[15:29:35][W][ble_sensor:123]: [Shower Total Volume] Cannot poll, not connected
[…]
[15:29:55][W][ble_sensor:123]: [Shower Total Volume] Cannot poll, not connected
[15:29:56][W][ble_sensor:123]: [Shower Average Temperature] Cannot poll, not connected
[15:29:56][W][ble_sensor:123]: [Shower Current Duration] Cannot poll, not connected
[15:29:56][W][ble_sensor:123]: [Shower Current Temperature] Cannot poll, not connected
[15:29:57][W][ble_rssi_sensor:061]: [Shower Head RSSI] Cannot poll, not connected
[15:29:57][W][ble_sensor:123]: [Current Volume] Cannot poll, not connected
[15:29:57][V][esp-idf:000]: W (70395) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x8

[15:29:57][V][esp-idf:000]: W (70399) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x8

[15:29:57][V][esp32_ble:342]: (BLE) gattc_event [esp_gatt_if: 3] - 41
[15:29:57][V][esp32_ble_client:121]: [0] [11:F1:DD:XX:XX:XX] gattc_event_handler: event=41 gattc_if=3
[15:29:57][D][esp32_ble_client:172]: [0] [11:F1:DD:XX:XX:XX] ESP_GATTC_DISCONNECT_EVT, reason 8
[15:29:57][V][esp32_ble:342]: (BLE) gattc_event [esp_gatt_if: 3] - 2
[15:29:57][V][esp32_ble_client:121]: [0] [11:F1:DD:XX:XX:XX] gattc_event_handler: event=2 gattc_if=3
[15:29:57][D][esp32_ble_client:110]: [0] [11:F1:DD:XX:XX:XX] ESP_GATTC_OPEN_EVT
[15:29:57][W][esp32_ble_client:143]: [0] [11:F1:DD:XX:XX:XX] Connection failed, status=133
[15:29:57][D][esp32_ble_tracker:266]: Starting scan...
[...]

From what I understand

[...]
[15:29:57][D][esp32_ble_client:172]: [0] [11:F1:DD:XX:XX:XX] ESP_GATTC_DISCONNECT_EVT, reason 8
[...]
[15:29:57][W][esp32_ble_client:143]: [0] [11:F1:DD:XX:XX:XX] Connection failed, status=133
[...]

mean a connection error (133 = ESP_GATT_ERROR) cause of timeout (8 = ESP_GATT_CONN_TIMEOUT)

The only thing left that i can think of is a different shower head firmware (mine is 20181118) but i succeed to get a connection and datas with kamaradclimber receiver.py script on a laptop…

Does someone have any clue?

The only difference that I see between my configuration and yours is the active connection in ble tracker:

esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
    active: true

There are other differences in the config but I think they are related to the diagnostic you have added to troublshoot. Otherwise I confirm that the bare config that I have shared above works for me.

Other info:
The version of my Hydrao hardware (taken in the APP) is 9
The version of the firmware is 90040400
The model type is Aloe

1 Like

Referred to my previous comment, probably the parameter is active by default as I see in your log, there is an attempt to connect.

If you have a raspberry with bt try to use the gattc tool to see if you manage to connect and if the chracteristic are the same as for my firmware.

If not, it is possible they have put some connection security in more recent firmware even though I think my shower head should not be that old (i bought it 2 months ago). Of course I have not updated the firmware, kept the factory one.

1 Like

I also have Hydrao Aloe (much older than yours) and the app give me this

I tried gattc tool with a raspberry and everything seem to work fine…

caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --primary
attr handle = 0x0001, end grp handle = 0x0004 uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle = 0x0005, end grp handle = 0x000b uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle = 0x000c, end grp handle = 0x0032 uuid: 0000180f-0000-1000-8000-00805f9b34fb
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD::XX:XX:XX --characteristics
handle = 0x0002, char properties = 0x20, char value handle = 0x0003, uuid = 00002a05-0000-1000-8000-00805f9b34fb
handle = 0x0006, char properties = 0x4e, char value handle = 0x0007, uuid = 00002a00-0000-1000-8000-00805f9b34fb
handle = 0x0008, char properties = 0x4e, char value handle = 0x0009, uuid = 00002a01-0000-1000-8000-00805f9b34fb
handle = 0x000a, char properties = 0x0a, char value handle = 0x000b, uuid = 00002a04-0000-1000-8000-00805f9b34fb
handle = 0x000d, char properties = 0x02, char value handle = 0x000e, uuid = 00002a26-0000-1000-8000-00805f9b34fb
handle = 0x000f, char properties = 0x02, char value handle = 0x0010, uuid = 0000ca28-0000-1000-8000-00805f9b34fb
handle = 0x0011, char properties = 0x02, char value handle = 0x0012, uuid = 0000ca1c-0000-1000-8000-00805f9b34fb
handle = 0x0013, char properties = 0x02, char value handle = 0x0014, uuid = 0000ca26-0000-1000-8000-00805f9b34fb
handle = 0x0015, char properties = 0x0a, char value handle = 0x0016, uuid = 0000ca30-0000-1000-8000-00805f9b34fb
handle = 0x0017, char properties = 0x0a, char value handle = 0x0018, uuid = 0000ca33-0000-1000-8000-00805f9b34fb
handle = 0x0019, char properties = 0x02, char value handle = 0x001a, uuid = 0000ca32-0000-1000-8000-00805f9b34fb
handle = 0x001b, char properties = 0x02, char value handle = 0x001c, uuid = 0000ca31-0000-1000-8000-00805f9b34fb
handle = 0x001d, char properties = 0x02, char value handle = 0x001e, uuid = 0000ca27-0000-1000-8000-00805f9b34fb
handle = 0x001f, char properties = 0x0a, char value handle = 0x0020, uuid = 0000ca1d-0000-1000-8000-00805f9b34fb
handle = 0x0021, char properties = 0x0a, char value handle = 0x0022, uuid = 0000ca25-0000-1000-8000-00805f9b34fb
handle = 0x0023, char properties = 0x0a, char value handle = 0x0024, uuid = 0000ca29-0000-1000-8000-00805f9b34fb
handle = 0x0025, char properties = 0x0a, char value handle = 0x0026, uuid = 0000ca1e-0000-1000-8000-00805f9b34fb
handle = 0x0027, char properties = 0x0a, char value handle = 0x0028, uuid = 0000ca1f-0000-1000-8000-00805f9b34fb
handle = 0x0029, char properties = 0x0a, char value handle = 0x002a, uuid = 0000ca20-0000-1000-8000-00805f9b34fb
handle = 0x002b, char properties = 0x02, char value handle = 0x002c, uuid = 0000ca21-0000-1000-8000-00805f9b34fb
handle = 0x002d, char properties = 0x0a, char value handle = 0x002e, uuid = 0000ca22-0000-1000-8000-00805f9b34fb
handle = 0x002f, char properties = 0x0a, char value handle = 0x0030, uuid = 0000ca23-0000-1000-8000-00805f9b34fb
handle = 0x0031, char properties = 0x02, char value handle = 0x0032, uuid = 0000ca24-0000-1000-8000-00805f9b34fb
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0002
Characteristic value/descriptor: 20 03 00 05 2a
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0006
Characteristic value/descriptor: 4e 07 00 00 2a
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0008
Characteristic value/descriptor: 4e 09 00 01 2a
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x000a
connect to 11:F1:DD:XX:XX:XX: Function not implemented (38)
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x000d
Characteristic value/descriptor: 02 0e 00 26 2a
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x000f
connect to 11:F1:DD:XX:XX:XX: Function not implemented (38)
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0011
Characteristic value/descriptor: 02 12 00 1c ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0013
connect to 11:F1:DD:XX:XX:XX: Function not implemented (38)
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0015
Characteristic value/descriptor: 0a 16 00 30 ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0017
Characteristic value/descriptor: 0a 18 00 33 ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0019
Characteristic value/descriptor: 02 1a 00 32 ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x001b
Characteristic value/descriptor: 02 1c 00 31 ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x001d
Characteristic value/descriptor: 02 1e 00 27 ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x001f
Characteristic value/descriptor: 0a 20 00 1d ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0021
Characteristic value/descriptor: 0a 22 00 25 ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0023
Characteristic value/descriptor: 0a 24 00 29 ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0025
Characteristic value/descriptor: 0a 26 00 1e ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0027
Characteristic value/descriptor: 0a 28 00 1f ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x0029
Characteristic value/descriptor: 0a 2a 00 20 ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x002b
Characteristic value/descriptor: 02 2c 00 21 ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x002d
Characteristic value/descriptor: 0a 2e 00 22 ca
caubios@raspberrypi:~ $ sudo gatttool -i hci0 -b 11:F1:DD:XX:XX:XX --char-read -a 0x002f
Characteristic value/descriptor: 0a 30 00 23 ca 

As I can get BLE connection with

  • my ubuntu laptop using bluepy (with kamaradclimber receiver.py script)
  • a raspberry using gatttool

I would tend to an issue with my Olimex esp32-poe-iso board. @adizanni : Which board model do you use? I might buy one for the sake of testing.

When did you start your test ?
I noticed that the shower did not send data this morning, now I am at the office.
I will verify this evening. It is possible that the recent ESP Home upgrade broke something.

I’ve start like 2 days ago!

If you installed the latest version of ESPHome, wait this evening before doing anything. I may have the same problem, last time it worked was the 5th of April and after I’ve upgraded to the latest version of ESPHome…

Already tried to revert to ESPHome 2024.2.2 (on fresh new container) and the issue remain the same.
In the meantime I ordered an ESP32-S3-WROOM board in order to test with an other hardware :slight_smile:

Ok I found out the problem, I accidentally restarted a service in a raspi that was doing the connection to the shower head, preventing the esp32 to connect. I stopped raspi and now esp32 is connecting properly and sending data from the shower. So problem may be in your esp hw, as you were able to connect with other hw.

This my esp model

New test with this model and same results : Cannot succeed to get a proper connection.

I’m going nuts :woozy_face:!

Do you mind sharing your full yaml conf and a full log (even in DM) for me to compare what could be wrong?

Increased the log level for everthing BLE related in my yaml conf

esp32:
  ...
  framework:
    type: esp-idf
    version: recommended
    sdk-config-options:
      CONFIG_BT_LOG_APPL_TRACE_LEVEL_VERBOSE: "y"
      CONFIG_BT_LOG_APPL_INITIAL_TRACE_LEVEL: "6"
      CONFIG_BT_LOG_GATT_TRACE_LEVEL_VERBOSE: "y"
      CONFIG_BT_LOG_GATT_INITIAL_TRACE_LEVEL: "6"

If any BLE / GATT expert stop by this post : could you please check if something is going wrong here ?

[16:28:45][D][esp32_ble_client:110]: [0] [11:F1:DD:XX:XX:XX] Found device
[16:28:45][D][esp32_ble_tracker:661]: Found device 11:F1:DD:XX:XX:XX RSSI=-36
[16:28:45][D][esp32_ble_tracker:682]:   Address Type: PUBLIC
[16:28:45][D][esp32_ble_tracker:684]:   Name: 'HYDRAO_SHOWER'
[16:28:45][D][esp32_ble_tracker:687]:   TX Power: 2
[16:28:45][D][esp32_ble_tracker:215]: Pausing scan to make connection...
[16:28:45][VV][esp-idf:000]: I (25601) BT_APPL: BTA_DmBleScan:start = 0 
[16:28:45][VV][esp-idf:000]: D (25604) BT_APPL: BTA got event 0x121
[16:28:45][VV][esp-idf:000]: D (25606) BT_APPL: bta_dm_sm_execute event:0x21
[16:28:45][VV][esp-idf:000]: D (25610) BT_APPL: bta_dm_observe_cmpl_cb
[16:28:45][V][esp32_ble:314]: (BLE) gap_event_handler - 3
[16:28:45][V][esp32_ble:314]: (BLE) gap_event_handler - 18
[16:28:45][I][esp32_ble_client:067]: [0] [11:F1:DD:XX:XX:XX] 0x00 Attempting BLE connection
[16:28:45][VV][esp-idf:000]: D (25629) BT_APPL: BTA got event 0x1f00
[16:28:45][VV][esp-idf:000]: I (25633) BT_GATT: GATT_Connect gatt_if=3
[16:28:45][VV][esp-idf:000]: D (25636) BT_GATT: gatt_sr_init_cl_status feat 0 aware 1
[16:28:45][VV][esp-idf:000]: D (25639) BT_GATT: gatt_get_ch_state: ch_state=0
[16:28:45][VV][esp-idf:000]: D (25642) BT_GATT: gatt_set_ch_state: old=0 new=2
[16:28:45][VV][esp-idf:000]: D (25648) BT_GATT: gatt_update_app_use_link_flag  is_add=1 chk_link=0
[16:28:45][VV][esp-idf:000]: D (25651) BT_GATT: gatt_update_app_hold_link_status found=1[1-found] idx=0 gatt_if=3 is_add=1
[16:28:45][VV][esp-idf:000]: D (25654) BT_GATT: gatt_get_ch_state: ch_state=2
[16:28:45][VV][esp-idf:000]: I (25656) BT_GATT: GATT_GetConnIdIfConnected status=0
[16:29:08][VV][scheduler:226]: Running interval '' with interval=60000 last_execution=4294955374 (now=48078)
[16:29:08][VV][api.service:576]: on_ping_request: PingRequest {}
[16:29:08][VV][api.service:043]: send_ping_response: PingResponse {}
[16:29:25][VV][esp-idf:000]: D (65801) BT_GATT: GATT   ATT protocol channel with BDA: 11f1ddxxxxxx is connected
[16:29:25][VV][esp-idf:000]: D (65803) BT_GATT: gatt_is_bda_in_the_srv_chg_clt_list :11-f1-dd-xx-xx-xx
[16:29:25][VV][esp-idf:000]: D (65806) BT_GATT: gatt_get_ch_state: ch_state=2
[16:29:25][VV][esp-idf:000]: D (65808) BT_GATT: gatt_set_ch_state: old=2 new=4
[16:29:25][VV][esp-idf:000]: D (65810) BT_GATT: gatt_connect_cback: from 11f1ddxxxxxx connected:1 conn_id=1 reason = 0x0000
[16:29:25][VV][esp-idf:000]: D (65812) BT_GATT: gatt_get_ch_state: ch_state=4
[16:29:25][VV][esp-idf:000]: I (65814) BT_GATT: GATT_GetConnIdIfConnected status=1
[16:29:25][VV][esp-idf:000]: D (65817) BT_GATT: gatt_num_apps_hold_link   num=1
[16:29:25][VV][esp-idf:000]: I (65819) BT_GATT: GATT_SetIdleTimeout idle_tout=65535 status=1(1-OK 0-not performed)
[16:29:25][VV][esp-idf:000]: D (65822) BT_GATT: GATT   ATT protocol channel with BDA: 11f1ddxxxxxx is disconnected
[16:29:25][VV][esp-idf:000]: D (65824) BT_GATT: gatt_is_bda_in_the_srv_chg_clt_list :11-f1-dd-xx-xx-xx
[16:29:25][VV][esp-idf:000]: D (65827) BT_GATT: gatt_cleanup_upon_disc 
[16:29:25][VV][esp-idf:000]: D (65829) BT_GATT: found p_tcb 
[16:29:25][VV][esp-idf:000]: D (65831) BT_GATT: gatt_set_ch_state: old=4 new=0
[16:29:25][VV][esp-idf:000]: D (65833) BT_GATT: gatt_free_pending_ind
[16:29:25][VV][esp-idf:000]: D (65835) BT_GATT: gatt_free_pending_enc_queue
[16:29:25][VV][esp-idf:000]: D (65837) BT_GATT: gatt_free_pending_prepare_write_queue
[16:29:25][VV][esp-idf:000]: I (65844) BT_GATT: GATT_GetConnIdIfConnected status=0
[16:29:25][VV][esp-idf:000]: D (65850) BT_GATT: found p_reg tcb_idx=0 gatt_if=2  conn_id=0x2
[16:29:25][VV][esp-idf:000]: D (65853) BT_GATT: found p_reg tcb_idx=0 gatt_if=3  conn_id=0x3
[16:29:25][VV][esp-idf:000]: W (65856) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x22
[16:29:25][VV][esp-idf:000]: D (65860) BT_GATT: gatt_delete_dev_from_srv_chg_clt_list
[16:29:25][VV][esp-idf:000]: D (65862) BT_GATT: gatt_is_bda_in_the_srv_chg_clt_list :11-f1-dd-xx-xx-xx
[16:29:25][VV][esp-idf:000]: D (65865) BT_GATT: ATT disconnected
[16:29:25][VV][esp-idf:000]: W (65869) BT_HCI: hcif disc complete: hdl 0x1, rsn 0x22
[16:29:25][VV][esp-idf:000]: D (65873) BT_APPL: BTA got event 0x106
[16:29:25][VV][esp-idf:000]: D (65876) BT_APPL: bta_dm_sm_execute event:0x6
[16:29:25][VV][esp-idf:000]: D (65879) BT_APPL: bta_dm_acl_change info: 0x0
[16:29:25][VV][esp-idf:000]: D (65882) BT_APPL: BTA got event 0x106
[16:29:25][VV][esp-idf:000]: D (65885) BT_APPL: bta_dm_sm_execute event:0x6
[16:29:25][VV][esp-idf:000]: D (65888) BT_APPL: BTA got event 0x1f0e
[16:29:25][VV][esp-idf:000]: D (65892) BT_APPL: bta_gattc_conn server cache state=0
[16:29:25][VV][esp-idf:000]: D (65895) BT_APPL: bta_gattc_conn conn_id=3
[16:29:25][VV][esp-idf:000]: I (65898) BT_GATT: GATT_GetConnectionInfor conn_id=3
[16:29:25][VV][esp-idf:000]: D (65901) BT_APPL: bta_gattc_start_discover conn_id=3 p_clcb->p_srcb->state = 3 
[16:29:25][VV][esp-idf:000]: I (65904) BT_GATT: GATTC_Discover conn_id=3 disc_type=1
[16:29:25][VV][esp-idf:000]: E (65907) BT_GATT: GATTC_Discover Illegal param: disc_type 1 conn_id = 3
[16:29:25][VV][esp-idf:000]: E (65910) BT_APPL: discovery on server failed
[16:29:25][VV][esp-idf:000]: D (65913) BT_APPL: bta_gattc_disc_cmpl conn_id=3, status = 135
[16:29:25][VV][esp-idf:000]: D (65917) BT_APPL: BTA got event 0x1f12
[16:29:25][VV][esp-idf:000]: D (65920) BT_APPL: bta_gattc_close conn_id=3
[16:29:25][VV][esp-idf:000]: D (65923) BT_APPL: BTA got event 0x106
[16:29:25][VV][esp-idf:000]: D (65926) BT_APPL: bta_dm_sm_execute event:0x6
[16:29:25][VV][esp-idf:000]: D (65930) BT_APPL: BTA got event 0x1f07
[16:29:25][VV][esp-idf:000]: D (65934) BT_APPL: Ignore unknown conn ID: 3
[16:29:25][VV][esp-idf:000]: D (65936) BT_APPL: BTA got event 0x1f09
[16:29:25][VV][esp-idf:000]: D (65939) BT_APPL: Ignore unknown conn ID: 3
[16:29:25][VV][esp-idf:000]: D (65943) BT_APPL: BTA got event 0x1f0d
[16:29:25][VV][esp-idf:000]: D (65946) BT_APPL: BTA got event 0x1f0d
[16:29:25][VV][esp-idf:000]: D (65949) BT_APPL: BTA got event 0x11f
[16:29:25][VV][esp-idf:000]: D (65952) BT_APPL: bta_dm_sm_execute event:0x1f
[16:29:25][VV][esp-idf:000]: D (65957) BT_APPL: BTA got event 0x121
[16:29:25][VV][esp-idf:000]: D (65960) BT_APPL: bta_dm_sm_execute event:0x21

Hello @caubios,

this is my configuration:

esphome:
  name: xxx1
  friendly_name: xxx1

esp32:
  board: esp32dev
  framework:
    type: esp-idf

esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
    active: true

bluetooth_proxy:
  active: false

ble_client:
  - mac_address: 15:FA:16:XX:XX:XX
    id: hydrao_small_bathroom

button:
  - platform: restart
    name: "xxx1 Restart"

sensor:
  - platform: ble_client
    type: characteristic
    ble_client_id: hydrao_small_bathroom
    name: "Shower SB Total Volume"
    service_uuid: '180f'
    characteristic_uuid: 'ca1c'
    unit_of_measurement: 'L'
    device_class: 'water'
    update_interval: 2000ms
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[1] << 8) | x[0];
        return static_cast<float>(value);
      }
      return NAN;
  - platform: ble_client
    type: characteristic
    ble_client_id: hydrao_small_bathroom
    name: "Shower SB Current Volume"
    service_uuid: 'ff12'
    characteristic_uuid: 'ff02'
    unit_of_measurement: 'dBA'
    update_interval: 2000ms
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[3] << 8) | x[2];
        return static_cast<float>(value);
      }
      return NAN;
  - platform: ble_client
    type: characteristic
    ble_client_id: hydrao_small_bathroom
    name: "Shower SB Current Temperature"
    service_uuid: '180f'
    characteristic_uuid: 'ca32'
    unit_of_measurement: '°C'
    device_class: 'temperature'
    update_interval: 2000ms
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[1] << 8) | x[0];
        return static_cast<float>(value)/2;
      }
      return NAN;
  - platform: ble_client
    type: characteristic
    ble_client_id: hydrao_small_bathroom
    name: "Shower SB Average Temperature"
    service_uuid: '180f'
    characteristic_uuid: 'ca32'
    unit_of_measurement: '°C'
    device_class: 'temperature'
    update_interval: 2000ms
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[3] << 8) | x[2];
        return static_cast<float>(value)/2;
      }
      return NAN;
  - platform: ble_client
    type: characteristic
    ble_client_id: hydrao_small_bathroom
    name: "Shower SB Current Duration"
    service_uuid: '180f'
    characteristic_uuid: 'ca26'
    unit_of_measurement: 's'
    device_class: 'duration'
    update_interval: 2000ms
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[1] << 8) | x[0];
        return static_cast<float>(value)/50;
      }
      return NAN;
  - platform: ble_client
    type: characteristic
    ble_client_id: hydrao_small_bathroom
    name: "Shower SB Current Duration"
    service_uuid: '180f'
    characteristic_uuid: 'ca26'
    unit_of_measurement: 's'
    device_class: 'duration'
    update_interval: 2000ms
    lambda: |-
      if (x.size() >= 2) {
        uint16_t value = (x[1] << 8) | x[0];
        return static_cast<float>(value)/50;
      }
      return NAN;

logger:
  
# Enable Home Assistant API
api:
  encryption:
    key: "xxx"

ota:
  password: "xxx"

wifi:
  ssid: xxx
  password: xxx

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "xxx1"
    password: "xxx"

captive_portal:

I have not time to change the log level for this evening, but I will give it a shot during the week-end.

Don’t bother, I tried with your configuration and it does not work neither.

Let’s conclude with :

HYDRAO HW version 8 and/or Firmware version 20181118 does not work with ESPHome BLE Client for an unknown reason

And I did not find any way to upgrade HYDRAO Aloé firmware version (yet - found the jtag connector on the device but i dont have any binary to flash).

1 Like

I’m sorry but I have only one device at home and I could not test other setup, so you ended up being a guinea pig, wasting time.
It seems there are not a lot of interested people around.

I’ve tried with another Aloe shower head but still no luck with HW version 8 even with a newer firmware version (20210427).

Let say that HW version 9 is mandatory to work with ESPHome!

Yet it is probably a also a problem in the ESPHome ble stack because you manage to connect with gattool