Pool Monitor Device Yieryi BLE-YC01

I looked it up with my phone BT or possibly “nRF Connect” android app. It was a awhile ago now.

Mine is very similar to the address posted in one of the early messages in this thread.

address = "C0:00:00:00:8A:D1"

Yours should be something like

address = "C0:00:00:00:xx:xx"
1 Like

Same here. Can’t make or rails where to begin

This is amazing!! Thanks so much for this. Just an FYI - not sure if this would help anyone else, but I added a small change to include a binary_sensor to track when the ESP32 is actually connected to the BLE sensor (Defined below as ble_yc01_ble_connected). When the ESP32 connects/disconnects from the YC01 this state is then updated (on/off):


esp32_ble_tracker: #### Stop the active scan ####
  scan_parameters: 
    active: false

button:
  - platform: template
    name: "Start Scan"
    on_press:
      - esp32_ble_tracker.start_scan:
  
  - platform: template
    name: "Stop Scan"
    on_press:
      - esp32_ble_tracker.stop_scan:

binary_sensor:
- platform: status
  name: "ESP32 Status"
- platform: template
  id: ble_yc01_ble_connected
  icon: mdi:bluetooth-connect
  name: "BLE Connected"

time:
  - platform: homeassistant
    id: homeassistant_time
    on_time:
      # Turn on BLE client every 30 minutes for 2 minutes
      - seconds: 0
        minutes: /30
        then:
          - switch.turn_on: ble_switch
          - delay: 25min
          - switch.turn_off: ble_switch


######################################################
##                                                  ##
##   To initiate to connection with the BLE device  ##
##                                                  ##
######################################################

ble_client: 
  - mac_address: C0:00:00:XX:XX:XX #Use the MAC address of your BLE device
    id: ble_yc01
    on_connect: #### Actions to perform when connecting to the BLE device ####
      then:
      #### Wait until characteristic is discovered ####
        - wait_until:   
            lambda: |-
              esphome::ble_client::BLEClient* client = id(ble_yc01);
            
              auto service_uuid = 0xFF01;
              auto char_uuid = 0xFF02;
              
              //#### When waiting for connection, we extract the available characteristics ####
              esphome::ble_client::BLECharacteristic* chr = client->get_characteristic(service_uuid, char_uuid);
              
              return chr != nullptr;
              
        #### Official connection to the BLE device with the desired characteristic ####
        - lambda: |- 
            ESP_LOGD("ble_client_lambda", "Connected to BLE-YC01");
            id(ble_yc01_ble_connected).publish_state(true);

            esphome::ble_client::BLEClient* client = id(ble_yc01);
            
            auto service_uuid = 0xFF01; 
            auto char_uuid = 0xFF02;
            
            esphome::ble_client::BLECharacteristic* chr = client->get_characteristic(service_uuid, char_uuid);
            
            if (chr == nullptr) {
                ESP_LOGW("ble_client", "[0xFF01] Characteristic not found.  State update can not be written.");
            }
        
    on_disconnect:
      then:
        - lambda: |-
            ESP_LOGD("ble_client", "Disconnected from BLE-YC01");
            id(ble_yc01_ble_connected).publish_state(false);
            
######################################################
##                                                  ##
##     Sensors associated with the BLE device       ##
##                                                  ##
######################################################
            
