20220102 - UPDATE: As of release v5.7.0, Multiscrape could be used as a RESTful sensor as well, enabling you with all the benefits like form-submit, entity pictures, icon templates, etc.
20210608 - IMPORTANT UPDATE: release 4.0.0 upgraded this component to an integration. You can now also create binary sensors, still based on a single HTTP request.
It does come with a backward-incompatible change in the configuration though. Please check the upgrade notes! I also updated the example config below.
20210520 - IMPORTANT UPDATE: I have created a new repository named ha-multiscrape for this sensor as the orginal development setup wasnât ideal. The new sensor (which is backward compatible) is now available in the default HACS store!
The new Github project can be found here: GitHub - danieldotnl/ha-multiscrape: Home Assistant custom component for scraping multiple values (from a single HTTP request) with a separate sensor for each value. Support for (login) form-submit functionality.
The old project will not be maintained anymore, so please switch!
I think this didnât yet exist (or at least I couldnât find it), so I created an improved scrape component which is able to scrape multiple values with a single HTTP request. The values become available as attributess on the sensor.
You can find the project here GitHub - danieldotnl/hass-multiscrape: Home Assistant custom component for scraping multiple values (from a single HTTP request) with a separate sensor for each value. or install from HACS (add it as a custom repository).
multiscrape:
- resource: https://www.home-assistant.io
scan_interval: 3600
sensor:
- name: Latest version
select: ".current-version > h1:nth-child(1)"
value_template: '{{ (value.split(":")[1]) }}'
- name: Release date
select: ".release-date"
binary_sensor:
- name: Latest version == 2021.6.0
select: ".current-version > h1:nth-child(1)"
value_template: '{{ (value.split(":")[1]) | trim == "2021.6.0" }}'