Performance sucker? Automations every 10 minutes

Hi All! Back again with a potentially silly question.

I have roughly 30 automations in my HA instance and it’s been amazing to tinker and watch the results of a smart home.

I started with the motion light sensors and what not, but I now have moved into creating automations to turn off entire areas when no motion is detected as any time from my motions sensors for 3.5 hours, it turns off the lights in that area.

Here is an example of one

alias: Anytime Downstairs No Motion 3.5 Off
description: ""
trigger:
  - platform: time_pattern
    seconds: "15"
    minutes: "10"
condition:
  - type: is_no_motion
    condition: device
    device_id: 151444c26e315cb612df595f0a3c514f
    entity_id: binary_sensor.downstairs_ring_motion_detectors
    domain: binary_sensor
    for:
      hours: 3
      minutes: 30
      seconds: 0
  - condition: and
    conditions:
      - type: is_no_motion
        condition: device
        device_id: 2014fcbaf02014dd112ca08b37e78a1c
        entity_id: binary_sensor.kitchen_motion_sensor
        domain: binary_sensor
        for:
          hours: 3
          minutes: 30
          seconds: 0
action:
  - service: script.downstairs_all_turn_off
    data: {}
mode: single

so now that I’ve set the scene here is where I need help (I think, feel free to tell me more!)

First, it feels like this is a silly way to do what I’m looking to accomplish (different levels of motion sensor lights for different times). I’m not a developer or technical past a hobbyist and my research hasn’t turned up much for this specific use case. Is this the best way to do this?

Second, let’s assume it is the best way to do this, does the number of times that this automation (and others like it for other areas) runs a “check” drain my HA performance? I’ve noticed slightly slower responsiveness when I’m editing my dashboards on my laptop recently and I’m trying to figure out what to attribute it to. Add ons? The number of automations? HACS integrations?

I run my instance on a RP4 with a kingston 100GB SSD and it’s consistently running at about 47% memory usage, 10% disc usage, 9% processor usage,

Thanks for any help in advance and apologies for being an amateur

3.5 hours? Why?

1 Like

You can just use no motion for 3.5 hours as the trigger, no need to check like you are and then look for how long.

3 Likes

This is a great tip.

However, since I have two sensors on this area, would putting both in the trigger get me the result I’m looking for? Or would I have to add that as a condition and make a parallel automation for the other sensor?

alias: Anytime Downstairs No Motion 3.5 Off
description: ""
trigger:
  - type: no_motion
    platform: device
    device_id: 151444c26e315cb612df595f0a3c514f
    entity_id: binary_sensor.downstairs_ring_motion_detectors
    domain: binary_sensor
    for:
      hours: 3
      minutes: 30
      seconds: 0
  - type: no_motion
    platform: device
    device_id: 2014fcbaf02014dd112ca08b37e78a1c
    entity_id: binary_sensor.kitchen_motion_sensor
    domain: binary_sensor
    for:
      hours: 3
      minutes: 30
      seconds: 0
condition: []
action:
  - service: script.downstairs_all_turn_off
    data: {}
mode: single