Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Sensor]: Transducers Direct TDWLB-LC-RPPF #1386

Closed
bobbeims opened this issue Aug 27, 2024 · 21 comments
Closed

[New Sensor]: Transducers Direct TDWLB-LC-RPPF #1386

bobbeims opened this issue Aug 27, 2024 · 21 comments
Assignees
Labels
new sensor Request for a new sensor

Comments

@bobbeims
Copy link

Sensor Description

TDWLB-LC-RPPF remote pool pressure monitor

Additional information

CirrusSense Wireless Pool Filter Pressure Gauge

I've been using this remote pressure sensor for a while with the Pressure Pro CirrusSense app but would really like to integrate the pressure data into my Home Assistant setup.

I've used the iOS app "BLE Scanner" to grab the basic info for my sensor. Since the linked instruction page doesn't talk about the iOS app, I'm not sure if I've given you all of the data you need.

BLE advertisements

DEVICE UUID
81632CAA-1804-5E3A-283C-3282E0B7E86F

ADVERTIMENT DATA

{length = 3, bytes = 0x0c0114}
Advertisement Manufacturer Data

10
TxPower Level

YES
Device is connectable

{length = 3, bytes = 0x0c0114}
Advertisement Manufacturer Data

Pressure Tank
Device Local Name

10
TxPower Level


SERVICES

DEVICE INFORMATION
0x180A
PRIMARY SERVICE

BATTERY SERVICE
0x180F
PRIMARY SERVICE

CUSTOM SERVICE
0x18FF
PRIMARY SERVICE

TX POWER
0x1804
PRIMARY SERVICE

CUSTOM SERVICE
CC4A6A80-51E0-11E3-B451-0002A5D5C51B
PRIMARY SERVICE
@bobbeims bobbeims added the new sensor Request for a new sensor label Aug 27, 2024
@bobbeims
Copy link
Author

Here are screenshots from the BLE Scanner app
image
image
image
image
image
image
image
image
image
image
image
image
image

@bobbeims
Copy link
Author

Here are a couple screenshots from the iOS app:
image
image

@bobbeims
Copy link
Author

@Ernst79 I just want to make sure I've provided the info needed correctly. If there's anything I can do to help get this sensor added in the near term, please let me know.

@bobbeims
Copy link
Author

@Ernst79 I don't mean to be a pest, but is there anything I can to do help nudge this along?

@Ernst79
Copy link
Collaborator

Ernst79 commented Sep 18, 2024

Hi, I’m very busy at the moment, lacking time to look into this right now. What can make it easier for me is collecting the data via the Home Assistant logs, in stead of via the BLE scanner app, as explained in method 1 here.
https://custom-components.github.io/ble_monitor/sensor_request

@starsoccer
Copy link

+1 on this. Would be great to get added. Im looking at buying one of these sensors(not for a pool) and hopefully it will be compatible or a small tweak to make it compatible

@starsoccer
Copy link

Just got my sensor, @bobbeims What is the best way to pull your branch and try it locally? I ended up getting the pool sensor so I expect it will work fine, but would love to have the data in HA

@starsoccer
Copy link

Sorry to be a pest on this, but any update? Would gladly chip in 20$ to get this added as I really need historical data which currently isnt possible with the app

@Ernst79
Copy link
Collaborator

Ernst79 commented Nov 14, 2024

Based on the info you gave in the OP, I come to the conclusion that this device needs a connection, to read the data (Characteristics). This is unfortunately not possible with BLE monitor, we only read passively send data. You can try ESPhome BLE client instead, that component is able to connect to BLE devices and “ask” for the data, by sending a request message to the device.

I’m closing the issue here, as it is not possible to implement it in BLE monitor. Y

@Ernst79 Ernst79 closed this as completed Nov 14, 2024
@bobbeims
Copy link
Author

bobbeims commented Nov 14, 2024 via email

@Ernst79
Copy link
Collaborator

Ernst79 commented Nov 14, 2024

Allmost. The first steps are correct, you need an ESP device (with Bluetooth) flashed with ESPHome and you need to add it to HA with the ESPHome integration. However, you don't need to configure it in BLE monitor, as HA can directly get its data from the ESPHome device.

You will need to enable BLE client on the BLE device and configure the MAC address of your Transducer to be able to make a connection, see the instructions here.

https://esphome.io/components/ble_client.html

Read the entire page, you will need to figure out yourself which data can be read from the device. this is explained on the above page, but will most likely be a lot of trial and error. And if the data is encrypted, it becomes really hard, but in most cases, data is not encrypted, in which case you should be able to figure out what data is what.

@starsoccer
Copy link

Allmost. The first steps are correct, you need an ESP device (with Bluetooth) flashed with ESPHome and you need to add it to HA with the ESPHome integration. However, you don't need to configure it in BLE monitor, as HA can directly get its data from the ESPHome device.

You will need to enable BLE client on the BLE device and configure the MAC address of your Transducer to be able to make a connection, see the instructions here.

