Random light control

Hi,
I am creating a very simple holiday automation for lights. Given the condition - on holiday - I will have lights coming on in the upstairs for a set period and lights coming on in the downstairs for a set period. This aspect is already resolved.

However I want to simulate toilet usage which will involve turning on and off hallway lights at roughly half an hour intervals whilst ever a condition is met. So I need a little automation or script which will run constantly whilst ever a condition is true. That scripts needs to switch the hall lights on for 5mins every half an hour +/- 10mins. There are two hall lights.
Sounds simple - but without delving into yaml programming the logic there doesn’t seem to be a way to create such an automation from the settings GUI.

Any pointers would be helpful.

You might find this interesting:

That looks useful thanks.

Its very simple in esphome with Time Component

time:
  - platform: sntp
      - seconds: 0
        minutes: /30
        hours: 
        days_of_week: 
        then:
          - light.turn_on: my_light

This seems to fit my requirements perfectly so I have implemented it and will test tonight.

1 Like