sensor: #### Template sensor as their values are publish from a lambda or the BLE client ####

  - platform: template    
    name: "BLE-YC01 EC"
    id: ble_yc01_ec_sensor
    unit_of_measurement: "µS/cm"
    accuracy_decimals: 0
    state_class: measurement
    icon: mdi:water-opacity
    
  - platform: template
    name: "BLE-YC01 TDS"
    id: ble_yc01_tds_sensor
    unit_of_measurement: "ppm"
    accuracy_decimals: 0
    state_class: measurement
    icon: mdi:water-opacity
    
  - platform: template
    name: "BLE-YC01 Temperature"
    id: ble_yc01_temperature_sensor
    unit_of_measurement: "F"
    accuracy_decimals: 2
    state_class: measurement
    device_class: temperature
    
  - platform: template
    name: "BLE-YC01 ORP"
    id: ble_yc01_orp_sensor
    unit_of_measurement: "mV"
    accuracy_decimals: 0
    state_class: measurement
    device_class: voltage
    
  - platform: template
    name: "BLE-YC01 pH"
    id: ble_yc01_ph_sensor
    unit_of_measurement: "pH"
    accuracy_decimals: 2
    state_class: measurement
    icon: mdi:ph

  - platform: template
    name: "BLE-YC01 battery"
    id: ble_yc01_battery
    unit_of_measurement: "%"
    accuracy_decimals: 0
    state_class: measurement
    device_class: battery
    icon: mdi:battery


    
  - platform: ble_client ####  Sensor required to manage values coming from the BLE device ####
    ble_client_id: ble_yc01
    type: characteristic
    id: ble_yc01_sensor
    update_interval: 30s
    internal: true
    service_uuid: FF01
    characteristic_uuid: FF02
    notify: true
    #### Lambda to decode values and push to the associated sensors ####
    lambda: |-
    
      if (x.size() == 0) return NAN;
      
      //ESP_LOGD("ble_client.receive", "value received with %d bytes: [%.*s]", x.size(), x.size(), &x[0]); // ####  Useful for debugging ####
 
 
      // ### DECODING ###
      uint8_t tmp = 0;
      uint8_t hibit = 0;
      uint8_t lobit = 0;
      uint8_t hibit1 = 0;
      uint8_t lobit1 = 0;
      auto message = x;
      
      for (int i = x.size() -1 ; i > 0; i--) {
        tmp=message[i];
        hibit1=(tmp&0x55)<<1;
        lobit1=(tmp&0xAA)>>1;
        tmp=message[i-1];	
        hibit=(tmp&0x55)<<1;
        lobit=(tmp&0xAA)>>1;
        
        message[i]=~(hibit1|lobit);
        message[i-1]=~(hibit|lobit1);

      }
      
      //ESP_LOGD("ble_client.receive", "value received with %d bytes: [%.*s]", message.size(), message.size(), &message[0]); // #### For debug ####


      // #### Extraction of individual values ####
      auto temp = ((message[13]<<8) + message[14]);
      auto ph = ((message[3]<<8) + message[4]);
      auto orp = ((message[20]<<8) + message[21]);
      auto battery = ((message[15]<<8) + message[16]);
      auto ec = ((message[5]<<8) + message[6]);
      auto tds = ((message[7]<<8) + message[8]);
      
      // #### Sensors updated with new values
      id(ble_yc01_temperature_sensor).publish_state(((temp/10.0) * (9.0/5.0)) + 32.0);
      id(ble_yc01_ph_sensor).publish_state(ph/100.0);
      id(ble_yc01_orp_sensor).publish_state(orp);
      id(ble_yc01_battery).publish_state(battery/45);
      id(ble_yc01_ec_sensor).publish_state(ec);
      id(ble_yc01_tds_sensor).publish_state(tds);
       
      return 0.0; // this sensor isn't actually used other than to hook into raw value and publish to template sensors


switch:  #### To switch on and off the communication with the BLE device ####
  - platform: ble_client
    id: ble_switch
    ble_client_id: ble_yc01
    name: "Enable BLE-YC01"  


Below is an automation to force a re-scan/re-connect after a disconnection is detected:

alias: Pool - Sensor Auto-Reconnect
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.pool_ble_connected
    to: "off"
    for:
      hours: 0
      minutes: 7
      seconds: 0
  - platform: time_pattern
    minutes: /25
condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: switch.pool_enable_ble_yc01
        state: "on"
      - condition: or
        conditions:
          - condition: state
            entity_id: binary_sensor.pool_ble_connected
            state: "off"
            for:
              hours: 0
              minutes: 3
              seconds: 0
          - condition: state
            entity_id: binary_sensor.pool_ble_connected
            state: unknown
            for:
              hours: 0
              minutes: 3
              seconds: 0
action:
  - service: button.press
    data: {}
    target:
      entity_id: button.pool_start_scan
mode: single

3 Likes

I am trying to make this script work: but it seems i don’t know how to install decodeInt module.

pip install decodeInt
Collecting decodeInt
Could not find a version that satisfies the requirement decodeInt (from versions: )
No matching distribution.

Can someone please help me?

import asyncio

from bleak import BleakClient

import time

from decodeInt import Messure

address = "C0:00:00:00:8A:D1"

# MODEL_NBR_UUID = "00002a24-0000-1000-8000-00805f9b34fb"

MODEL_NBR_UUID = "0000180D-0000-1000-8000-00805F9B34FB"

Battery_Service = "00002a19-0000-1000-8000-00805f9b34fb"

Vendor_specific = "0000ff10-0000-1000-8000-00805f9b34fb"

"""

00001800-0000-1000-8000-00805f9b34fb (Handle: 1): Generic Access Profile

00001801-0000-1000-8000-00805f9b34fb (Handle: 8): Generic Attribute Profile

0000180a-0000-1000-8000-00805f9b34fb (Handle: 12): Device Information

0000180f-0000-1000-8000-00805f9b34fb (Handle: 31): Battery Service

0000ff01-0000-1000-8000-00805f9b34fb (Handle: 36): Vendor specific

"""

class Messure(object):

    def __init__(self, frame : str) -> None:

        self.frame = frame

       

        self.packet = self.decode(frame)

       

        self.data = self.packet[0]

        self.constant = self.packet[1]

        self.product_name_code = self.packet[2]

       

        self.hold_reading = self.packet[17] >> 4

        self.backlight_status = (self.packet[17] & 0x0F) >> 3

        self.battery = self.decode_position(15)

       

        self.ec = self.decode_position(5)

        self.tds = self.decode_position(7)

        self.salt_tds = self.decode_position(9)

        self.salt_sg = self.decode_position(11) ##TO DO

        self.ph = self.decode_position(3)/100

        self.orp = self.decode_position(20)

        self.temperature = self.decode_position(13)/10

       

    def decode(self, byte_frame : bytes ):

        frame_array = [int(x) for x in byte_frame]

        size = len(frame_array)

        for i in range(size-1, 0 , -1):

            tmp=frame_array[i]

            hibit1=(tmp&0x55)<<1

            lobit1=(tmp&0xAA)>>1

            tmp=frame_array[i-1]

            hibit=(tmp&0x55)<<1

            lobit=(tmp&0xAA)>>1

            frame_array[i]=0xff -(hibit1|lobit)

            frame_array[i-1]= 0xff -(hibit|lobit1)

       

        return frame_array

   

    def reverse_bytes(self, bytes : list):

        return (bytes[0] << 8) + bytes[1]

       

    def decode_position(self,idx):

        return self.reverse_bytes(self.packet[idx:idx+2])

   

    def show_values(self):

        return_string = f"h=[{self.hold_reading}/bl={self.backlight_status}/B={self.battery}] EC={self.ec:4}  TDS={self.tds:4}  SALT(TDS)={self.salt_tds:4}  SALT(S.G.)={self.salt_sg:4}  pH={self.ph:4}  ORP(mV)={self.orp:4}  Temperature(C)={self.temperature:4} "

        return return_string

   

async def main(address):

    async with BleakClient(address) as client:

        print(f"Connected: {client.is_connected}")

       

        paired = await client.pair(protection_level=2)

        print(f"Paired: {paired}")

       

        old_time = time.time()

        print(time.time() - old_time)

        while True:

            model_number = await client.read_gatt_char(Vendor_specific)    

            print(Messure(model_number).show_values())

            time.sleep(1)

