Turning off automation at specific time

I’ve got the following automation:

- alias: "Alarm Schedule auto off"
  trigger:
    - platform: time
      at: '06:00:00'
  action:
      service: homeassistant.turn_off
      entity_id: automation.alarm_basement

It is supposed to turn off the following automation:

- id: alarm_basement
  alias: "Alarm Basement"
  trigger:
    - platform: state
      entity_id: sensor.monoprice1_alarm_level
      to: '255'
  action:
  - service: notify.notifier_xmpp
    data_template:
      message: "Motion Alarm Basement {{ states('sensor.date__time') }}"

But it is doing nothing, the automation.alarm_basement is on all the time

try automation.turn_off

Also instead of having an automation to turn the automation on and off… just have a condition with the times you would want it “on” instead … less automations… less to go wrong

sounds nice, do you have an example ?

Here, this automation is so I get an alert when my side door is opened between 8PM and 9AM…just apply that condition to your automation and then leave it on all the time.

- alias: Side Door Alert
  trigger:
  - entity_id: binary_sensor.side_door_opened
    for:
      seconds: 3
    from: 'off'
    platform: state
    to: 'on'
  condition:
  - after: '20:00'
    before: '9:00'
    condition: time
  action:
  - alias: sidedooralert
    data:
      message: Side Door Opened
    service: notify.ios_briansiphone
1 Like

looks like your indenting is off for the action… but who can tell because you have not bothered to format your code.