Bluetooth propane tank monitor: ESPhome, Otodata, Nee-vo, Ferrellgas, BLE

TLDR:

Found propane tank sensor broadcasting via Bluetooth and got it working in HA. Complete NOOB on BLE so please provide better solutions.

ESPHOME Code:

# Bluetooth for Propane tank sensor
esp32_ble_tracker:
# Sending state data: '{"timestamp":1309,"address":"C3:2E:95:XX:XX:XX","rssi":-69,"name":"level: 67.4 % horiz"}'
  on_ble_advertise:
    # Change MAC Address to your specific device as shown in BLE Tracker.
    - mac_address: C3:2E:95:XX:XX:XX
      then:
        - lambda: |-
            # Get the name of bluetooth device.
            std::string name = x.get_name();
            # Check if name begins with "level:".
            if (esphome::str_startswith(name, "level:")) {
              # Delete the first 7 characters from name.
              name.erase(0,7);
              # Extract the tank state value up to next space character. 
              std::string value = esphome::str_until(name.c_str(), ' ');
              # Update template sensor value converting to float value.
              id(propane_level).publish_state(atof(value.c_str()));
            }

sensor:
# To store the propane level percentage - does nothing on its own.
  - platform: template
    name: Propane Level
    id: propane_level
    unit_of_measurement: '%'
# Reports the signal strength auto magically.
  - platform: ble_rssi
    # Change MAC Address to your specific device as shown in BLE Tracker.
    mac_address: C3:2E:95:XX:XX:XX
    name: "Propane RSSI"

Backstory:

I knew that my propane provider “Ferrellgas” installed a battery powered sensor unit, that sends data over Cell/Mobile phone connection, a few months ago. I asked the installer if I could get access to the data and he told me to contact local branch. Local branch had no clue and told me to call head office. Head office told me I could sign in to a web site that would show my tank percentage status. This did show the data but I could not find a simple way to automate the extraction/download.

A few days ago, whilst debugging connection issue to Bluetooth speaker, I discovered that the propane sensor is broadcasting on Bluetooth, so down the rabbit hole I went.

I originally started by using the ESPHOME tools to try to get info but then discovered an excellent, free, Android app called " nRF Connect for Mobile" which gave a ton of useful info such as:

  • Manufacturer name
  • Model
  • Software and firmware version
  • Service and Characteristic UUIDs

See: https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp&hl=en_US&gl=US

Android App:

My sensor is outwardly branded “Ferrellgas” but actually made by “Otodata” model “TM6030”.

Quickly found that Otodata provides and Android app to get the data called “Nee-Vo” that displays correct data. See : https://play.google.com/store/search?q=nee-vo+app&c=apps&hl=en_US&gl=US

This required registration with name, email, and unique activation code found on the sensor. It worked straight away showing current tank level, historical tank level data, and current temperature at site. App is pretty good and allows setting alerts based on tank level and when it has been refilled. Don’t know why my propane provider did not inform me about this app.

  • Tank capacity: 170 gal (wrong)
  • Tank percentage: 68% (correct when compared to web site)
  • Tank temp: 80F (correct based on other temp sensors)

Discovery:

Started with the “ESPHome BLE Tracker” to find the MAC address using “very verbose” logger output to find the MAC address of the BLE device:

# Enable logging
logger:
  level: VERY_VERBOSE

Then tried the BLE_Client to connect and get more info. This was not fruitful as I could not find a Service UUID and Characteristic UUID that reported data I was looking for.

I did find out that the BLE device name rotates through 3 iterations showing data I can extract. Here is some of the summary data just in case anyone can help finding a better method. I have annotated output with [my info].

