Advertisement
Kat81inTX

ESP32-S3-GEEK Proxy/Tracker/Client Bridge

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