Automations once per day

Hi,

I have googled and thought I got the answer through this forum but I seem to be missing something (sorry I’m new to this!)

I’m trying to trigger automations once per day, I’ve set up a helper (input_boolean) and have created a automation to reset (off) this every night at 12am.

In my automation for the light I have added a condition stating that the input_boolean must be off, then in the action section it will turn the input_boolean on stopping it from turning on again automatically (lights are motion activated)

I’m not sure where i’m going wrong with this but i have tried multiple times!

(all my automations are done in the configuration > automation section on HASS (Using the UI, not YAML))

Post the automation you created.

toggle reset

alias: Master Bedroom Main Light Reset
description: ''
trigger:
  - platform: time
    at: '00:00:00'
condition: []
action:
  - condition: state
    entity_id: input_boolean.mbmainlighttoggle
    state: 'off'
mode: single

light automation:

alias: Master Bedroom - Main Light Turn ON
description: ''
trigger:
  - type: motion
    platform: device
    device_id: 24a1bfb9131385dea2f798bfba9b3673
    entity_id: binary_sensor.masterbedroommotionsensor_occupancy
    domain: binary_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 0
condition:
  - condition: state
    entity_id: input_boolean.mbmainlighttoggle
    state: 'off'
action:
  - condition: state
    entity_id: input_boolean.mbmainlighttoggle
    state: 'on'
  - type: turn_on
    device_id: f364d252edc17967fda915604b441688
    entity_id: light.masterbedroommainlight
    domain: light
    brightness_pct: 80
mode: single

Your reset automation doesn’t actually reset your input_boolean, the action section of your automation:

action:
  - condition: state
    entity_id: input_boolean.mbmainlighttoggle
    state: 'off'

uses condition, which checks to see if the condition is true before it carries on through further actions (which it isn’t, so it exits the automation at this point).

If you actually want to turn off the input boolean then you need to call the service input_boolean.turn_off as below.

alias: Master Bedroom Main Light Reset
description: ''
trigger:
  - platform: time
    at: '00:00:00'
condition: []
action:
  - service: input_boolean.turn_off
    entity_id: input_boolean.mbmainlighttoggle
mode: single

What @charlyr said about the reset automation is doubly true for the light automation…

By using a Condition action instead of a Call Service, you have created an automation that will never turn on the light, because the input boolean cannot be both “on” and “off” at the same time.