#Scrape: resource_template only evaluated when (re)starting HA

1 messages · Page 1 of 1 (latest)

rotund hatch
#

I have this in my configuration.yaml:

scrape: 
  - resource_template: 'https://api.omroepbrabant.nl/api/media/radio/epg/{{ now().strftime("%Y-%m-%d") }}'
    sensor:
      - name: Omroep Brabant EPG - Current title
        select: "*"

Unfortunately, the resource_template is only evaluated when creating the configuration, so I get the EPG data of the same date over and over again, until I restart HA.

Is this a bug in HA? Is there a way to work around this (except restarting the full HA every day)? Re-load a (certain) integration or resource every day at midnight??

livid gust
#

I’d say create an issue in GitHub so it can be looked at. It doesn’t seem right it’s only evaluated on startup

rotund hatch
#

Glancing at the code, it looks like the Rest component gets it right by re-evaluating the resource_template whenever the sensor is updated, but Scrape just gets the config at startup,,,