Change refresh interval for REST sensor by demand

Hello,
I set up RESTful sensor via yaml config and set up scan interval for 30 min.
What I need is: to refresh this sensor’s state every 15 seconds for 10 minutes after some event was triggered.
Any ideas how to do this?

Never used RESTful Sensor but the documentation is not great. The very last example on the page specifies a scan_interval, but this is never listed as a valid configuration variable?! You could always test whether this variable (assuming it exists at all) supports templates, but I suspect it does not, in which case what you want probably is not possible.

If so, instead consider a template entity sensor with a RESTful Command in its actions, and set your triggers/conditions up so that you can control how often the actions run.

You can refresh a restful sensor whenever you like by calling the function “Home Assistant Core Integration: Update entity” in an automation or script and pointing it at the relevant entity. I use this to make rest calls when I want rather than a set frequency. I set the scan interval to 432000 and then use the update entity when needed.

1 Like

Thanks. I think this can help.