BLE Tire Pressure Monitor

Does anyone have any experience with BLE tyre pressure sensors working with ESPHome? The below linked sensors seem pretty typical of the external valve stem cap style BLE TPMS. I found one project on github that seemed relevant. Looks to me like the BLE manufacturer data advertise trigger lambda would just need worked out to read the sensor data if these are the same as the github variant.

My vehicles have passive TPMS so only get alerted to low pressure, not actual pressure readings. I envision a TTGO T-Display or similar for in the vehicle that would display the sensor data. After each trip, the min & max pressures would be sent to HA once reconnected to home wifi.

https://www.amazon.com/WISTEK-Bluetooth-Monitoring-Real-time-Temperature/dp/B09Z2P6M48

1 Like

I ordered a set of the sensors linked above from amazon. They used same format as the above github project. Here was the ESPHome yaml to get the data:

esp32_ble_tracker:
  scan_parameters:
    active: false
  on_ble_manufacturer_data_advertise:
      manufacturer_id: "0100" 
      then:
        - lambda: |-
            if(x.size() == 16)  {
               ESP_LOGD("BLE TPMS", "sensor: %X:%X:%X", x[3], x[4],x[5]);
               uint32_t value = x[6] | (x[7] << 8) | (x[8] << 16) | (x[9] << 24);
               ESP_LOGD("BLE TPMS", "   psi: %f", value * 0.000145038);
               ESP_LOGD("BLE TPMS", "  temp: %f",  (x[10] | (x[11] << 8) ) / 100.0 );
               ESP_LOGD("BLE TPMS", "   bat: %d",  x[14] );               
               ESP_LOGD("BLE TPMS", "   !!!: %d",  x[15] );               
            }
3 Likes

Hi @mulcmu thanks for sharing the information :+1: :+1: :smiley:

Could you show us what your dashboard looks like as a final result?

Could we have more than 1 set so we could see separate cars, etc?

Dashboard is still a work in progress.

Bytes 0 to 5 in the data are the MAC address for each individual sensor. The last 3 bytes are used in the sample code above to uniquely identify each sensor. All the data is sent without any pairing so multiple vehicles wouldn’t be a problem on a single esp32.

Yea, thought that would be the case and thanks for confirming.

I’ve recently created a custom integration for home assistant for these sensors:

2 Likes

Thanks, Your integration works great.

I bought a set of cheap BLE TPMS sensors from AliExpress. I thought they would be similar, but the data structure was quite different from anything else I could find.

The sensors I have starts with a mac address of “AC:15:85”. I have posted my findings and configuration on this github repo, hopefully it helps a few people

i installed it to day and works perfect. only 1 question.
This is pasive, isnt it? this integration not affect at battery ussage of the sensor?

this is inportant in my case because my ble sensors are inside the wheel, not outside :slight_smile:

It is passive which means that it won’t connect to the sensors, so it won’t affect their battery

I’ve got also these sensors from AliExpress. They also start mac address with “AC:15:85”.
I get this kind of data:
[13:01:15][D][BLE_TPMS:149]: Manufacturer ID: 0x1E20
[13:01:15][D][BLE_TPMS:150]: Manufacturer Data: 15:2:3:F5:EE
[13:01:15][D][BLE_TPMS:151]: Manufacturer Data length: 5

I used this code for conversion:

  • mac_address: !secret rr_mac

    then:
    
      - lambda: |-
    
          ESP_LOGD("BLE_TPMS", "TPMS BLE Device discovered");        
    
          for (auto data : x.get_manufacturer_datas()) {
    
            const char *hexstring = data.uuid.to_string().substr(2,2).c_str();
    
            const float voltage = (float) strtol(hexstring, NULL, 16) * 0.1;
    
            const int pressure = data.data[1] << 8 | data.data[2];
    
            id(ble_rr_temp).publish_state(data.data[0]);
    
            id(ble_rr_press).publish_state((float) pressure * 0.005);
    
            id(ble_rr_batt).publish_state(voltage);
    
            ESP_LOGD("BLE_TPMS", "Manufacturer ID: %s", data.uuid.to_string().c_str());
    
            ESP_LOGD("BLE_TPMS", "Manufacturer Data: %X:%X:%X:%X:%X", data.data[0], data.data[1], data.data[2], data.data[3], data.data[4]);
    
            ESP_LOGD("BLE_TPMS", "Manufacturer Data length: %d", data.data.size());              
    
          }
    

For voltage and temperature the conversion is ok. For the pressure I had to multiply with 0.005 in order to get a realistic value in bar:
image

Vasili kalispera,

Your integration works with any BLE sensors? Does it draw data from the application and displays it in Home assistant or do you need a development board (NodeMCU) and esphome?

Thanks/Eyxaristw!

Kalispera Michali,
This is using the Bluetooth integration BLE of Home Assistant.

This means that you can use the Bluetooth of your device that you installed Home Assistant but it is limited to the range of the bluetooth and how close it is to your TPM devices.
An alternative is using the ESPhome installed on an ESP32 device that you can have it close to your TPM devices and use the Bluetooth Proxy integration.

If you need any further info feel free to contact me: [email protected]

Thanks for the quick response!

I think i am gonna go with the ESP method as the device i have HA installed is at home! I guess with this method,

  • i create a Bluetooth proxy on an ESP32 development board most probably powered from one of the car’s usb ports.
  • connect the TPM sensors to it.
  • find a way for the ESP32 to have internet (most probably mobile hotspot)
  • Add it to Home Assistant

Don’t know if anyone has implemented this before, i was wondering if i can leave the ESP32 device connected to the USB port of the car or it will drain the battery completly!

Thanks again!

On most cars the power to the USB is cut once you remove the key, so it won’t drain the car battery.
There are some ESP32 boards that use SIM to connect to the internet.

If you connect ESP32 through the internet, you won’t be able to use the ESPHome integration on Home Assistant. You will have to program your ESP to send data to your home assistant instance every few minutes.
One way to do this is by using webhook requests.

I just got 4 of these, but I just can’t figure out how the get the mac-adresses from each TPMS?

How did you manage to fint the correct macadress for each TPMS?

Here was sample code to get sensor mac address. I found some sensors don’t transmit if they are not pressurized.

esp32_ble_tracker:
  on_ble_advertise:
      then:
        - lambda: |-
            ESP_LOGD("ble_adv", "New BLE device");
            ESP_LOGD("ble_adv", "  address: %s", x.address_str().c_str());
            ESP_LOGD("ble_adv", "  name: %s", x.get_name().c_str());
            ESP_LOGD("ble_adv", "  Advertised service UUIDs:");
            for (auto uuid : x.get_service_uuids()) {
                ESP_LOGD("ble_adv", "    - %s", uuid.to_string().c_str());
            }
            ESP_LOGD("ble_adv", "  Advertised service data:");
            for (auto data : x.get_service_datas()) {
                ESP_LOGD("ble_adv", "    - %s: (length %i)", data.uuid.to_string().c_str(), data.data.size());
            }
            ESP_LOGD("ble_adv", "  Advertised manufacturer data:");
            for (auto data : x.get_manufacturer_datas()) {
                ESP_LOGD("ble_adv", "    - %s: (length %i)", data.uuid.to_string().c_str(), data.data.size());
            }