@lost thanks
Many thanks to @Zalaban and @lost for posting the above node-RED solution. I’ve successfully managed to get my Smart Oil Gauge reading to my Home Assistant Dashboard!
I’ve been struggling though to then pass the info on to Homebridge in a way that Homebridge/Homekit can best represent it. I’m using the node-red-contrib-homekit-bridged node-RED Palette. Have either of you done anything similar or have any guesses as to a solution? I’m stumped! By default the Entity in your flow above is shown as an Air Quality sensor, which shows the tank reading as the Air Particulate Density value. However, this value is only available after tapping into the Air Quality sensor to see the details; it’s not visible from the parent screen, which only shows the Air Quality status in the tile. If you have any insight, please let me know. Thanks again for all the work you’ve done and shared in this thread!
Hi, I went and installed the palette to see what the options would be.
So far, the only one I could see working for you would be if you would use the temperature sensor in order the send the level as a percentage in between 0 and 100.
I haven’t been able to find any other services that would report the tank level which would be supported by Homekit.
If you do find a working solution, share it back here so we can use it as well
Arrived here looking for the sensor code to turn ‘oil level’ into ‘rate of oil use’ for the energy dashboard.
Meanwhile here’s my variation on a DIY ESPhome oil tank sensor for an (indoor and powered) oil tank sensor. It has helped me order the correct amount of oil over a few years without maintenance. Now with the price of oil I’m interested in energy metrics.
https://www.rogerfrost.com/oil-tank-level-sensor-also-water-softener-salt-level/
project: oil tank level sensor oil tank level sensor - Roger Frost's home automation projects
Hey guys,
So I have been working on a way to get data my gauge. I tried using multiscraper but it seems the page uses an ajax call to get the actual dynamic data I’m looking for. I don’t want to run another server just for red node for this one purpose. Did anyone figure out another way?
@Dragon88 here’s a working multiscrape example:
multiscrape:
- resource: 'https://app.smartoilgauge.com/ajax/main_ajax.php'
method: POST
payload: 'action=get_tanks_list&tank_id=0'
headers:
X-Requested-With : XMLHttpRequest
Content-Type : application/x-www-form-urlencoded
scan_interval: 3600
form_submit:
submit_once: False
resource: 'https://app.smartoilgauge.com/login.php'
select: ".content-container"
input:
username: [email protected]
user_pass: 'YourPassword'
sensor:
- name: smartoiltank
unique_id: smartoiltank
value_template: '{{ value_json.tanks[0].sensor_gallons }}'
unit_of_measurement: "gal"
attributes:
- name: tank_name
value_template: '{{ value_json.tanks[0].tank_name }}'
- name: last_updated_time
value_template: '{{ value_json.tanks[0].sensor_rt }}'
- name: last_updated_timestamp
value_template: '{{ value_json.tanks[0].last_read }}'
- name: battery
value_template: '{{ value_json.tanks[0].battery }}'
This worked flawlessly, thanks so much for sharing!
As a newbie, quick question for you - how do I make this sensor work with statistics in HA? I haven’t had any luck so far.
I’ll have to wait an hour or two to see once statistics are calculated, but I did find that adding the following below unit_of_measurement
allowed the sensor to show up:
sensor_class: measurement
device_class: volume
@zakaban or any one else … Do I need to have API for this code to work ?
No, you don’t. Above method uses your smart oil login to scrape the data.
While back I emailed smart oil people and asked them if they have a api for their app. They told me that it costs $2 per month for api access. So you could use their api, but you’d have to pay for it.
@ Zalaban The above worked perfectly, I cut and paste into configuration.yaml with a quick restart.
My only request is to have the “Fill %” and the “Level”. I’m vry bad at json.
This is how I did it, I use the gauge card.
If you actually want to see the percentage you could also do it with with a template jinja:
{{ (states.sensor.smartoiltank.state|float / 500 * 100) | round(1) }}
Change the 500 with the actual maximum of your tank.
I’m an absolute novice with HA, scraping, etc. Im trying to set this up and have MA installed via HACs.
I have added the following to configuration.yaml:
multiscrape: !include multiscrape.yaml
Added the lines above with my UN/PW to the Muliscrape.yaml file in same directory as configuration.yaml and received the error when restarting HA:
Cannot quick reload all YAML configurations because the configuration is not valid: Invalid config for [multiscrape]: [multiscrape] is an invalid option for [multiscrape]. Check: multiscrape->multiscrape->0->multiscrape. (See /config/configuration.yaml, line 12).
HA reloads if Multiscrape.yaml is blank. Any help would be greatly appreciated!! Thanks in advance!!
Logs Show:
[140677240650560] Cannot quick reload all YAML configurations because the configuration is not valid: Integration error: multiscraper - Integration ‘multiscraper’ not found.
11:40:51 AM – (ERROR) Home Assistant WebSocket API - message first occurred at 11:15:48 AM and shows up 17 times
The system cannot reload because the configuration is not valid: Integration error: multiscraper - Integration ‘multiscraper’ not found.
11:40:51 AM – (ERROR) Home Assistant Core Integration - message first occurred at 11:15:48 AM and shows up 17 times
You could try adding the multiscrape YAML directly into configuration.yaml rather than referencing a separate file
Thanks, I was able to add and reload without errors. Next episode of complete noob… Assuming that worked where should i be able to find the sensor. I would assume there would be a device or entity names “smartoiltank” but cannot find anything. Thanks for your help!!
Personally I get an error when trying to use multiscrape which is why I haven’t switched to using it. Have you tried enabling logging for the extension?
I did and not seeing anything in log… Ill keep playing and hoping haha
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?