Issues moving scrape sensors configuration to Scrape integration we got with 2022.12

I noticed few issues with 2022.12 update Scrape moved to integration.

Sadly, it did not offer to move existing scrape sensors configuration so I have to do it by hand.

As I have number of scraping sensors it is tedious to do them all using web interface. Is there yaml for scrape integration I could edit. Editing yaml would be much easier? I did try to search through config directories but did not found it.

It seems documentation on Scrape is not updated. It still refers to adding scrape sensors in configuration.yaml.

Strangely, when I added Scrape resource in integration and added sensor, it did not create Scrape device. It created only entities for each sensor. Then I added another resource in integration and sensor and now configuration for all is stiffed in Integration configuration. With few more several scrape sources it would become quite crowded place.

One would expect that each resource would be added as separate device and configured as such.

Then, I noticed that I misspelled name of a sensor in resource. Automatically created id is, naturally, also misspelled. There is no option to fix name or id. It seems I have to delete sensor and add it again from scratch (did not try it, so maybe that would not work).

I can go to Entities and change name and id there but name and id in integration stays misspelled. I would like to be able to fix that in integration. Is there a way?

Note for others that are yet to do this. Comment scrape sensor configuration in configuration.yaml first. Otherwise, names would be occupied so new sensors created in integration if named the same would get suffixes.

In old scrape there was option scan_interval to set intervals for values to be scraped. In Scrape integration it seems there is no such option. How can we control frequency of scraping events in Scrape integration?

Previous history for all but one sensor is lost.

2 Likes

Hi, i also have the same problems… hope there is an “easy” solution, please keep us updated!
J

just here to ask the same questions… need a scan interval option at least

Did you read this - I think it answers most of your questions:

1 Like

Scan interval does not work. it seems as a bug. Regardles of the settings it seems fixed to 15 minute intervals or so.

In GUI, there is even no option to set scan interval.

I believe the scan_interval bug when using yaml has been fixed in 12.2
Fix scan_interval in Scrape by gjohansson-ST · Pull Request #83758 · home-assistant/core (github.com)

In the GUI you can de-select the 10 minute auto-scan and then you update via an automation at your selected time of day / interval / weekday etc. by using the homeassistant.update_entity service.

That is actually a much better way to scrape certain things, since it does not keep running (like the scan_intervall) all day/night (or weekends) when you don’t need it - therefore putting much less stress on the scraped website - and reducing the chances of getting yourself banned :slight_smile:

To be honest, I did not consider this before, but now - even when using the yaml solution - I would put a scan_interval of 24 hours (because I believe you can not disable it totally) and update my scrapes using an automation only when it really makes sense.

As this Post helped me to find my way,
here is my old and new configuration

OLD:

  • platform: scrape
    resource: ttp://10.0.something/view.shtml
    name: Temp Puffer Lager
    select: “p”
    index: 6
    value_template: ‘{{ ((value.split(" “)[0]) | replace (”,", “.”)) }}’
    unit_of_measurement: ‘°C’
    scan_interval: 10

  • platform: scrape
    resource: ttp://10.0.something/view.shtml
    name: Leistung Heizstab
    select: “p”
    index: 10
    value_template: ‘{{ ((value.split(" “)[0]) | replace (”,", “.”)) }}’
    unit_of_measurement: ‘W’
    scan_interval: 10

NEW:
scrape:

  • resource: ttp://10.0.something/view.shtml
    scan_interval: 10
    sensor:
    • name: “Temp Puffer Lager”
      select: “p”
      index: 6
      value_template: ‘{{ ((value.split(" “)[0]) | replace (”,", “.”)) }}’
      unit_of_measurement: “°C”
    • name: “Leistung Heizstab”
      select: “p”
      index: 10
      value_template: ‘{{ ((value.split(" “)[0]) | replace (”,", “.”)) }}’
      unit_of_measurement: “W”

Thank you all very much!

3 Likes