I am trying to use Scrape to extract the percentage full water level from my rainwater harvesting tank which posts the value on tanklevels.co.uk
I have looked at other Scrape examples, but cannot work out what I should use for my Select statement. I would appreciate someone more experienced having a look at it.
appears to be the $0 value I need. Page element and code are shown in the screenshot.
try this
sensor:
- platform: scrape
resource: https://tanklevels.co.uk/dashboard
select: "div.card-stats span"
name: "Rainwater Tank Level"
unit_of_measurement: "%"
value_template: "{{ value | replace('%', '') | float }}"
state_class: "measurement"
Settings → Devices & Services->Add Integration ->Scrape
Resource: https://tanklevels.co.uk/dashboard
Select: div.card-stats span
Index: 0
({{ value | replace('%', '') | float }})
Unit of Measurement %