[09:47:55][I][ble_client:085]: Attempting BLE connection to c3:2e:95:XX:XX:XX
[09:48:05][I][ble_client:161]: Service UUID: 0x1800 [Always there]
[09:48:05][I][ble_client:162]:   start_handle: 0x1  end_handle: 0x9
[09:48:05][I][ble_client:347]:  characteristic 0x2A00, handle 0x3, properties 0xa [READ,WRITE: Device Name: 'TM6030 20341387', 'unit sleeping', '310260.3|1|0']
[09:48:05][I][ble_client:347]:  characteristic 0x2A01, handle 0x5, properties 0x2 [READ: Appearance: '[512] Generic Tag (Generic category)']
[09:48:05][I][ble_client:347]:  characteristic 0x2A04, handle 0x7, properties 0x2 [READ: Preferred Connection Parameters: '\x90 ' which kills HA communication when read]
[09:48:05][I][ble_client:347]:  characteristic 0x2AA6, handle 0x9, properties 0x2 [READ: Central Address Resolution: 'Address resolution supported']
[09:48:05][I][ble_client:161]: Service UUID: 0x1801 [Generic Attribute]
[09:48:05][I][ble_client:162]:   start_handle: 0xa  end_handle: 0xd
[09:48:05][I][ble_client:347]:  characteristic 0x2A05, handle 0xc, properties 0x20 [INDICATE: Service Changed? ]
[09:48:05][I][ble_client:347]:  characteristic 0x2902, handle , properties  [Client Characteristic Configuration? ]
[09:48:05][I][ble_client:161]: Service UUID: 6E400001-B5A3-F393-E0A9-E50E24DCCA9E 
[09:48:05][I][ble_client:162]:   start_handle: 0xe  end_handle: 0x13
[09:48:05][I][ble_client:347]:  characteristic 6E400003-B5A3-F393-E0A9-E50E24DCCA9E, handle 0x10, properties 0x10 [NOTIFY: nothing]
[09:48:05][I][ble_client:347]:  characteristic 6E400002-B5A3-F393-E0A9-E50E24DCCA9E, handle 0x13, properties 0xc  [WRITE, WRITE NO RESPONSE: '\xaa']
[16:07:50][I][ble_client:161]: Service UUID: 0x180A [Device info]
[16:07:50][I][ble_client:162]:   start_handle: 0x14  end_handle: 0x20
[16:07:50][I][ble_client:347]:  characteristic 0x2A24, handle 0x18, properties 0x2 [READ: Model Number: 'MEP3AD']
[16:07:50][I][ble_client:347]:  characteristic 0x2A25, handle 0x1a, properties 0x2 [READ: Serial Number: '20341387']
[16:07:50][I][ble_client:347]:  characteristic 0x2A26, handle 0x1e, properties 0x2 [READ: Firmware Revision: '1806.1.236.2.26']
[16:07:50][I][ble_client:347]:  characteristic 0x2A27, handle 0x1c, properties 0x2 [READ: Hardware Revision: 'C018_1R0']
[16:07:50][I][ble_client:347]:  characteristic 0x2A28, handle 0x20, properties 0x2 [READ: Software Revision: '0059.08.0091']
[16:22:32][I][ble_client:347]:  characteristic 0x2A29, handle 0x16, properties 0x2 [READ: Manufacturer name: 'Otodata Inc.']
[16:07:50][I][ble_client:161]: Service UUID: 0xFE59 [Secure DFU]
[16:07:50][I][ble_client:162]:   start_handle: 0x21  end_handle: 0xffff
[16:07:50][I][ble_client:347]:  characteristic 8EC90003-F315-4F60-9FB8-838830DAEA50, handle 0x23, properties 0x28 [INDICATE, WRITE: Buttonless DFU]

The useful info, for me, was the changing BLE name:

[esp32_ble_tracker:746]:   Name: 'TM6030 2034XXXX'
[esp32_ble_tracker:517]:   Name: 'level: 68.2 % horiz'
[esp32_ble_tracker:687]:   Name: 'unit sleeping'

The name rotated without discernible pattern but I could scrape it using the MAC address.

Questions/Help:

  • Is a better way to do this?
  • I found BLE “characteristics” that use “notify” and was wondering is this could get more usable data?
  • Will I cause excessive drain on the battery powered device by reading the values?
  • Let me know what other data is useful?

Thanks for any help.

3 Likes

Wow, great job on this. I’ve used nrf connect for my pine Time watch, but didn’t think of it for degugging Bluetooth devices.

Sorry for all the questions, looking to replace a broken Tank Utility monitor.

Can you tell me what hardware you are using for your esp32 device? I’d like to simply get the data out from a device like this. The price of the devices seems reasonable. I have a raspberry pi on my generator running genmon, so theoretically I could use bluetooth on there to get this info out of my device.

Do you know what is required to setup a Otodata? I have a different propane provider and don’t want to use the cell/mobile piece, just wondering if I can buy one and only use the bluetooth without the cellular setup. How often does it transmit?

I’m using an ESP32 DevKitC v4 but any ESP32 with bluetooth should work.

