We need to see the yaml of that automation posted inside a code block </>.
And also from developer tools on that sensor when it has that specified error code.
It could be that the error code has a beautified state in the frontend, but what you actually need is something different
You didn’t press the code block button so the code is very hard to read.
But the issue is obvious for us that has used HA for a while.
Triggers trigger immediately, then it reads the condition and if that fails then everything fails untill the trigger triggers again.
It will NOT wait for a condition to be true.
So with that in mind we see that your trigger will work but fail every time on the condition since the state can’t just have turned to something new but also been csi for 10 minutes.
You need to remove the condition and make the trigger trigger on to: csi and then for: 10 minutes.
I can’t help you with correcting the code since it is not in a code block, if I copy it then it will contain characters that makes it not possible to copy back in to HA.
But I hope my explanation was good enough
This might be closer to what you want to achieve. It is what Hellis81 suggested.
alias: New automation
description: ""
triggers:
- trigger: state
entity_id: sensor.penny_litter_3_status_code
to: 'csi'
for:
minutes: 10
conditions: []
actions:
- action: switch.turn_off
metadata: {}
data: {}
target:
device_id: c7dc841f37b0c4b7e8711f64930987e1
mode: single
The automation uses a State Trigger to monitor the state of sensor.penny_litter_3_status_code. It’s looking for the sensor’s state to change tocsifrom any other value and then maintain it for at least 10 minutes. Then, and only then, it will trigger the automation.
It’s important to keep in mind that a State Trigger detects changes in an entity’s state value. The example I posted is looking for the sensor’s state to change from some other value tocsi.
That’s to be expected because it only executes the automation’s actions, it doesn’t test the automation’s triggers and conditions.
I was trying to start if When the device, instead of the entity which is why I ended up creating a When, And if and a then do statement.
Working great now.
So glad I figured this out. Now I don’t have to tell Alexa to reset the KittyLitter outlet to power cycle the Litter Robot.
Love my LR3, but this was a design flaw. And thank god for warranties. I have about 3 bases that had the same problem (cat sensor interrupt) until I figured out if I power off the unit and turn it back on that it would finish the cycle.