asyncio.run(main(address))

The reset of the Device, I’ve have been connecting to it for a little over a week, but today I’ve moved it to my Pool, the values seems static. Temp, battery ect. does not change at all. Been at 92% for a week. I’ve not yet tried resetting by removing the batteries. Do you encounter the same behavior, and what do you do to solve it ? I’m considering removing the batteries, and connecting a 5V supply directly to the connectors. So I can make an external restart ?

This code works for me, removed wifi code for privacy

esphome:
  name: "pool"

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

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

wifi:
  networks:
 

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-C7Bd00"
    password: "IUesaiQycXiE"

#Configuration entry
dallas:
  - pin: GPIO32
    update_interval: 30s

color:
  - id: my_red
    red: 100%
    green: 0%
    blue: 0%
  - id: my_yellow
    red: 100%
    green: 100%
    blue: 0%
  - id: my_green
    red: 0%
    green: 100%
    blue: 0%
  - id: my_blue
    red: 0%
    green: 0%
    blue: 100%
  - id: my_gray
    red: 50%
    green: 50%
    blue: 50%
  - id: my_white
    red: 100%
    green: 100%
    blue: 100%
  - id: my_orange
    red: 100%
    green: 60%
    blue: 0%
  - id: my_teal
    red: 0%
    green: 50%
    blue: 45%        

# put a ttf font called InterFont.ttf in esphome/fonts/
font:
  - file: "fonts/InterFont.ttf"
    id: helvetica_48
    size: 24
  - file: "fonts/InterFont.ttf"
    id: helvetica_24
    size: 20
  - file: "fonts/InterFont.ttf"
    id: helvetica_S
    size: 16

######################################################
##                                                  ##
##   To initiate to connection with the BLE device  ##
##                                                  ##
######################################################
esp32_ble_tracker:  #### Stop the active scan ####
  scan_parameters: 
    active: false

ble_client: 
  - mac_address: C0:00:00:00:35:2B  #Use the MAC address of your BLE device
    id: ble_yc01
    on_connect: #### Actions to perform when connecting to the BLE device ####
      then:
      #### Wait until characteristic is discovered ####
        - wait_until:   
            lambda: |-
              esphome::ble_client::BLEClient* client = id(ble_yc01);
            
              auto service_uuid = 0xFF01;
              auto char_uuid = 0xFF02;
              
              //#### When waiting for connection, we extract the available characteristics ####
              esphome::ble_client::BLECharacteristic* chr = client->get_characteristic(service_uuid, char_uuid);
              
              return chr != nullptr;
              
        #### Official connection to the BLE device with the desired characteristic ####
        - lambda: |- 
            ESP_LOGD("ble_client_lambda", "Connected to BLE-YC01");
            
            esphome::ble_client::BLEClient* client = id(ble_yc01);
            
            auto service_uuid = 0xFF01; 
            auto char_uuid = 0xFF02;
            
            esphome::ble_client::BLECharacteristic* chr = client->get_characteristic(service_uuid, char_uuid);
            
            if (chr == nullptr) {
                ESP_LOGW("ble_client", "[0xFF01] Characteristic not found.  State update can not be written.");
            }
        
    on_disconnect:
      then:
        - lambda: |-
            ESP_LOGD("ble_client", "Disconnected from BLE-YC01");
    

binary_sensor:
  - platform: status
    name: "Node Status"
    id: system_status
  
  - platform: gpio
    entity_category: config
    pin:
      number: GPIO0
      inverted: true
      mode:
        input: true
        pullup: true
    name: ttgo button_0 push
    id: tdisplay_button_input_0

  - platform: gpio
    entity_category: config
    pin:
      number: GPIO35
      inverted: true
      mode:
        input: true
        
    id: tdisplay_button_input_1
    name: ttgo button_1 push

