Sensor state based on HTTP GET and value lookup

Hello!

I’m faced with the following issue: sometimes, there are hot water outages in the city I live in, since we mostly rely on the public utility company for hot tap water. Therefore, I’ve got an electric boiler installed in my home and integrated with Home Assistant. The utility company publishes a list every day of the known current outages. However, it’s a nice, human-readable webpage, not an API endpoint.

The list contains the names of all of the streets affected by outages. I would like to initiate a HTTP(S) GET request for that webpage and then look for my street’s name on that webpage every, say, 12 hours. If it’s found, I would like to change a sensor whose value says “Available” or “Unavailable”. Afterwards, I’ll have an automation turn on my boiler etc.

However, I’m genuinely at a loss as to how I can implement such a sensor which initiates the HTTP GET and then looks for my street’s name on the webpage. The street’s name can be found in the raw HTTP data, it’s not an image or anything.

If anyone has any idea as to how I can implement that in HA, I’d be most grateful.

Thank you!
Andrei

It will take me some time to make the get query since i cannot do by memory but you will be wanting to use a get query with the Restful Sensor

This is what I’ve managed to create, but the state shows Unknown.

rest:
  - resource: "https://utilitycompany.com/webpage.php"
    scan_interval: 15
    sensor:
      - name: "Hot tapwater availability"
        value_template: "{{ regex_findall_index('MyStreetName') }}"

Obviously, I’ve anonymized the website and my street’s name. I’ve inserted the proper ones in the actual config.

You’re missing the first argument for regex_findall_index