Rest sensor - Advanced scanning interval setup

Hi All,

I’ve configured my first Rest sensor today, it’s working perfectly.
I’m focusing now on the scanning interval, I would like 2 things to happen:

  1. Scan the sensor when minute equal 1,16,31 or 46 (4 scans per hour at specific time) - important to me.

AND

  1. Do not scan the sensor between 22:00 and 06:00 (nice to have)

Just setting the scan_interval to 15 minutes, would not exactly do the trick.
Is that possible, and if so, how complicated is that configuration?

Cheers.

Set a really long scan interval in your sensor config (e.g. 31556952, one year in seconds). Then use this automation to update it:

triggers:
  - trigger: time_pattern
    minutes: 1
  - trigger: time_pattern
    minutes: 16
  - trigger: time_pattern
    minutes: 31
  - trigger: time_pattern
    minutes: 46
conditions:
  - condition: time
    after: "06:00:00"
    before: "22:00:00"
actions:
  - action: homeassistant.update_entity
    target:
      entity_id:
        - <your_entity_id_here>

Note: the sensor will still update once when home assistant is restarted so that the sensor is not unknown until the next update time.

WOW !
Thank you so much for the clear and detailed answer.

1 Like