https://esphome.io/components/ble_client.html

Read the entire page, you will need to figure out yourself which data can be read from the device. this is explained on the above page, but will most likely be a lot of trial and error. And if the data is encrypted, it becomes really hard, but in most cases, data is not encrypted, in which case you should be able to figure out what data is what.

Ive looked into the data source already and the data is plain text not encrypted. The data is simply hex encoded and you just need to add a decimal point to it. For instance a characteristic will be set to 014B which when converted to decimal becomes 331 meaning the pressure is 33.1

@bobbeims
Copy link
Author

bobbeims commented Nov 14, 2024 via email

@starsoccer
Copy link

I would think it should be possible to do this with bluetooth proxies in HA or just bluetooth in general on HA. I dont know python so its outside my skill set though but getting this data seems relatively straightforward. Just need to connect to the device, then just wait for updates or poll every 30 seconds and grab 1 or 2 characteristics

@Ernst79
Copy link
Collaborator

Ernst79 commented Nov 14, 2024

Flashing an ESPhome device is easy, you can do it from the HA interface

@bobbeims
Copy link
Author

bobbeims commented Nov 14, 2024 via email

@starsoccer
Copy link

I didn't mean flashing was hard, I meant writing the code part to integrate with HA was beyond me. Happy to help someone else who has more experience then me

@bobbeims
Copy link
Author

bobbeims commented Nov 14, 2024 via email

@Ernst79
Copy link
Collaborator

Ernst79 commented Nov 15, 2024

You don’t need python when using an ESPHome device. it’s just configuring the YAML in the ESPHome dashboard and update the ESPHome device. Here is an config example of a sensor that connects and reads the battery data from a sensor. The docs explain how you can figure out the service_uuid and the characteristic_uuid of your sensor. https://esphome.io/components/ble_client.html#setting-up-devices

esp32_ble_tracker:

ble_client:
  - mac_address: XX:XX:XX:XX:XX:XX
    id: itag_black

sensor:
  - platform: ble_client
    type: characteristic
    ble_client_id: itag_black
    name: "iTag battery level"
    service_uuid: '180f'
    characteristic_uuid: '2a19'
    icon: 'mdi:battery'
    unit_of_measurement: '%'

  - platform: ble_client
    type: rssi
    ble_client_id: itag_black
    name: "iTag RSSI"

@starsoccer
Copy link

Oh well that seems super simple actually. Any suggestions of a esphome device to get? And how does the device know to connect back to HA to report the data?

@Ernst79
Copy link
Collaborator

Ernst79 commented Nov 15, 2024

Just any ESP32 with bluetooth support will be fine.

Step 1. figure out the MAC address of the device by using the esp32_ble_tracker component https://esphome.io/components/binary_sensor/ble_presence#esp32-ble-tracker-setting-up-devices Just check the logs till you see your ESPHome device. Make a note of the MAC address

esp32_ble_tracker:

Step 2. Connect to the device with the BLE client component by adding the ble_client component and specifying the MAC address of step 1 (and give it an name/id. After reflashing, check the logs for the available "characteristics" (sensor data). https://esphome.io/components/ble_client.html

esp32_ble_tracker:

ble_client:
  - mac_address: XX:XX:XX:XX:XX:XX
    id: TDWLB-LC-RPPF

This will show you something like thin in the logs.

[18:24:56][D][ble_client:043]: Found device at MAC address [XX:XX:XX:XX:XX:XX]
[18:24:56][I][ble_client:072]: Attempting BLE connection to XX:XX:XX:XX:XX:XX
[18:24:56][I][ble_client:097]: [XX:XX:XX:XX:XX:XX] ESP_GATTC_OPEN_EVT
[18:24:57][I][ble_client:143]: Service UUID: 0x1800
[18:24:57][I][ble_client:144]:   start_handle: 0x1  end_handle: 0x5
[18:24:57][I][ble_client:305]:  characteristic 0x2A00, handle 0x3, properties 0x2
[18:24:57][I][ble_client:305]:  characteristic 0x2A01, handle 0x5, properties 0x2
[18:24:57][I][ble_client:143]: Service UUID: 0x1801

Step 3. Create a sensor by specifying the characteristic and Service UUID. This is where some trial and error kicks in, you have to figure out which characteristic is usefull, and which one is not. Note that they often follow the Bluetooth offical specs, but not always.

esp32_ble_tracker:

ble_client:
  - mac_address: XX:XX:XX:XX:XX:XX
    id: TDWLB-LC-RPPF

sensor:
  - platform: ble_client
    type: characteristic
    ble_client_id: TDWLB-LC-RPPF
    name: "sensor battery level"
    service_uuid: '180f'
    characteristic_uuid: '2a19'
    icon: 'mdi:battery'
    unit_of_measurement: '%'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new sensor Request for a new sensor
Projects
None yet
Development

No branches or pull requests

3 participants