Kat81inTX

ESP32-S3-GEEK Proxy/Tracker/Client Bridge

Jul 16th, 2025 (edited)
854
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 5.21 KB | None | 0 0
  1. substitutions:
  2.   name: "esp32-bridge-proxy-tracker"
  3.   friendly_name: "ESP32-S3-GEEK Client Bridge/Proxy/Tracker"
  4.  
  5.   local_tdwlb_lcrppf_mac: !secret tdwlb_lcrppf_mac
  6.  
  7. esphome:
  8.   name: esp32-s3-geek
  9. #  friendly_name: ESP32-S3-GEEK
  10.  
  11. #  name: ${name}
  12.   friendly_name: ${friendly_name}
  13.  
  14.   name_add_mac_suffix: false
  15.  
  16.   min_version: 2025.7.0  # Using new sub-device features
  17.  
  18.   areas:
  19.     - id: garage_entry_area
  20.       name: "Garage Entry"
  21.      
  22.     - id: garage_area
  23.       name: "Garage"
  24.  
  25.   devices:
  26. #    - id: esp32_s3_geek_ble_bridge               <-- NOT SUPPORTED IN 2025.7.0
  27. #      name: "ESP32-S3 GEEK BLE Bridge"
  28. #      area_id: garage_entry_area
  29.  
  30. #    - id: garage_entry_bluetooth_proxy           <-- NOT SUPPORTED IN 2025.7.0
  31. #      name: "ESP32-S3 GEEK Bluetooth Proxy"
  32. #      area_id: garage_entry_area
  33.  
  34. #    - id: garage_entry_ble_tracker               <-- NOT SUPPORTED IN 2025.7.0
  35. #      name: "ESP32-S3 GEEK BLE Tracker"
  36. #      area_id: garage_entry_area
  37.            
  38.     - id: tdwlb_lcrppf_client
  39.       name: "Water Tank Sensor"
  40.       area_id: garage_area
  41.  
  42.   platformio_options:
  43.     board_build.f_flash: 40000000L
  44.     board_build.flash_mode: dio
  45.     board_build.flash_size: 4MB
  46.  
  47. esp32:
  48.   board: esp32-s3-devkitc-1
  49.   variant: esp32s3
  50.   framework:
  51.     type: esp-idf
  52.     sdkconfig_options:
  53.       CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y
  54.       CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y
  55.  
  56. # Enable logging for debugging
  57. logger:
  58.   level: INFO
  59.  
  60. # Enable Home Assistant API
  61. api:
  62. # Enable Over-The-Air updates
  63. ota:
  64.   - platform: esphome
  65.     password: !secret ota_password
  66.  
  67. # Allow WiFi provisioning via serial
  68. improv_serial:
  69. # WiFi configuration
  70. wifi:
  71.   ssid: !secret wifi_ssid
  72.   password: !secret wifi_password
  73.   power_save_mode: light
  74.  
  75. captive_portal:
  76. button:
  77.   - platform: safe_mode
  78.     id: safe_mode_button
  79.     name: Safe Mode Boot
  80.  
  81.   - platform: factory_reset
  82.     id: factory_reset_button
  83.     name: Factory reset
  84.  
  85. bluetooth_proxy:
  86. # device_id: garage_entry_bluetooth_proxy           <-- NOT SUPPORTED IN 2025.7.0
  87.   active: true
  88.  
  89. esp32_ble_tracker:
  90. # device_id: garage_entry_ble_tracker               <-- NOT SUPPORTED IN 2025.7.0
  91.   scan_parameters:
  92.     active: true
  93.     interval: 320ms
  94.     window: 30ms
  95.  
  96. # Set up the TDWLB-LCRPPF as an auto-connect client
  97. ble_client:
  98. # device_id: tdwlb_lcrppf_client                    <-- NOT SUPPORTED IN 2025.7.0
  99.   id: tdwlb_lcrppf
  100.   mac_address: !secret tdwlb_lcrppf_mac
  101.   auto_connect: true
  102.  
  103. # Device information sensors
  104. text_sensor:
  105.   - platform: ble_client
  106.     ble_client_id: tdwlb_lcrppf
  107.     device_id: tdwlb_lcrppf_client
  108.     service_uuid: "180A"
  109.     characteristic_uuid: "2A24"
  110.     name: "Model Number"
  111.     icon: "mdi:information-outline"
  112.  
  113.   - platform: ble_client
  114.     ble_client_id: tdwlb_lcrppf
  115.     device_id: tdwlb_lcrppf_client
  116.     service_uuid: "180A"
  117.     characteristic_uuid: "2A29"
  118.     name: "Manufacturer"
  119.     icon: "mdi:information-outline"
  120.  
  121.   - platform: ble_client
  122.     ble_client_id: tdwlb_lcrppf
  123.     device_id: tdwlb_lcrppf_client
  124.     service_uuid: "180A"
  125.     characteristic_uuid: "2A25"
  126.     name: "Serial Number"
  127.     icon: "mdi:information-outline"
  128.  
  129.   - platform: ble_client
  130.     ble_client_id: tdwlb_lcrppf
  131.     device_id: tdwlb_lcrppf_client
  132.     service_uuid: "180A"
  133.     characteristic_uuid: "2A26"
  134.     name: "Firmware Revision"
  135.     icon: "mdi:information-outline"
  136.  
  137. sensor:
  138. # Pressure sensor
  139.   - platform: ble_client
  140.     ble_client_id: tdwlb_lcrppf
  141.     device_id: tdwlb_lcrppf_client
  142.     type: characteristic
  143.     service_uuid: "CC4A6A80-51E0-11E3-B451-0002A5D5C51B"
  144.     characteristic_uuid: "835AB4C0-51E4-11E3-A5BD-0002A5D5C51B"
  145.     name: "Pressure"
  146.     unit_of_measurement: "psi"
  147.     accuracy_decimals: 1
  148.     device_class: "pressure"
  149.     notify: true
  150.     lambda: |-
  151.       // Extract the 16-bit unsigned integer raw value from the byte array
  152.       uint16_t raw = (x[0] << 8) | x[1];
  153.       // Scale the raw value directly
  154.       float pressure_psi = raw / 10.0;
  155.       return pressure_psi;
  156.    
  157. # Temperature sensor
  158.   - platform: ble_client
  159.     ble_client_id: tdwlb_lcrppf
  160.     device_id: tdwlb_lcrppf_client
  161.     type: characteristic
  162.     service_uuid: "CC4A6A80-51E0-11E3-B451-0002A5D5C51B"
  163.     characteristic_uuid: "2A1C"
  164.     name: "Temperature"
  165.     unit_of_measurement: "°F"
  166.     accuracy_decimals: 1
  167.     device_class: "temperature"
  168.     notify: true
  169.     lambda: |-
  170.       // Extract the first byte that contains the internal / external flag bit (bit 3)
  171.       uint8_t flag = x[0];
  172.       // Extract the 32-bit raw value from the byte array
  173.       uint32_t temp_raw = (x[1] << 24) | (x[2] << 16) | (x[3] << 8) | x[4];
  174.       // Convert to signed float representing °C
  175.       float celsius = *reinterpret_cast<float*>(&temp_raw);
  176.       // convert to °F
  177.       float farenheit = celsius * 9.0 / 5.0 + 32.0;
  178.       return farenheit;
  179.  
  180. # Battery level
  181.   - platform: ble_client
  182.     ble_client_id: tdwlb_lcrppf
  183.     device_id: tdwlb_lcrppf_client
  184.     type: characteristic
  185.     service_uuid: "180F"
  186.     characteristic_uuid: "2A19"
  187.     name: "Battery"
  188.     unit_of_measurement: "%"
  189.     icon: "mdi:battery"
  190.     update_interval: 60s
  191.     device_class: battery
  192.     state_class: measurement
  193.  
Advertisement
Add Comment
Please, Sign In to add comment