Stop closing blinds if the door is open

Hello together,
my blinds have a stupid sensor control from the beginning. With sun coming they are closing and with wind coming they are opening.
I want the blinds stop closing and then open again when the door is open.
I have installed a fibaro roller shutter 3 for the relevant blinds and also a fibaro door window sensor for the relevant door.
My automatisation is like:
if the blind is closing and also if the door is open then open the blinds.
The automatisation is not working, can anyone please help me?
image

EDIT: i think the problem is that the fibaro rs3 is not involved when the the “stupid” sensor ist closing the shutter because of the sun. I also tried it not with the “state to closing” but with the sensor for electric consumption. But the electric consumption from the rs3 is always zero. So i have no further idea how to solve this “little” problem…

Thanks in advance!

hello!

if you would please, when you post code, please use the proper formatting and not screenshots. it makes it easier for us to copy/paste to tweak your code.

here’s info on how to do that:

regarding your question, right now your automation is triggering only when your roller shades starts closing. meaning they are in the process of closing. it will not trigger when it is closed. also it will not trigger if the door is opened while it is closing.

to state it another way, your current automation asks to trigger when the shades starts closing if the door is already open. is that what you want?

if, for example, you want it to trigger when you open the door if the blinds are closed (and closing? or at least closed), then you should set your trigger to be on teh door sensor becoming “on”, and set the condition to be the blinds being closed (maybe closed or closing?). which is the flip of what you currently have.

i or someone else can adjust your code for you if you use the proper text formatting that the link above instructs.

Hello,
thank you for your answer.
The goal is that the roller shades should not close when the door is open.
If you or someone else can edit my code it would be great!
Here’s the code:

trigger:
  - platform: state
    entity_id:
      - cover.roller_shutter_3
    to: closing
condition:
  - condition: state
    entity_id: binary_sensor.fibaro_door_window_sensor_2_window_door_is_open
    state: "on"
action:
  - device_id: fb97435d11b8613a66a501958c7503dc
    domain: cover
    entity_id: ee8b155ae309283fac2e887da5ef7ba5
    type: open
mode: single

ah. if what you want is to intercept the closing of the shade if the door is already open, then this code looks close to correct.

this code looks like the shade will start closing, then it will get a command to open it… so it should start and stop.

if it’s not working, then the next thing i’d do is to look at the trace and see what happened when the code tried to run.

to do this, go to the page for this automation, go to the upper right and hit “traces”
grab the last time this tried to run but failed, then hit the upper right 3 dots and pick “download trace” and post the file that you downloaded.

I also tried it this way but it doesn’t work again.
When i check the log for the cover entity there’s no action in the changelog after m “stupid” sensor starts closing the shades because of the sun. I really think that the rs3 which is connected behind the manual switch and the engine of the shades doesn’t know it, when the other “stupid” sensor gives signals to the shade.
Here’s the code of the second try…

trigger:
  - platform: state
    entity_id:
      - binary_sensor.fibaro_door_window_sensor_2_window_door_is_open
    to: "on"
condition:
  - condition: state
    entity_id: cover.roller_shutter_3
    state: closing
action:
  - device_id: fb97435d11b8613a66a501958c7503dc
    domain: cover
    entity_id: ee8b155ae309283fac2e887da5ef7ba5
    type: open
mode: single

Thanks again for your next hint!
problem ist that the automatisation never tried to start and then failed. If i look at the automatisation and the time it last runs, haos says “never”.
In the traces i only found one entry and i guess it was from a time when my automatisation trigger was wrong. But here is the the text from this file (i can’t upload this file or i am to stupid for it…)

