And if not working

So I created an automation, but it’s entirely ignoring the condition, and running regardless.
Any thoughts?

alias: Motorhome Alarm Re-Enable
description: ""
trigger:
  - platform: time_pattern
    hours: "23"
condition:
  - condition: state
    entity_id: input_boolean.house_holiday_mode
    state: "off"
action:
  - service: input_boolean.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: input_boolean.motorhome_alarm
mode: single

I should note, I’ve never had an issue with conditions before, I created two automations today and both ignore the Boolean helper state.

How are you testing it?

The Run button in the expansion menu and the automation.trigger service ignore the Trigger and Condition block entirely.

1 Like

Can you please format your code correctly - it is hard to work out where the indents are.

1 Like

This is what got me… i can understand ‘run’ skipping the triggers but why would run ignore the conditions block?

Is there a correct way to manually trigger the automation to test the automatic and conditions?

IIRC, the function was added based on user request. When that function was first added, the button read “Run Actions”, then it was reduced to “Run” but the function was unchanged.

There are a number of options:

  1. If your primary goal is to test conditions, that can be done in the automation editor UI by using the “Test” function in their expansion menu.

  2. Use the Services tool to run the automation.trigger service with skip_condition set to false:

service: automation.trigger
target:
  entity_id: automation.example
data:
  skip_condition: false
  1. Add another trigger (like a State trigger based on an Input button or some other helper). Once the testing is done just delete or disable the additional trigger. (This was the way it had to be done prior to the addition of the “Run Actions” function)
1 Like