switch:
  - platform: restart
    name: "TTGO restart"
    id: ttgo_restart
  - platform: gpio
    pin: GPIO4
    name: " TTGO-T-Display Backlight"
    id: backlight 
  - platform: ble_client    #### To switch on and off the communication with the BLE device ####
    id: ble_switch
    ble_client_id: ble_yc01
    name: "Enable BLE-YC01"     

# replace my entity IDs with your entity IDs below
sensor:
  - platform: dallas
    address: 0x763cfef64948ba28
    name: "Pool"
    id: Pool_Temp
    filters:
      - filter_out: nan
  - platform: dallas
    address: 0x153c61f649acb628
    name: "Frem"
    id: Frem_Temp
    filters:
      - filter_out: nan
  - platform: dallas
    address: 0xf03cd4f649b42328
    name: "Retur"
    id: Retur_Temp
    filters:
      - filter_out: nan
  - platform: homeassistant
    id: pool_roof_temp
    entity_id: sensor.pool_roof_temp
    internal: true
  
  - platform: homeassistant
    id: pool_tas_temp
    entity_id: sensor.tasmota_sn_th16_ds18b20_temperature
    internal: true
  
  - platform: wifi_signal
    name: "ttgo wifi signal"
    update_interval: 600s
  
  - platform: template
    id: int_temp
    unit_of_measurement: "C"
    accuracy_decimals: 1
    state_class: measurement
    device_class: temperature
    #lambda: return temperatureRead();
    
  - platform: template
    name: "BLE-YC01 EC"
    id: ble_yc01_ec_sensor
    unit_of_measurement: "µS/cm"
    accuracy_decimals: 0
    state_class: measurement
    icon: mdi:water-opacity
    
  - platform: template
    name: "BLE-YC01 TDS"
    id: ble_yc01_tds_sensor
    unit_of_measurement: "ppm"
    accuracy_decimals: 0
    state_class: measurement
    icon: mdi:water-opacity
    
  - platform: template
    name: "BLE-YC01 Temperature"
    id: ble_yc01_temperature_sensor
    unit_of_measurement: "C"
    accuracy_decimals: 1
    state_class: measurement
    device_class: temperature
    
  - platform: template
    name: "BLE-YC01 ORP"
    id: ble_yc01_orp_sensor
    unit_of_measurement: "mV"
    accuracy_decimals: 0
    state_class: measurement
    device_class: voltage
    
  - platform: template
    name: "BLE-YC01 pH"
    id: ble_yc01_ph_sensor
    unit_of_measurement: "pH"
    accuracy_decimals: 2
    state_class: measurement
    icon: mdi:ph

  - platform: template
    name: "BLE-YC01 battery"
    id: ble_yc01_battery
    unit_of_measurement: "%"
    accuracy_decimals: 0
    state_class: measurement
    device_class: battery
    icon: mdi:battery

  - platform: template
    name: "BLE-YC01 CL"
    id: ble_yc01_cloro
    unit_of_measurement: "ppm"
    accuracy_decimals: 0
    state_class: measurement
    icon: mdi:water-opacity  
    
  - platform: ble_client ####  Sensor required to manage values coming from the BLE device ####
    ble_client_id: ble_yc01
    id: ble_yc01_sensor
    internal: true
    service_uuid: FF01
    type: characteristic
    characteristic_uuid: FF02
    notify: true
    #### Lambda to decode values and push to the associated sensors ####
    lambda: |-
    
      if (x.size() == 0) return NAN;
      
      //ESP_LOGD("ble_client.receive", "value received with %d bytes: [%.*s]", x.size(), x.size(), &x[0]); // ####  Useful for debugging ####
 
 
      // ### DECODING ###
      uint8_t tmp = 0;
      uint8_t hibit = 0;
      uint8_t lobit = 0;
      uint8_t hibit1 = 0;
      uint8_t lobit1 = 0;
      auto message = x;
      
      for (int i = x.size() -1 ; i > 0; i--) {
        tmp=message[i];
        hibit1=(tmp&0x55)<<1;
        lobit1=(tmp&0xAA)>>1;
        tmp=message[i-1];	
        hibit=(tmp&0x55)<<1;
        lobit=(tmp&0xAA)>>1;
        
        message[i]=~(hibit1|lobit);
        message[i-1]=~(hibit|lobit1);

      }
      
      //ESP_LOGD("ble_client.receive", "value received with %d bytes: [%.*s]", message.size(), message.size(), &message[0]); // #### For debug ####


      // #### Extraction of individual values ####
      auto temp = ((message[13]<<8) + message[14]);
      auto ph = ((message[3]<<8) + message[4]);
      auto orp = ((message[20]<<8) + message[21]);
      auto battery = ((message[15]<<8) + message[16]);
      auto ec = ((message[5]<<8) + message[6]);
      auto tds = ((message[7]<<8) + message[8]);
      auto cloro = ((message[11]<<8) + message[12]);
      
      // #### Sensors updated with new values
      id(ble_yc01_temperature_sensor).publish_state(temp/10.0);
      id(ble_yc01_ph_sensor).publish_state(ph/100.0);
      id(ble_yc01_orp_sensor).publish_state(orp);
      id(ble_yc01_battery).publish_state(battery/31.51);
      id(ble_yc01_ec_sensor).publish_state(ec);
      id(ble_yc01_tds_sensor).publish_state(tds);
      id(ble_yc01_cloro).publish_state(cloro/10.0);
       
      return 0.0; // this sensor isn't actually used other than to hook into raw value and publish to template sensors
  