{
  "trace": {
    "last_step": "condition/0/entity_id/0",
    "run_id": "4601c7042196a032ddb17090227c46b6",
    "state": "stopped",
    "script_execution": "failed_conditions",
    "timestamp": {
      "start": "2024-06-22T13:30:45.698005+00:00",
      "finish": "2024-06-22T13:30:45.698077+00:00"
    },
    "domain": "automation",
    "item_id": "1719062429927",
    "trigger": "state of cover.roller_shutter_3",
    "trace": {
      "trigger/0": [
        {
          "path": "trigger/0",
          "timestamp": "2024-06-22T13:30:45.698024+00:00",
          "changed_variables": {
            "this": {
              "entity_id": "automation.raffstore_offen_bei_terrassentur_offen",
              "state": "on",
              "attributes": {
                "id": "1719062429927",
                "last_triggered": null,
                "mode": "single",
                "current": 0,
                "friendly_name": "Raffstore offen bei TerrassentĂĽr offen"
              },
              "last_changed": "2024-06-22T13:29:47.537613+00:00",
              "last_reported": "2024-06-22T13:29:47.537613+00:00",
              "last_updated": "2024-06-22T13:29:47.537613+00:00",
              "context": {
                "id": "01J10270RHG6EN9J8RJCJTNNCA",
                "parent_id": null,
                "user_id": null
              }
            },
            "trigger": {
              "id": "0",
              "idx": "0",
              "alias": null,
              "platform": "state",
              "entity_id": "cover.roller_shutter_3",
              "from_state": {
                "entity_id": "cover.roller_shutter_3",
                "state": "closed",
                "attributes": {
                  "current_position": 0,
                  "current_tilt_position": 0,
                  "device_class": "shutter",
                  "friendly_name": "Roller Shutter 3 ",
                  "supported_features": 191
                },
                "last_changed": "2024-06-22T13:30:38.796286+00:00",
                "last_reported": "2024-06-22T13:30:45.697716+00:00",
                "last_updated": "2024-06-22T13:30:38.796286+00:00",
                "context": {
                  "id": "01J1028JTC6HWDD0FSY45W58PN",
                  "parent_id": null,
                  "user_id": null
                }
              },
              "to_state": {
                "entity_id": "cover.roller_shutter_3",
                "state": "open",
                "attributes": {
                  "current_position": 100,
                  "current_tilt_position": 0,
                  "device_class": "shutter",
                  "friendly_name": "Roller Shutter 3 ",
                  "supported_features": 191
                },
                "last_changed": "2024-06-22T13:30:45.697947+00:00",
                "last_reported": "2024-06-22T13:30:45.697947+00:00",
                "last_updated": "2024-06-22T13:30:45.697947+00:00",
                "context": {
                  "id": "01J1028SJ13YRVW0501MJQPP78",
                  "parent_id": null,
                  "user_id": null
                }
              },
              "for": null,
              "attribute": "current_position",
              "description": "state of cover.roller_shutter_3"
            }
          }
        }
      ],
      "condition/0": [
        {
          "path": "condition/0",
          "timestamp": "2024-06-22T13:30:45.698040+00:00",
          "result": {
            "result": false
          }
        }
      ],
      "condition/0/entity_id/0": [
        {
          "path": "condition/0/entity_id/0",
          "timestamp": "2024-06-22T13:30:45.698054+00:00",
          "result": {
            "result": false,
            "state": "on",
            "wanted_state": ""
          }
        }
      ]
    },
    "config": {
      "id": "1719062429927",
      "alias": "Raffstore offen bei TerrassentĂĽr offen",
      "description": "Verhindert das sensorgesteuerte SchlieĂźen des Raffstores an der TerrassentĂĽr, wenn diese offen ist.",
      "trigger": [
        {
          "platform": "state",
          "entity_id": [
            "cover.roller_shutter_3"
          ],
          "attribute": "current_position"
        }
      ],
      "condition": [
        {
          "condition": "state",
          "entity_id": "binary_sensor.fibaro_door_window_sensor_2_window_door_is_open",
          "state": ""
        }
      ],
      "action": [
        {
          "device_id": "fb97435d11b8613a66a501958c7503dc",
          "domain": "cover",
          "entity_id": "ee8b155ae309283fac2e887da5ef7ba5",
          "type": "open"
        }
      ],
      "mode": "single"
    },
    "blueprint_inputs": null,
    "context": {
      "id": "01J1028SJ10BR5T0XJ0KAQ6NDG",
      "parent_id": "01J1028SJ13YRVW0501MJQPP78",
      "user_id": null
    }
  },
  "logbookEntries": []
}

thanks for posting the trace. something doesn’t quite make sense to me. what was the code that you had when running this trace?

in this trace what i see is that the condition failed and that’s why it didn’t run the action.

you can see that here:


      "condition/0/entity_id/0": [
        {
          "path": "condition/0/entity_id/0",
          "timestamp": "2024-06-22T13:30:45.698054+00:00",
          "result": {
            "result": false,
            "state": "on",
            "wanted_state": ""
          }
        }
      ]

however it says the “wanted” state is “”. but the code you posted you have the state: “on” as the condition. so it indicates to me that this trace is not for the code you had above.

could you try this and tell me what happens:

trigger:
  - platform: state
    entity_id:
      - cover.rolling_shutter_3
    from: open
condition:
  - condition: state
    entity_id: binary_sensor.fibaro_door_window_sensor_2_window_door_is_open
    state: "on"
