Skip to content

REST Sensor with Scan Interval Not Evaluated On YAML Reload #132427

Open
@jmason03

Description

The problem

Created multiple sensors with a very long scan interval. When I reload the YAML configuration they go into an "unknown" state.
Once the time of that scan_interval has passed, it calls the endpoint and I get a valid value for my sensor.

I would expect that when I reload the YAML it would make a call to update the endpoint regardless of the scan interval. Otherwise it looks like the sensor isn't working.

What version of Home Assistant Core has the issue?

core-2024-11.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

REST

Link to integration documentation on our website

https://www.home-assistant.io/integrations/rest

Diagnostics information

No response

Example YAML snippet

- resource_template: "RESTUrlHere"
  scan_interval: 120 #2m
  headers:
    Authorization: "Bearer XXX"
    Content-Type: "application/json"
  sensor:
    name: "Projected Price"
    value_template: "{{ value_json }}"

Anything in the logs that might be useful for us?

No response

Additional information

So in the example provided. When you reload the YAML, that sensor will show "unknown", then after 2 minutes it will update to a valid value.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions