Automation aborts at AND condition and does not trigger Actions

Hi All,

I have a query around an AND condition in my automation.

I have a simple automation as below.

When my 3D printer Octoprint progress goes above 99.9.


The printing status turns to Off.

Turn off a switch and a light.

The problem here is with the AND condition. If I remove this it works fine.

Maybe in missing something obvious??

Can those two triggers ever both happen? When printing passes 99.9% by definition printing status is not yet off.

If you take out the AND the triggers become OR, and the automation will fire every time printing passes 99.9% - making the second trigger redundant, I suppose.

Triggers are always OR
If you want to AND, trigger on both and retest iboth in conditions, which are AND by default.

Also, don’t post screenshots. Post in properly formatted yaml.

It’s easier for us to help you if you post text since we can just copy/edit/paste your code.

What’s the magic word? :face_with_raised_eyebrow:

Quite inappropriate remark, imo
Besides possible language barrier (the “please” everywhere is very anglo-saxon), do we have to beg to be able help people having issues?

1 Like

Hello! From your automation screenshot, it seems you want to directly turn off your 3D Printer after the job finished. You may want to cool down the printer bed before turning it off as it can cause issues such as printer jamming.

You can take a look at this Octoprint setup by krash-

1 Like

Thanks for your replies everyone. I take your point about the screenshot.

My issue is really that I’m assuming the automation will wait for both conditions to be TRUE.

So in this case my expectation was that first it will pass 99.9% and then some time after it will turn to “Off” and hence run my actions. I live in a world of PLC control so that’s my issue I suppose. Fundamentally I didn’t understand the execution of the the automation.

Thanks for the help.

1 Like

This is really great. Thanks for sharing.

I don’t believe in magic… :wink:

Your automation has one trigger and one condition.

  1. It triggers at the moment when the value of sensor.octoprint_ender-3_v2_job_percentage increases above 99.9

  2. It immediately proceeds to check if the value of binary_sensor.octoprint_ender_3__v2_printing is off. If it is, it proceeds to execute the action, if it isn’t then the automation exits without executing the action.

The automation will not execute again until the value of sensor.octoprint_ender-3_v2_job_percentage first decreases below 99.9 then increases above it again. That’s how Numeric State Triggers work (they only trigger at the moment the value crosses the threshold).

In your case, if the binary_sensor is still on at the moment the sensor value rises above 99.9 then it exits and will not trigger no matter if the value reaches 100 or if the binary_sensor changes to off.

In addition, there’s a typo in your example. A binary_sensor’s states are lowercase on and off whereas your example specifies titlecase Off which will not match off.

1 Like