"The Scrape YAML configuration has been moved" How can I fix this?

I have two “scrape” sensors listed in my Configuration.yaml file. I just received the “The Scrape YAML configuration has been moved” warning which states to migrate the YAML configuration to the integration key according to the documentation, but doesnt provide a link to the documentation.

Can anyone provide insight as to what this warning actually means and how to go about fixing it? I would really rather not lose access to my scraped sensors.

Thanks,
Robert

I deciphered the Warning and created a couple of Scrape Integrations to update my HA. All is good.

1 Like

Can you outline what you did? I got the same warning and came looking for a solution.

thanks

1 Like

Also interested how to fix it please

So there is actually a “Scrape” integration that you can add to Home Assistant. It then lists all the items you need to fill out (copy paste from your yaml scrape setup) and it should work.

2 Likes

Now that is ironic. I initially set it up as an integration but reading elsewhere I changed it to be a sensor instead.

thanks for the pointer.

Hi!
using the ‘old style’ I had an authentication for the website in my config:

  • platform: scrape
    resource: http://192.168.1.120/status.html
    name: wechselrichter_total
    authentication: basic
    username: admin
    password: admin
    select: “script”
    index: 1
    value_template: “{{ (( value.split(‘;’)[7] ) | replace (‘var webdata_total_e = ‘,’’) |replace(‘"’, ‘’)|float(0) ) }}”
    scan_interval: 600
    unit_of_measurement: “kWh”

Using the ‘new’ format, this does not work:

scrape:

  • resource: http://192.168.1.120/status.html
    sensor:
    • name: “wechselrichter_total”
      authentication: basic
      username: admin
      password: admin
      select: “script”
      index: 1
      value_template: “{{ (( value.split(‘;’)[7] ) | replace (‘var webdata_total_e = ‘,’’) |replace(‘"’, ‘’)|float(0) ) }}”
      scan_interval: 600
      unit_of_measurement: “kWh”

Invalid config for [scrape]: [authentication] is an invalid option for [scrape]. Check: scrape->scrape->0->sensor->0->authentication. (See /config/configuration.yaml, line 71).

Can I also use authentication with the new style?
The documentation says it should work…

Ok, sorry…
sorted the attribues like this, now it seems to work:

scrape:

  • resource: http://192.168.1.120/status.html
    authentication: basic
    username: admin
    password: admin
    scan_interval: 600
    sensor:
    • name: “wechselrichter_total”
      select: “script”
      index: 1
      value_template: “{{ (( value.split(‘;’)[7] ) | replace (‘var webdata_total_e = ‘,’’) |replace(‘"’, ‘’)|float(0) ) }}”
      unit_of_measurement: “kWh”

Even though, an example with these variables would fit the documentation quite well :wink:

3 Likes