AFAIK the cell part is required on my Otodata as the configuration seems to be done using a web portal by entering a unique code that is on the device and a partner (company) login. I don’t think you will be able to buy one and if you are it will be very expensive ($300+). It seems to be a closed market for propane providers probably due to laws about electronics on propane tanks leading to possible explosions.

The stupid part is that its a very basic hall effect sensor. If you have a R3D propane dial and can get the cable/sensor (black part in linked pic) then all you need to do is read the voltage and map it to pressure values. I tried for ages to get a cable but no one would sell it to me.

About every 10 mins on Bluetooth. Don’t know about cell but I would expect much less frequently.

1 Like

Just wanted to say thanks! I’ve been looking for a solution for this for almost a year now! Didn’t realize they had ble capabilities, but it shows up when I scan with my phone! Now I just need to get an esp32 and pull it into HA.
You are a genius @tinker_ha !

Its really great to hear that you may get a working solution from my post. Thank you for replying!

I too was looking for a propane monitoring solution for many years but could not source parts to make a custom solution happen. It was amazing to suddenly find a Bluetooth broadcast without having to install any hardware!

FYI, My Bluetooth RSSI readings are all over the place so I added filters to reduce number of logged values:

  - platform: ble_rssi
    # Change MAC Address to your specific device as shown in BLE Tracker.
    mac_address: C3:2E:95:XX:XX:XX
    name: "Propane RSSI"
    id: propane_rssi
    filters:
    # Smooth readings as they are very noisy
    - sliding_window_moving_average:
        window_size: 15
        send_every: 15

My propane level value fluctuates very little at ±1% over the day.

Let me know if you have any problems getting this working.

Hey @tinker_ha

Finally had a chance to get it working over the weekend. So far so good! Thanks again for sharing this.

Excellent. Glad its working for you! Let me know if you make any improvements.

This is all so fantastic, folks. My family just moved into a home with a buried propane tank, smart gauge-ready, but no transmitter. I just found and ordered a Ferrellgas-branded TM5030 (older model of the aforementioned TM6030). Confirmed with otodata and the FCC details that it does indeed broadcast BLE:

Per https://apps.fcc.gov/eas/GetApplicationAttachment.html?id=5134061
“The unit uses Bluetooth advertising to allow infield testing and diagnostics as well as enabling possible firmware upgrades. The microcontroller has an embedded 2.4GHz transceiver. The manufacturer provides the protocol stack for Bluetooth Low Energy. A PCB antenna over a ground plane is used as Bluetooth antenna.”

Obviously, my propane provider didn’t provide this TM5030 to more nor are they set up for the. Some of the above comments are confusing to me; it seems like I should be able to read BLE regardless of any service/cell connection setup, I would think? Can anyone confirm that I should be able to read BLE immediately?

Lost our tank utility unit as well and am unable to get any support from them. Very interested in what you have found as a solution. I see no data on individual sales for the Otodata unit seems it’s just for propane suppliers.

I can’t confirm or deny but think you have a good chance with it since it was probably setup by Ferrellgas. Please let us know if it works.

Any chance you can post your full YAML? Whenever I try I’m getting config errors on line 1, so I’m not sure what I’m doing wrong at this point. Complete noob and the esphome documentation really lacks.

@tinker_ha

@tinker_ha I got this working, think I had some issues with the distance of course. Were you able to get these readings into the Energy Dashboard?

I know what you mean. ESPHome docs are often not very helpful. Tell me, with max detail, what you have a problem with? Perhap I can help you out with more detail?

I did not try to incorporate this data into the Energy Dashboard because I do not think it is an accurate reading that can be translated to an accurate cost. The tank percentage value is based on a physical float sensor value that is not proportional to actual usage. This inferred usage value fluctuaces a lot during the day due to temperature and sunlight exposure. Higher temp or more sunlight gives higher pressure, higher pressure is used to infer higher percentage capacity. So none of this is useful as “actual energy cost”.

1 Like

I got it all working, my issue was finding the right spot to put my ESP32 at. My tank is out by a barn, so I put it in there. Trying a metal shed gave me issues, but the barn worked.

I’ve noticed the fluctuation too. Makes sense not to put it in the energy dashboard. I made a gauge card that has a red/yellow/green status.

