Was able to get to work by fully restarting HA. I thought i simply could do the quic restart…
I switched to the new Smail Oil Duo, and it appears to be using an ESP chip. I wonder if it’s possible to get ESP Home running on it and feed data directly into HA?
Howdy all. I have the Smart Oil Duo also, and the multiscrape method I think is working for me. I’m only able to see the gallons, however, I can’t see the other attributes. I did just set it all up, but I’m wondering if I’m missing something or maybe it will just take time to show all the attribute values.
EDIT: Never mind, I’m an idiot. You have to expand the bottom of it to see the attributes.
I will ask another question, however… Is there a way to somehow see ALL the data that the multiscrape has access to? Perhaps gallons used, or per day/hr, etc?
@JSylvia007 Yeah, log into the website and in the developer tools look at the reply.
Then edit the multiscraper code from this post to add the attributes you would like:
You should be able to create this sensor yourself using the history stats integration. I use that with a power monitor on my boiler to track my daily oil use and what’s left in the tank.
This is just an update for anyone with two tanks. First, thanks to @Zalaban for this; it’s working great.
Copy the " Extract required data here" and create a second sensor. Update the it with “1” instead of “0”.
node.status({text:msg.payload.tanks[1].sensor_rt + " gal: " + msg.payload.tanks[1].sensor_gallons});
msg.payload = msg.payload.tanks[1].sensor_gallons;
return msg;
I’m guessing so, but given www.smartoilgauge.com is free after paying for the device I figured it’s easier to let them do the fun math and scrape it. If they ever charge I will be looking at ESPhome for sure.
Hi all,
I am completely new to home assistant and node-red.
Could someone post a step by step guide on how to install this?
I tried to copy the script directly in the configuration yaml through file editor and I imported the node-red flow from Zalabn but nothing happens. Not even sure if I need to do these 2 steps.
I know I am missing something so a step by step guide would be highly appreciated.
Thank you
Hi Peter,
Are you using node-red just for this? Cause in that case the multiscrape addon might be an easier way for you to achieve loading the data into HA.
Either way, for node-red and HA to work well correctly if you just installed node-red is that you need to install the homeassistant palette (node-red-contrib-home-assistant-websocket) into node-red and configure the node-red addon into homeassistant (have you done that?)
Hi Roger, I read through your blog with interest.
In the end, I managed to use the existing oil level sensor that sends on 433Mhz and use a LilyGo ESP32 received running MQTT to receive the air depth and send it to Home Assistant.
However, I am now stuck working out how to use the data in HA.
I also read your blog on https://www.rogerfrost.com/basic-arithmetic-in-home-assistant-to-calculate-how-much-heating-oil-i-need-and-when-i-need-to-order-heating-oil/
But I have become stuck, being new to HA, I am struggling to follow it through.
Its also going to have different values as mine reports air gap in cm, and your ESP32 is reporting litres.
Any suggestions on how I move forwards with creating the correct variables, converting cm air gap to litres and then producing the required statistics - would be gratefully received ![]()
If you have an entity for the air gap value in Home Assistant you can manipulate this further. The syntax for manipulating is dreadful (see ‘Template Sensors’) but what you’re doing is turning one thing into another. I’ll give an example:
Go to DEVELOPER TOOLS - TEMPLATES and you’ve a screen where you can try out your syntax.
My example: subtract today’s oil level from the oil tank capacity. Next work out how much oil I will use while waiting for the oil delivery.
{{ ((states('sensor.oil_level')|int(0) - ((states('input_number.oiltanklimit')|int(0) + states ('input_number.oilusedyesterday')|int(0) * states ('input_number.oilorderdelay')|int(0) )) ) / states ('input_number.oilusedyesterday')|int(0)) |int(0) }}
When you’re understanding the syntax go to HELPERS > CREATE HELPER > TEMPLATE > TEMPLATE FROM SENSOR. In the ‘State Template’ field enter the code, and in other fields add units as needed.
If you use ESPHome my other page shows the code I use to define the sensor units eg
**sensor:**
platform: ultrasonic
trigger_pin: GPIO15
echo_pin: GPIO16
name: "oil used"
accuracy_decimals: 0
update_interval: 60s
unit_of_measurement: "litre"
filters:
- lambda: return x * 1053;
- sliding_window_moving_average:
window_size: 20
send_every: 10
Can you point me to the device that reads 433MHz and does the MQTT magic?
Thanks Roger, will take some time to digest this.
This is one of the original threads I found, OpenMqttgateway
Then I went and bought one of these https://www.aliexpress.com/item/32872078587.html?spm=a2g0o.order_list.order_list_main.40.72151802KDWLF1
It took some time to piece things together as I found a few threads that seemed to take different approaches.
In the end I managed to flash this device with MQTT Gateway, configure it onto my Wi-Fi, and set the frequency for my Watchman Oil sensor. It seems to transmit around once an hour to the receiver in the house.
A couple of hours later and the LilyGo device was receiving the data from the Watchman and forwarding it over Wi-Fi to MQTT on HA ![]()
Just needs to be plugged into power and the unit just works.
I had originally ordered the ESP32 ultrasonic sensor and board, but when I came across this solution, which could use my existing transmitter, it seemed much less work. Plus the existing receiver is still plugged in, for a quick visual check.
I imagine that you are wanting to turn ‘air gap’ into something useful. In my tank an air gap of 1000 mm means that I must order 1050 litres of oil. Thus I multiply the air gap by 1.05.
There are people here better able to help but if you can show us what your HA shows (eg sensor.watchman.distance) we’ll be able to ‘template it’.
Thank you for the LilyGO 433MHz - openmqttgateway. This is so much better than the device I made in 2020. Anyone interested might see the Andreas Spiess youtube video on this.
Hi Zalaban,
Thank you for the reply and my apologies for my late reply.
I managed to add the gauge to home assistant in the meantime so all good.
But really appreciate all the work.
I’ve been playing around with this for the last few days and finally have a card ~90% of the way there.
Out of curiosity, does anyone have a description of what each JSON value represents? In particular, these from the “sensors” object:
l_pulse - ???
plm - ???
ulm and usg - seem to be average daily usage
ublf, rblf, nrbf - ???
Here’s my current card:
The level indicator changes color based on how much is remaining
How do you get the other values? The estimates is pretty nice.
I’m just doing math based off of the average daily usage values and the tank fill level.
How frequently does the node red code update the oil level? wondering if i need to change any settings on it in order to make it update or not.
successfully imported the code and added an entity tog et it into home assistant, but it’s been around 4 hours and i haven’t seen any updates on the entity itself.
What do you have your smart oil sensor set to in terms of update interval? You can see it under “sensor config” in the app. Node red needs to update about as frequently as that setting. Any more frequently won’t get you fresh data because the sensor isn’t pushing it up to their service.
I have been running the Smart Oil Gauge with esphome for several months now. Instructions to flash here: Smart Oil Gauge | ESPHome Devices and more detail in this reddit thread by the author: https://www.reddit.com/r/Esphome/comments/1ithq0u/flashing_esphome_onto_smart_oil_gauge/
The flash process was relatively painless; I used small alligator clips with female dupont ends connected to a CH343 to USB adapter and found that easier than using the sparkfun clips. Some of the pads needed to be masked with kapton tape to flash it with the alligator clips but no big deal.
The device works great. There are two minor issues. The first is the “blind spot” after a fill. This is a known issue and the manufacturer actually has a decent article explaining this: Tank Readings After A Fill - Smart Oil Gauge
I have a 275 vertical tank and the esphome-flashed gauge reads between 225-228 gallons after a fill, gradually drops to around 200 gallons and then shoots back up to 226-229 gallons indicating that the actual fill was close to 250 gallons which is the maximum expected fill in this kind of tank.
I would be interested in updating the code to mitigate this “blind spot.”
They have a newer model that uses dual ultrasonic sensors that has no “blind spot” however it’s unclear if it uses an ESP chip: Smart Oil Gauge Duo - Indoor Use Only - Smart Oil Gauge
The second issue is that Home Assistant still shows all the entities as unavailable when the device is in deep sleep. I have removed and re-added it countless times and this bug still persists. Because of this, I needed to create a template helper to persist this value because otherwise it’s not always available to automate against. Here’s the sensor clone code to be included in configuration.yaml:
- trigger:
- platform: state
entity_id: sensor.smart_oil_gauge_oil_in_tank
not_to:
- unknown
- unavailable
sensor:
- name: Oil in Tank Sensor Clone
unique_id: 'XXXXXXXXXXXXXXXXXXXX'
state: '{{ trigger.to_state.state }}'
device_class: volume
unit_of_measurement: 'gal'

