Announcement

Collapse
No announcement yet.

Need help web scraping for Smart Oil tank sensor

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need help web scraping for Smart Oil tank sensor

    I am hoping someone can help me scrape the Smart Oil website so I can get grab my oil tank sensor data and eventually get into HS4. I love the sensor it is very reliable.

    I am running on Windows 10 and I have been hunting for this solution for quite a while but not many folks are working on it. Pete has helped me in the past with python script on RPi but I could never get it to work as I am not fluent in that area either. Smart Oil has a paid API but I'm a too cheap hobbyist for it and woudl need you guys to help me get it to work anyway.

    A google search turns up that Home Assistant gurus have a solution that works using Multiscrape? I assume it is a HA add-on etc.

    Can anyone help me cobble together a script with the following details that work for HA guys as a HTTP POST using curl, Jon00's web scraper, or VB.NET script? I would really appreciate it!

    The link to the HA discussion is here https://community.home-assistant.io/...ensor/511132/8

    Their scrape info is the following:

    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: your@email.com
    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 }}'

    Thanks for looking and I appreciate any help!‚Äč
Working...
X