Hello, I’ve been having a frequent problem lately where the shutters wouldn’t go up even though the azimuth was outside the set value; they just stayed down. I’ve now sent the problem, along with all the traces, to Google Gemini and received the following hint. Is the assumption about the logic problem in the blueprint correct, or do you have another idea what the cause might be? I know the AI isn’t always right, but it often makes the right assumption.
Absolut! Hier ist die Übersetzung deiner Analyse, die du in der Community posten kannst:
Hello everyone,
I’m having an issue where my blinds are not opening after the conditions for shading are no longer met. I’ve been debugging this and finally captured the key traces.
My problem was visible in the history: the input_text helper would correctly update to shading: 0, but the cover itself would remain in the shading position (50%).
Thanks to Gemini’s analysis, I’ve managed to capture the exact trace that shows the failure.
The Problem Analysis (The Failing Trace)
We found the “smoking gun” in the trace from 10:02:00 AM, which was triggered by t_shading_end_execution. This is the queued job that is supposed to actually move the blind.
Here is what happened in that trace:
- The Cause: Some time before this 10:02 trace, a brief dip in brightness (e.g., a cloud) must have triggered a
t_shading_end_pending_3 trigger. This correctly queued an execution job by setting the "q" (queue) timestamp in the helper. My shading_waitingtime_end was set to 120 seconds.
- The Trigger: At 10:02:00 AM, the automation ran as scheduled, triggered by
t_shading_end_execution (because now() was now past the queued timestamp).
- The Safety Check: The automation correctly entered the “Check for shading end” branch (
action/4/choose/4). Before moving the cover, it performs a crucial safety check (at action/4/choose/4/sequence/0/if) to see if the “end” conditions are still valid.
- THE FAILURE: This safety check FAILED (
"result": false).
The reason it failed is that in the 120 seconds between the “pending” trigger (the cloud) and the “execution” trigger (this trace), the sun came back out:
- Condition
Azimuth > 210? → NO (it was 150.15).
- Condition
Brightness < 5000? → NO. The brightness was back up to 24136.3 lx.
Because all “end” conditions were false at the moment of execution, the automation correctly aborted the cover.open_cover command.
The Core Bug
Here is the logic flaw: After the automation aborted the job, it did not reset the helper state. The helper remained stuck with the "q" value, leaving it permanently in a “pending end” state (is_helper_shading_end: true).
This “frozen” state explains all the other traces I’ve seen:
- Any new
t_shading_end_pending triggers (like the one at 13:06 for azimuth) also fail, because they see a job is already queued (is_helper_shading_end: true) and their logic is only to set the queue, not execute it.
- The
t_shading_end_execution trigger might run again, but it will fail the safety check every single time as long as the sun is out, leaving the helper stuck.
The Solution
The immediate fix for me was to drastically reduce the wait time.
I changed:
shading_waitingtime_end: 120
down to:
shading_waitingtime_end: 10
This closes the gap between when the cloud is detected and when the execution runs, preventing the sun from having time to come back out and cause the safety check to fail.
Long-term, it seems the blueprint logic should be updated: The else: path for the t_shading_end_execution branch (when the safety check fails) needs to update the helper to reset the queue ("q": 0) to clear the stuck state.