action:
  - service: cover.open_cover
    target:
      entity_id: cover.rolling_shutter_3
mode: single

and if that doesn’t work, grab the trace for this (verify the time stamp) and post it.

this was my first try and the code was totally wrong i guess.
The code i had was was this i think:

trigger:
  - platform: state
    entity_id:
      - cover.roller_shutter_3
    attribute: current_position
condition:
  - condition: state
    entity_id: binary_sensor.fibaro_door_window_sensor_2_window_door_is_open
    state: ""
action:
  - device_id: fb97435d11b8613a66a501958c7503dc
    domain: cover
    entity_id: ee8b155ae309283fac2e887da5ef7ba5
    type: open
mode: single

ok, that code looks like it matches what the trace said.

try the code i posted. note that i just did an edit removing the device id in the action block. so grab the latest please.

oh, something else i just noticed in the trace. it went from “closed” to “open”

so that old trace triggered on the open action, not close action.

and the fact that it went from closed to open (and never was “opening”) might mean that your device does not have a “closing” state. it only has “open” and “closed”. is that possible? have you actually seen it have “closing” ?

when i create the automatisation in the visual mode and choose the entity i have different states to choose from:
closed, closing, open, opening, not available
so i gues the device has the state “closing” right?

No i changed my code to the one you have posted. And a few seconds ago my “stupid” sensor (which is not working with home assistant or is smart in any way) again starts to close the shades because of the sun. My door is open and the door sensor also has the state “open”. The automatisation was not triggered. In haos it says last time run “never”… I’m really thankful for your help but at the moment i believe that the fibaro roller shutter doesn’t notice that the engine of the shades are closing it because of the signal from this “stupid” wheater sensor. hmm…

i also checked the log of the entity “cover.roller_shutter3” and there are no changings in it. The last change to see in it was when i push the virtual button in haos to close it. Even when i use the manual switch (where the fibaro rs3 is directly connected to) this creates no action in the changelog and history of this entity.
On the other side there are two entrys from yesterday which says “was opening” and i’m sure i only uses the manual switch yesterday and dind’t control ist from haos. Hmm… i don’t understand whats wrong…

well… kinda. home assistant covers (blinds) support those states. but that doesn’t mean that your device will properly report those states.

sounds like you may have already done this, but…go to the history (menu left side) choose that cover and look at the history of the states it reports. does it actually show closing ever?

if it never ever has a state of “closing” then that’s the core problem.

we can try to work around it if, when it is closing, some other property of it (maybe one of it’s attributes?) changes. check first and see if you are convinced that “closing” won’t work. if that’s true, then we can try working around it… but that becomes a little trial and error and really cumbersome to do over this forum messages, but i’m happy to try if you want.

Your automatisation is working in general. Now when the door is open and i try to close the shades by manual switch or by the switch in haos the shade starts to close and a very fast stops and open again. So this is totally correct.
For me this means once more that the sginal for closing from the “stupid” wheater sensor is working without the fibaro rs3 notices it.

ah, cool… lucky guess of mine then!

yes, since this is triggering after the blinds receive the close command, it will try to close briefly then open back up.

if you have control over all the places that instructs it to close, and if all the physical/manual buttons to close go through home assistant, then you may be able to trap that call before it actually tries to close. if the physical button goes straight to your blinds without going to home assistant, then it’ll be harder to prevent it from briefly trying to close before the automation kicks in and opens it back up.

ok in the changelog i can only see two states “open” and “close”. So you are right. theres nothing in beetween like “opening” or “closing”.
I’m willing to get this automatisation working so if you want to help, it would be great!

I think not all switches which controls the blinds go trough home assistant. I guess the signals from this “stupid” wheater sensor are going directly to the shutter.
at the moment i’m waiting for this stupid sensor closing the blind. after that i will check which state the cover entity has. If it still will state “open” i guess this would be the unwanted proof, that there will not be solution or do think there’s a way even if home assistant is not knowing that the blinds are closed - i have to wait for the sun to come out behind the clouds…

if my code above is working (except for the brief attempt to close) and if the manual button goes straight to your blinds… then i think that’s the best we may be able to do.

if the manual button goes to home assistant first and it’s home assistant that’s instructing the blinds to close, then we should be able to do better.

how could i see/check if the command from the manual button is going to home assistant and then it’s home assistans which is instructing the blinds to close/open?
The fibaro rs3 is connected to the manual shutter via cable of course and via z-wave stick to home assistant.

if you turn off home assistant (litterally power it off) does the button still control the blinds?