Scrape sensor resource_template

Hi.

Для автоматизации получения тарифов с сайта мне необходимо динамически менять параметр resource.
Шаблоном это не предусмотрено. Когда я вношу resource_template получаю "Invalid config for [sensor.scrape]: [resource_template] is an invalid option for [sensor.scrape]. Check: sensor.scrape->resource_template. (See ?, line ?). "

To automate the receipt of tariffs from the site, I need to dynamically change the resource parameter.
The template is not provided. When I enter resource_template I get “Invalid config for [sensor.scrape]: [resource_template] is an invalid option for [sensor.scrape]. Check: sensor.scrape-> resource_template. (See?, Line?).”


  - platform: scrape
    resource_template: https://www.nesk.ru/tarify-na-elektroenergiu/fiz-lico/tarify-{{ now().year }}/
    name: tariff_single_rate_first_half_year
    select: 'td'
    index: 7
    value_template: '{{ ((value.split(" ")[1]) | replace (",", ".") | float) }}'
    unit_of_measurement: руб
    # Request every weekly
    scan_interval: 604800

Подскажите как можно решить эту задачу?

Tell me how to solve this problem?

This is not a valid field. And there’s no way to get a dynamic resource for scrape. You’ll have to use a different integration.

Yes, I know that this is not a valid parameter. The question is how to solve the problem and change the address?

You can’t with that integration. Your options are to use a different integration or write your own custom integration that can do this functionality. You can always search HACS because there may be a custom integration that does this already.

I could not find anything. I’ve been looking for the second day. Today I have little knowledge to program my integration. Is it possible to change this in future versions? IN REST it is.

Yes you can make a feature request. But you’ll have to wait for someone to develop it.

I’m new here. Where and how to do it better?

https://community.home-assistant.io/c/feature-requests

1 Like