Scan_interval not working

When ever I try to set a scan_interval, I find that my rest template sensors, and also my latest sensor continue to automatically update every 60 seconds. For my rest sensors this is not an issue, but it is for the uk_transport integration I’m trying as it has a limit of 30 api requests per 24 hours.

I don’t see any automation doing this. Any ideas what I am doing wrong please?

sensor:
  - platform: uk_transport
    app_id: ID#####
    app_key: key#####
    scan_interval: 864000
    queries:
      - mode: bus
        origin: ############
        destination: xxxxxxxxx```

Solved by moving scan_interval directly below platform line.

That makes no difference. It’s a dictionary, all the items are loaded in unison regardless of position in the yaml. Something else caused the change.

I thought similar. It is however the only thing I directly changed.

Yes, but that literally will not affect what you wrote. It’s not a solution, I unmarked it. You most likely forgot to restart/reload when adjusting it.

Of course it is possible. However I am very clear to perform a reload or restart. Perhaps it was quick reload instead of restart and thus does not actually activate this change. I found other similar that would only change upon restart.

I will move it back and try it again.

Moving the line and restarting had no impact.

I then commented the line out and used the quick reload feature, it had no impact.

It seems therefore likely that this is related to quick reload not updating this part of the configuration.

This drove me crazy and this post is the first that actually pointed to the issue:

You need to do a full restart to have changes to the scan_interval attribute of the RESTful sensor take effect.

Just wondering - is this working ok for you now?

I’m having the same issue of the “scan interval” not preventing regular scanning and updates. I wanted to stop it updating automatically and only when I press an “update button” (using “update entity”).

I’ve got it set to 604800 so should only be updating approx once a week, with the line in the same position as you have it. But it’s still updating all the time.

I have 100% definitely done full HA restarts (not just after adding this, but for other reasons, intergrations and additions) so it’s not that.

Not sure what else to do to make it stop updating.

Every restart will cause it to update.

Hi, thanks for the reply.

Yes I understand the restart will cause it to update. I was just noting that after adding the scan interval line to the yaml, I did do a full restart.

What I want to be able to do is stop the script from updating every few minutes, as the “scan-interval: 604800” doesn’t seem to do that. Every time I navigate to the page with the train & bus times on it, they have updated. I thought adding the scan interval line in would cause them to only update once a week (not counting HA restarts of course).

Eventually, yes it was working for me, my yaml exactly - although as said doesn’t make any difference on order.

  - platform: uk_transport
    app_id:
    app_key:
    scan_interval: 86400
    queries:
      - mode: bus
        origin:
        destination:

Thanks for the reply.

Your yaml looks the same as I have it set up - i tried the scan_interval before and after the app_id and app_key


(sorry - not very good with pasting the text in so it’s just a screenshot).

Not sure what I can be doing wrong as the bus and train times still seem to update regularly. I’ll just have to keep playing around with it.

What do you mean “they have updated”? Are these time sensors?

Timestamp sensors show updates in the UI however they don’t actually update. The time essentially just counts down (or up) to a specific moment in time.

Sorry, I wasn’t very clear in my explanation.

The next train times and the next scheduled bus times - as shown in the pic of my transport page on HA.

On the Transport API website it says I am still getting 480 hits/calls on the API a day, which I want to reduce to below 30. I thought putting in the scan_interval line would do that, by stopping the yaml script for these train and bus times being updated, unless I press the button (shown on the screenshot) to trigger the update entity and get the latest bus and train times.

It seemed to work for the Op here - and my yaml seems to be the same as his - but I must be missing something.