time:
  - platform: homeassistant
    id: esptime

spi:
  clk_pin: GPIO18
  mosi_pin: GPIO19

display:
  - platform: st7789v
    model: TTGO TDisplay 135x240
    backlight_pin: GPIO4
    cs_pin: GPIO5
    dc_pin: GPIO16
    reset_pin: GPIO23
    update_interval: 5s
    rotation: 90°
    lambda: |-
      it.rectangle(0,  0, it.get_width(), it.get_height(), id(my_blue));
      //it.rectangle(0, 20, it.get_width(), it.get_height(), id(my_blue));   // header bar should be line not rectangle
      it.line(0, 22, 240, 22, id(my_blue));

      
      it.print(5, 22, id(helvetica_S), id(my_white), TextAlign::LEFT, "Frem.");
      it.printf(5, 34, id(helvetica_48), id(my_red), TextAlign::LEFT, "%.0f°", id(Frem_Temp).state);
      it.print(235, 22, id(helvetica_S), id(my_white), TextAlign::RIGHT, "Retur.");
      it.printf(235, 34, id(helvetica_48), id(my_blue), TextAlign::RIGHT, "%.0f°", id(Retur_Temp).state);
      it.print(120, 22, id(helvetica_S), id(my_white), TextAlign::TOP_CENTER, "Pool.");
      it.printf(120, 34, id(helvetica_48), id(my_green), TextAlign::TOP_CENTER, "%.0f°", id(Pool_Temp).state);
      it.printf(5, 88, id(helvetica_48), id(my_orange), TextAlign::LEFT, "%.1f", id(ble_yc01_ph_sensor).state);
      it.printf(235, 88, id(helvetica_48), id(my_teal), TextAlign::RIGHT, "%.0f", id(ble_yc01_cloro).state);
      it.print(235, 70, id(helvetica_S), id(my_white), TextAlign::RIGHT, "ppm.");
      it.strftime(5, 2, id(helvetica_S), id(my_yellow), TextAlign::TOP_LEFT, "%A %H:%M", id(esptime).now());
      it.print(160, 70, id(helvetica_S), id(my_white), TextAlign::RIGHT, "Batt.");
      it.print(5, 70, id(helvetica_S), id(my_white), TextAlign::LEFT, "pH");
      it.printf(170, 88, id(helvetica_48), id(my_teal), TextAlign::RIGHT, "%.0f%%", id(ble_yc01_battery).state);
      it.printf(55, 88, id(helvetica_48), id(my_green), TextAlign::LEFT, "%.0f", id(ble_yc01_orp_sensor).state);
      it.print(55, 70, id(helvetica_S), id(my_white), TextAlign::LEFT, "orp");
     
      if (id(system_status).state) {
        it.print(235, 2, id(helvetica_S), id(my_green), TextAlign::TOP_RIGHT, "Online");
      }
      else {
        it.print(235, 2, id(helvetica_S), id(my_red), TextAlign::TOP_RIGHT, "Offline");
      }  
    
3 Likes

Hello,

1st of all, thanks all for all the job done in this thread.
I’ve installed your code in an ESP32 but I cannot connect to my device.

in the log i can see this :

[22:28:08][D][esp32_ble_client:048]: [3] [C0:00:00:01:01:01] Found device
[22:28:08][D][esp32_ble_tracker:214]: Pausing scan to make connection...
[22:28:08][I][esp32_ble_client:064]: [3] [C0:00:00:01:01:01] 0x00 Attempting BLE connection
[22:28:31][W][ble_sensor:117]: [ble_yc01_sensor] Cannot poll, not connected

I’ve checked twice the mac with my smartphone. I’ve installed the application on my smartphone and I can connect to device and read. So if someone have a good idea to debug !
Thx

Did you find a step-by-step guide?

A legelső lépéstől.

So finally after many try and retry, it’s now connected. I think that what I’ve done, was to connect my device with the phone app and reset my esp just after. Now it’s connected.

Only problem with this device seems to be the range. I will create a PLA box to put it outside near the pool.

Sweet, have it working for me now too! Do you know if anyone knows how to turn on the backlight as well? I also noticed the battery states 102%. Their app states 100%, but maybe the clamp it

Funny point the battery. For me it’s 65% in the integration and 97% in the app.
For the backlight, i suggest you to install the app to turn it off

On my android phone, I can go into the bluetooth settings and see the MAC addresses for any device I’ve previously paired with. Not sure if Apple does this too, but probably.

So, the first time you get your pool sensor, pair it with an android phone (at least long enough to get the mac address.)

on android, I’ve used the BLE scanner app. when the device is connected to the app, it’s not listed in BL device on the phone. So you need a scanner !

Not sure what you’re trying to say. You definitely don’t need a BLE scanner app to see the bluetooth address (whether the BT device is currently connected OR NOT). I’m on an old Pixel 5, running Android 13

Here’s a screen-shot for a connected BT device. It’s exactly the same for a previously paired, but no longer connected device, except that you wouldn’t see the device permissions):

You’re right except that you cannot connect to BLE-YC01 with BT and so you won’t be able to see MAC address like for other device. This is why you need a third tool to see all MAC around you

Thanks all, works like a charm.
Only problem seems to be te range. Anyone inhere has any idea how to extend the BT range of my esp32wroom ?
It doesnt connect to the ble-yc01 though its only 5 meters away.

Correct, I’ve choose to create a PLA box to put my ESP outside near the pool. As the ESP is using Wifi, no range problem after.
PS : I’ve tried just behind the window in the living but the BLE signal is stop but the window (same behevior with my smartphone). If I open the window, then it connect to.

thxn for sharing your code, my esp32 is ready, just need to change the MAC, just ordered the BLE-YC01 from aliexpress :slight_smile:

Thanks for the code.
It works perfect.

Just one thing:
Is it possible to make something that the sonsors go to „unknow“ when the esp can not connect to the device? For one houre or something?
At the moment the value is still displaying also when the sensor when the device is not in the range of the esp.

Thanks for your help.

For those using this code on esphome 2023.6.x with

bluetooth_proxy:
  active: true

And who are having connection problems, while waiting for the patch on esphome to be pushed,
Just add:

external_components:
  - source: github://pr#5073
    components: [ esp32_ble_tracker ]

https://github.com/esphome/esphome/pull/5073

1 Like