I was so happy to find this article! I had tried scraping the values off the Otodata website and other tricks since I got the gauge installed last year, but after some time just gave up since it didn’t work.
So I set up an ESP32 and let it listen on BLE. And sure enough – got the messages! So I implemented the code shown above and was a happy camper for about a week. Since then, no more bluetooth messages from the gauge. It’s still updating via cellular (I can see the updates in the app).
Wondering if they rolled out new firmware that turned off BLE? Or maybe something is wrong with my gauge? Any thoughts?
(for clarity – it’s still picking up lots of other BLE traffic, so I don’t think it’s the ESP board)

May have figured it out … The BLE messages cycle between TM6030, unit sleeping, 310410.1|0|-73 and trbl:ACC (45.2).
The 310410.1 is the cell network it’s connected to. And I suspect the -73 is the RSSI for that. The TM6030 speaks for itself as does the unit sleeping.
I logged on to the Otodata portal (my supplier gave me access to just my tank), and found that the sensor is reporting a problem. Specifically with accuracy. So perhaps trbl:ACC means trouble code Accuracy. I guess the 45.2 is probably the tank level now.
I’ll wait it out a few days and see if it changes. If not, I’ll ask the propane company to come service it.

For completeness – this is my updated yaml:

esphome:
  name: ble-propane

esp32:
  board: esp32dev
  framework:
    type: arduino

wifi:
  ssid: "xxxxxxx"
  password: "xxxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "BLE-Propane Fallback Hotspot"
    password: "xxxxxxxx"

# Enable logging
logger:

ota:

esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
  on_ble_advertise:
    - mac_address: XX:XX:XX:XX:XX:XX
      then:
        - lambda: |-
            ESP_LOGD("ble_adv", "  name: %s", x.get_name().c_str());
            std::string name = x.get_name();
            if (esphome::str_startswith(name, "level:")) {
              name.erase(0,7);
              std::string value = esphome::str_until(name.c_str(), ' ');
              id(propane_level).publish_state(atof(value.c_str()));
              id(propane_sensor_ok).publish_state(true);
            }
            if (esphome::str_startswith(name, "trbl:ACC")) {
              name.erase(0,10); 
              std::string value = esphome::str_until(name.c_str(), ')');
              id(propane_level).publish_state(atof(value.c_str()));
              id(propane_sensor_ok).publish_state(false);
            }

sensor:
# To store the propane level percentage - does nothing on its own.
  - platform: template
    name: Propane Level
    id: propane_level
    unit_of_measurement: '%'

# Reports the signal strength auto magically.
  - platform: ble_rssi
    mac_address: XX:XX:XX:XX:XX:XX
    name: "Propane RSSI"

binary_sensor:
  - platform: template
    name: Propane Sensor Ok
    id: propane_sensor_ok

api:


      
4 Likes

They don’t sell them. I picked up a TM6030 on eBay. I was able to add it to the Nee-Vo app (to my surprise as I found another unit for sale with a picture of the auth code and was unable to add it). The app showed 50% for a day, but finally is showing the correct percentage.

Even without adding it to the app, it broadcasts propane percentage every 15-20 mins or so. Since my genmon controller (pi zero 2) is close to my propane tank, I figured I’d use it as to look for updates and post those to genmon and hubitat. Running sudo hcitool lescan --duplicates and sending that to a script to look for the level updates appears to work great. I’m super-happy to have a low-tech solution working.

Date: Tue  6 Dec 21:35:59 EST 2022 Level: 56.3                                  
DATA: 'generator: set_tank_data={"Tank Name": "External Tank", "Capacity": 320, "Percentage": 56.3}'                                                            
OK : Auto, Off - Ready                                                          
>OK                                                                                                                 
                                                                                
Date: Tue  6 Dec 21:42:53 EST 2022 Level: 56.1                                  
DATA: 'generator: set_tank_data={"Tank Name": "External Tank", "Capacity": 320, "Percentage": 56.1}'                                                            
OK : Auto, Off - Ready                                                          
>OK

My biggest concern is battery. Says it has a 10-15 yr battery. I took the screws out and could not easily get into it. Since it’s working, I’m not going to mess with it to break any seals. If anyone has successfully removed/opened the unit, I’d be interested in the details.

To meet code the unit are completely sealed (no ignition source). I’m sure you will be able to replace the battery, and probably reseal it, but agree you should not do it until it dies.

Awesome - thanks for the addition. Will add that to my install.