Roller shutter automation with variables

Hi all,
at the moment I am trying to implement my roller shutter automation in Node-Red. The roller shutter are closing at night automatically and open in the morning - everything like expected. Now I also want to Implement the following thing:
1.) If the door is opened while the roller shutter would close at night the roller shutter stays open until I close the door/window.
2.) If the rollershutter is closed and I open the window it should automatically open the rollershutter and after i close the window it should automatically close it again (but only if it was closed before I open the door/window).

I already tried it by storeing the state of the door and rollershutter in two variables (Bürobalkontür_war_geöffnet and Bürorollladen_war_geschlossen).

The function block 'Bürobalkontür_war_geöffnet_true' has the following code inside:

var Bürobalkontür_war_geöffnet=flow.get('Bürobalkontür_war_geöffnet')|| 0 ;
Bürobalkontür_war_geöffnet == 1;
flow.set('Bürobalkontür_war_geöffnet',Bürobalkontür_war_geöffnet);
return msg;

The function block 'Bürobalkontür_war_geöffnet_false' has the following code inside:

var Bürobalkontür_war_geöffnet=flow.get('Bürobalkontür_war_geöffnet')|| 0; 
Bürobalkontür_war_geöffnet == 0;
flow.set('Bürobalkontür_war_geöffnet',Bürobalkontür_war_geöffnet);
return msg;

The function block 'Bürorollladen_war_geschlossen_false' has the following code inside:

var Bürorollladen_war_geschlossen=flow.get('Bürorollladen_war_geschlossen')|| 0; ;
Bürorollladen_war_geschlossen ==0;
flow.set('Bürorollladen_war_geschlossen',Bürorollladen_war_geschlossen);
return msg;

The function block 'Bürorollladen_war_geschlossen_true' has the following code inside:

var Bürorollladen_war_geschlossen=flow.get('Bürorollladen_war_geschlossen')|| 0; 
Bürorollladen_war_geschlossen == 1;
flow.set('Bürorollladen_war_geschlossen',Bürorollladen_war_geschlossen);
return msg;

It seems that the variables do not work like expected because the flow is not working (the roller shutter stays closed when I open the door (and the state changes in node red).

Any Idea how I can solve this? and maybe there is an easier solution for my problem?

Thanks!

BR

Hi,

I am not sure I am going to be much help, but just to maybe get things moving.....

The shutters open/close automatically each day at given times.

I'm not having a go at your English - mine isn't the best.
But that is confusing.

I'll put my understanding here to maybe help clear things.

  1. It is day time and the shutters are open.
    You don't want them to close THIS evening.
    But tomorrow you want them to close as usual. Correct?
    Re-reading I don't think I got it quite right.
    Re-take: (After writing 2 and rethinking what you wrote)
    The shutters are open. (not really declared)
    You open the door.
    The time to close the shutter happens - and the door is still open.
    The shutter stays open until that door is closed, then the shutter closes.
    Better?

  2. (This is complicated to read)
    The shutter is closed/down.
    You open the window (or door? - confused).
    The shutter opens.
    If you close the window BEFORE the time when the shutter is commanded to open: the shutter closes again.

Let's deal with the first one - as per the second attempt.

I don't have the nodes you use and so my application may affect how I am doing this.

(Oh. I am going to have to write some code. I'll post it soon, but I'll post this now to maybe give you some comfort that you aren't being left out of anyone's thoughts)

Ok, not quite as easy... :frowning: :wink:

You need to explain ALL the possibilities.
Here's an example:

If SCHEDULE is set to CLOSED
You open the door.
What happens?
The shutters open - given.
You close the door.
The shutters close - given.
What happens if the SCHEDULE tells the shutters to open WHILE the door is open?
I'm guessing: DO NOTHING.

So, you could get away with this simple bit of code:

[{"id":"82324ff20bdfdc94","type":"inject","z":"437e4108076e5928","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"open","payloadType":"str","x":110,"y":140,"wires":[["e5b4d7ec9befeac3"]]},{"id":"a0ad44755707f0f6","type":"inject","z":"437e4108076e5928","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"close","payloadType":"str","x":110,"y":180,"wires":[["e5b4d7ec9befeac3"]]},{"id":"c652b66e1f56de66","type":"comment","z":"437e4108076e5928","name":"Schedule events","info":"","x":110,"y":100,"wires":[]},{"id":"c30d602a86ab0941","type":"comment","z":"437e4108076e5928","name":"Door/window events","info":"","x":460,"y":100,"wires":[]},{"id":"fe3d23a714e1ab8f","type":"inject","z":"437e4108076e5928","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual open","payloadType":"str","x":450,"y":140,"wires":[["cc73178632547800"]]},{"id":"408a06150c86b8fd","type":"inject","z":"437e4108076e5928","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual close","payloadType":"str","x":450,"y":180,"wires":[["cc73178632547800"]]},{"id":"55b36948f3c43260","type":"change","z":"437e4108076e5928","name":"set flow","rules":[{"t":"set","p":"shutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":200,"wires":[[]]},{"id":"e5b4d7ec9befeac3","type":"template","z":"437e4108076e5928","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"schedule{{payload}}","output":"str","x":250,"y":160,"wires":[["55b36948f3c43260"]]},{"id":"cc73178632547800","type":"function","z":"437e4108076e5928","name":"","func":"var schedule = flow.get(\"shutters\");\n\nif (schedule == \"scheduleclose\")\n{\n    if (msg.payload == \"manual open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"manual close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":610,"y":160,"wires":[["6f80ba464fd59c43"]]},{"id":"6f80ba464fd59c43","type":"debug","z":"437e4108076e5928","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":160,"wires":[]}]

Given you will have to adapt the message to what you are getting from your nodes.

Oh, I gave the commands those names only to show you who is sending the command/s.

In reality they don't need to be different.

I haven't done anything with your first example as I am still not clear what you mean.

Ok, third attempt.

This may work for all your possibilities.

Again:

I don't have/use those nodes, but this may be a way to help you see how to do it.

The "new day" is needed to clear things to make them work.

Side note:
I send message for all instances to show you what is going on.
In reality you would filter those messages you don't need - the ABORTED one in particular.

[{"id":"82324ff20bdfdc94","type":"inject","z":"437e4108076e5928","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule open","payloadType":"str","x":110,"y":140,"wires":[["35c4651e913e555b","f73cd157096fc7f8","12b465e8c38e06cb"]]},{"id":"a0ad44755707f0f6","type":"inject","z":"437e4108076e5928","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule close","payloadType":"str","x":110,"y":180,"wires":[["35c4651e913e555b","8d0c89d270ea29b5"]]},{"id":"c652b66e1f56de66","type":"comment","z":"437e4108076e5928","name":"Schedule events","info":"","x":110,"y":100,"wires":[]},{"id":"c30d602a86ab0941","type":"comment","z":"437e4108076e5928","name":"Door/window events","info":"","x":610,"y":100,"wires":[]},{"id":"fe3d23a714e1ab8f","type":"inject","z":"437e4108076e5928","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual open","payloadType":"str","x":600,"y":140,"wires":[["cc73178632547800","d14fc4c984a30213"]]},{"id":"408a06150c86b8fd","type":"inject","z":"437e4108076e5928","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual close","payloadType":"str","x":600,"y":180,"wires":[["cc73178632547800","1a1154377ef53e7d"]]},{"id":"55b36948f3c43260","type":"change","z":"437e4108076e5928","name":"set flow","rules":[{"t":"set","p":"scheduleshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":220,"wires":[[]]},{"id":"cc73178632547800","type":"function","z":"437e4108076e5928","name":"","func":"var stored = flow.get(\"scheduleshutters\");\n\nif (stored == \"close\")\n{\n    if (msg.payload == \"manual open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"manual close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":760,"y":290,"wires":[["6f80ba464fd59c43"]]},{"id":"6f80ba464fd59c43","type":"debug","z":"437e4108076e5928","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":950,"y":290,"wires":[]},{"id":"de1dea39a9c0260b","type":"change","z":"437e4108076e5928","name":"set flow","rules":[{"t":"set","p":"manualshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":220,"wires":[[]]},{"id":"35c4651e913e555b","type":"function","z":"437e4108076e5928","name":"","func":"var stored = flow.get(\"manualshutters\");\n\nif (stored == \"open\")\n{\n    if (msg.payload == \"schedule open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"schedule close\")\n    {\n        msg.payload = \"ABORTED\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":290,"y":290,"wires":[["9066c0d6edf97814"]]},{"id":"9066c0d6edf97814","type":"debug","z":"437e4108076e5928","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":470,"y":290,"wires":[]},{"id":"f73cd157096fc7f8","type":"change","z":"437e4108076e5928","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":140,"wires":[["55b36948f3c43260"]]},{"id":"8d0c89d270ea29b5","type":"change","z":"437e4108076e5928","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":180,"wires":[["55b36948f3c43260"]]},{"id":"d14fc4c984a30213","type":"change","z":"437e4108076e5928","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":140,"wires":[["de1dea39a9c0260b"]]},{"id":"1a1154377ef53e7d","type":"change","z":"437e4108076e5928","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":180,"wires":[["de1dea39a9c0260b"]]},{"id":"12b465e8c38e06cb","type":"change","z":"437e4108076e5928","name":"","rules":[{"t":"delete","p":"manualshutters","pt":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":40,"wires":[[]]}]

Hope that helps.

Just to start, the code you presented does for sure look "not working". It is impossible to guess what your code should look like, you better share your complete flow and specifiy the non-standard nodes you are using to have a better chance to get some help on this

Hi all,
first thanks for your support! I am very new to Node-Red and still learning a lot each day :wink:

First here is the complete flow I posted in the first post for one door and roller shutter. I would suggest to only look at this combination first because it will be the same for all the other windows/doors I have in my flat. :slight_smile:

flows (3).json (18.7 KB)

Furthermore I think i have to explain the cases more that you understand it better (sorry for this - I will try my best to make it understandable for you :+1: )

1.) The cover of the door should close at sunset.
2.) The cover of the door should open at sunrise.
3.) If the door is open while #1 get triggered the cover should stay open until the door gets closed. Then the cover should close also. (e.g. I open the door and go out to the balkony. While I am outside the #1 automation gets triggered so I would get looked out at my balkony. Because of #3 the cover should get closed again when I am in my flat and closed the door and not directly at sunset)
4.) If the cover and door is closed and I open the door, the cover should automatically open. After I close the door again it should close the cover again. (This should only work when the cover was closed while the door gets opened) (e.g.: The cover and door is closed and I want to go out to the balkony. At the moment I have to open the cover manually and then I can go out. With #4 I want that if the cover and door is closed and I open the door that the cover automatically opens until I close the door again. When I go in again and close the door the cover should close automatically again that I do not have to close the cover manually after I close the door.)

#1 and #2 are already working in my flow. With #3 and #4 I have problems (due to my lack of knownledge with Node-Red :grimacing: )

Hope you all understand it better now.

Thanks in advance!

BR

I think that is what my code does - pretty well.

There is a slight problem though. The "reset" (change node at the top) should be from the ....

Here's the revised flow.

[{"id":"82324ff20bdfdc94","type":"inject","z":"437e4108076e5928","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule open","payloadType":"str","x":110,"y":140,"wires":[["35c4651e913e555b","f73cd157096fc7f8"]]},{"id":"a0ad44755707f0f6","type":"inject","z":"437e4108076e5928","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule close","payloadType":"str","x":110,"y":180,"wires":[["35c4651e913e555b","8d0c89d270ea29b5"]]},{"id":"c652b66e1f56de66","type":"comment","z":"437e4108076e5928","name":"Schedule events","info":"","x":110,"y":100,"wires":[]},{"id":"c30d602a86ab0941","type":"comment","z":"437e4108076e5928","name":"Door/window events","info":"","x":610,"y":100,"wires":[]},{"id":"fe3d23a714e1ab8f","type":"inject","z":"437e4108076e5928","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual open","payloadType":"str","x":600,"y":140,"wires":[["cc73178632547800","d14fc4c984a30213"]]},{"id":"408a06150c86b8fd","type":"inject","z":"437e4108076e5928","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual close","payloadType":"str","x":600,"y":180,"wires":[["cc73178632547800","1a1154377ef53e7d","12b465e8c38e06cb"]]},{"id":"55b36948f3c43260","type":"change","z":"437e4108076e5928","name":"set flow","rules":[{"t":"set","p":"scheduleshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":220,"wires":[[]]},{"id":"cc73178632547800","type":"function","z":"437e4108076e5928","name":"","func":"var stored = flow.get(\"scheduleshutters\");\n\nif (stored == \"close\")\n{\n    if (msg.payload == \"manual open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"manual close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":760,"y":290,"wires":[["6f80ba464fd59c43"]]},{"id":"de1dea39a9c0260b","type":"change","z":"437e4108076e5928","name":"set flow","rules":[{"t":"set","p":"manualshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":220,"wires":[[]]},{"id":"35c4651e913e555b","type":"function","z":"437e4108076e5928","name":"","func":"var stored = flow.get(\"manualshutters\");\n\nif (stored == \"open\")\n{\n    if (msg.payload == \"schedule open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"schedule close\")\n    {\n        msg.payload = \"ABORTED\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":290,"y":290,"wires":[["9066c0d6edf97814"]]},{"id":"9066c0d6edf97814","type":"debug","z":"437e4108076e5928","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":470,"y":290,"wires":[]},{"id":"f73cd157096fc7f8","type":"change","z":"437e4108076e5928","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":140,"wires":[["55b36948f3c43260"]]},{"id":"8d0c89d270ea29b5","type":"change","z":"437e4108076e5928","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":180,"wires":[["55b36948f3c43260"]]},{"id":"d14fc4c984a30213","type":"change","z":"437e4108076e5928","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":140,"wires":[["de1dea39a9c0260b"]]},{"id":"1a1154377ef53e7d","type":"change","z":"437e4108076e5928","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":180,"wires":[["de1dea39a9c0260b"]]},{"id":"12b465e8c38e06cb","type":"change","z":"437e4108076e5928","name":"","rules":[{"t":"delete","p":"manualshutters","pt":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":40,"wires":[[]]},{"id":"6f80ba464fd59c43","type":"debug","z":"437e4108076e5928","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":950,"y":290,"wires":[]}]

The problem with the first one I posted is that if the door is left open things can get nasty.

This new one should fix that problem.

Hi Thanks for your support. Hope all of you had a god start into 2022 :slight_smile:

Today I had some time for testing different things regarding Node Red and my roller shutter automation. I adjusted your code to my system ad gave it a try.

[{"id":"7bb54802fe15737a","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"c652b66e1f56de66","type":"comment","z":"7bb54802fe15737a","name":"Schedule events","info":"","x":1020,"y":480,"wires":[]},{"id":"c30d602a86ab0941","type":"comment","z":"7bb54802fe15737a","name":"Door/window events","info":"","x":1190,"y":180,"wires":[]},{"id":"cc73178632547800","type":"function","z":"7bb54802fe15737a","name":"","func":"var stored = flow.get(\"scheduleshutters\");\n\nif (stored == \"close\")\n{\n    if (msg.payload == \"manual open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"manual close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1260,"y":420,"wires":[["6f80ba464fd59c43","7f4099c47868fa17"]]},{"id":"35c4651e913e555b","type":"function","z":"7bb54802fe15737a","name":"","func":"var stored = flow.get(\"manualshutters\");\n\nif (stored == \"open\")\n{\n    if (msg.payload == \"schedule open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"schedule close\")\n    {\n        msg.payload = \"ABORTED\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1220,"y":680,"wires":[["9066c0d6edf97814","c582d64891f4ba75"]]},{"id":"9066c0d6edf97814","type":"debug","z":"7bb54802fe15737a","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1730,"y":680,"wires":[]},{"id":"f73cd157096fc7f8","type":"change","z":"7bb54802fe15737a","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1250,"y":620,"wires":[["7237e913a3cdeb7a"]]},{"id":"8d0c89d270ea29b5","type":"change","z":"7bb54802fe15737a","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1250,"y":560,"wires":[["7237e913a3cdeb7a"]]},{"id":"d14fc4c984a30213","type":"change","z":"7bb54802fe15737a","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1250,"y":360,"wires":[["6c216ce87e04752e"]]},{"id":"1a1154377ef53e7d","type":"change","z":"7bb54802fe15737a","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1250,"y":300,"wires":[["6c216ce87e04752e"]]},{"id":"12b465e8c38e06cb","type":"change","z":"7bb54802fe15737a","name":"","rules":[{"t":"delete","p":"manualshutters","pt":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1320,"y":220,"wires":[[]]},{"id":"6f80ba464fd59c43","type":"debug","z":"7bb54802fe15737a","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1750,"y":420,"wires":[]},{"id":"697816b4e1b1852d","type":"server-state-changed","z":"7bb54802fe15737a","name":"Schlafzimmersensor","server":"42c5021e.042e7c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.schlafzimmerfenster_rechts","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":420,"wires":[["75e4f6ef3f70e95d"]]},{"id":"75e4f6ef3f70e95d","type":"switch","z":"7bb54802fe15737a","name":"closed/open","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"false","vt":"str"},{"t":"eq","v":"rue","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":420,"wires":[["beef8447d5ad9e53"],["813fd8155b95943e"]]},{"id":"b89268fee39c95c8","type":"comment","z":"7bb54802fe15737a","name":"aquara doorsensor with open/closed state","info":"","x":240,"y":380,"wires":[]},{"id":"bd3d3b259f529ebb","type":"comment","z":"7bb54802fe15737a","name":"roller shutter has 4 states (opened, closed, closing, opening)","info":"","x":280,"y":200,"wires":[]},{"id":"90baf135e96e8d7b","type":"api-call-service","z":"7bb54802fe15737a","name":"Schlafzimmerrollladen schließen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 0\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1790,"y":520,"wires":[[]]},{"id":"ae29b5193001f220","type":"change","z":"7bb54802fe15737a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"manual","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":360,"wires":[["d14fc4c984a30213","cc73178632547800"]]},{"id":"741633e9d0555a37","type":"change","z":"7bb54802fe15737a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"manual","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":300,"wires":[["1a1154377ef53e7d","12b465e8c38e06cb","cc73178632547800"]]},{"id":"cf27f3e9081eb957","type":"inject","z":"7bb54802fe15737a","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual open","payloadType":"str","x":1050,"y":420,"wires":[["cc73178632547800","d14fc4c984a30213"]]},{"id":"89600d0fce3a1597","type":"inject","z":"7bb54802fe15737a","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual close","payloadType":"str","x":1050,"y":220,"wires":[["12b465e8c38e06cb","1a1154377ef53e7d","cc73178632547800"]]},{"id":"9a5e0f68bd0388c4","type":"change","z":"7bb54802fe15737a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"schedule open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"schedule","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":620,"wires":[["f73cd157096fc7f8","35c4651e913e555b"]]},{"id":"35b6f1b9c2745f9d","type":"change","z":"7bb54802fe15737a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"schedule close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"schedule","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":560,"wires":[["8d0c89d270ea29b5","35c4651e913e555b"]]},{"id":"41fcda895e149aff","type":"inject","z":"7bb54802fe15737a","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule open","payloadType":"str","x":990,"y":680,"wires":[["f73cd157096fc7f8","35c4651e913e555b"]]},{"id":"547a199b0ef9e434","type":"inject","z":"7bb54802fe15737a","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule close","payloadType":"str","x":990,"y":520,"wires":[["8d0c89d270ea29b5","35c4651e913e555b"]]},{"id":"6c216ce87e04752e","type":"change","z":"7bb54802fe15737a","name":"set flow","rules":[{"t":"set","p":"manualshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":300,"wires":[["42c897e20b7f91f7"]]},{"id":"663c060eacf0617b","type":"api-call-service","z":"7bb54802fe15737a","name":"Schlafzimmerrollladen öffnen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 100\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1780,"y":460,"wires":[[]]},{"id":"0e8853df7d523626","type":"api-call-service","z":"7bb54802fe15737a","name":"Schlafzimmerrollladen schließen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 0\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1770,"y":780,"wires":[[]]},{"id":"220357b45ba51b99","type":"api-call-service","z":"7bb54802fe15737a","name":"Schlafzimmerrollladen öffnen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 100\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1760,"y":720,"wires":[[]]},{"id":"1f555012c114c9ee","type":"time-inject","z":"7bb54802fe15737a","name":"","nameInt":"⏲ Blaue Morgenstunde Ende = Zeitpunkt","positionConfig":"ee553bbf6476ddf0","props":[{"p":"","pt":"msgPayload","v":"","vt":"date","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":true,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false},{"p":"","pt":"msgTopic","v":"","vt":"str","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":false,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false}],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"blueHourDawnEnd","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":220,"y":620,"wires":[["9a5e0f68bd0388c4"]]},{"id":"89b6cf57869a9168","type":"time-inject","z":"7bb54802fe15737a","name":"","nameInt":"⏲ Blaue Abendstunde Ende = Zeitpunkt","positionConfig":"ee553bbf6476ddf0","props":[{"p":"","pt":"msgPayload","v":"","vt":"date","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":true,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false},{"p":"","pt":"msgTopic","v":"","vt":"str","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":false,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false}],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"blueHourDuskEnd","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":220,"y":560,"wires":[["35b6f1b9c2745f9d"]]},{"id":"df393a72a698a4da","type":"comment","z":"7bb54802fe15737a","name":"opens/closes roller shutter at sunrise/sunset","info":"","x":230,"y":500,"wires":[]},{"id":"7237e913a3cdeb7a","type":"change","z":"7bb54802fe15737a","name":"set flow","rules":[{"t":"set","p":"scheduleshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1440,"y":560,"wires":[["017e1bc47967799c"]]},{"id":"813fd8155b95943e","type":"and-gate","z":"7bb54802fe15737a","name":"AND","rules":[{"t":"eq","v":"true","vt":"str","propertyType":"msg","property":"payload","topic":"Bürobalkontür Status"}],"outputTopic":"","gateType":"and","emitOnlyIfTrue":false,"x":830,"y":360,"wires":[["ae29b5193001f220"]]},{"id":"beef8447d5ad9e53","type":"and-gate","z":"7bb54802fe15737a","name":"AND","rules":[{"t":"eq","v":"true","vt":"str","propertyType":"msg","property":"payload","topic":"Bürobalkontür Status"}],"outputTopic":"","gateType":"and","emitOnlyIfTrue":false,"x":830,"y":300,"wires":[["741633e9d0555a37"]]},{"id":"c582d64891f4ba75","type":"switch","z":"7bb54802fe15737a","name":"ForceOpen/ForceClose/Aborted","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"FORCE OPEN","vt":"str"},{"t":"eq","v":"FORCE CLOSE","vt":"str"},{"t":"eq","v":"ABORTED","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1470,"y":720,"wires":[["220357b45ba51b99"],["0e8853df7d523626"],[]]},{"id":"7f4099c47868fa17","type":"switch","z":"7bb54802fe15737a","name":"ForceOpen/ForceClose","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"FORCE OPEN","vt":"str"},{"t":"eq","v":"FORCE CLOSE","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1490,"y":460,"wires":[["663c060eacf0617b"],["90baf135e96e8d7b"]]},{"id":"80e71277ac4d77fb","type":"or-gate","z":"7bb54802fe15737a","name":"OR","rules":[{"t":"eq","v":"","vt":"str","propertyType":"msg","property":"payload","topic":""}],"outputTopic":"","gateType":"or","emitOnlyIfTrue":false,"x":630,"y":240,"wires":[["beef8447d5ad9e53"]]},{"id":"b816e2c6a1f2a605","type":"or-gate","z":"7bb54802fe15737a","name":"OR","rules":[{"t":"eq","v":"","vt":"str","propertyType":"msg","property":"payload","topic":""}],"outputTopic":"","gateType":"or","emitOnlyIfTrue":false,"x":630,"y":300,"wires":[["813fd8155b95943e"]]},{"id":"230da53f3544017c","type":"server-state-changed","z":"7bb54802fe15737a","name":"Schlafzimmercover","server":"42c5021e.042e7c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.schlafzimmer_state","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":110,"y":260,"wires":[["313e5f282ff00ff1"]]},{"id":"313e5f282ff00ff1","type":"switch","z":"7bb54802fe15737a","name":"closed/opened/closing/opening","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"closed","vt":"str"},{"t":"eq","v":"opened","vt":"str"},{"t":"eq","v":"closing","vt":"str"},{"t":"eq","v":"opening","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":370,"y":260,"wires":[["b816e2c6a1f2a605"],["80e71277ac4d77fb"],["b816e2c6a1f2a605"],["80e71277ac4d77fb"]]},{"id":"42c897e20b7f91f7","type":"debug","z":"7bb54802fe15737a","name":"manualshutters","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1620,"y":300,"wires":[]},{"id":"017e1bc47967799c","type":"debug","z":"7bb54802fe15737a","name":"scheduleshutters","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1630,"y":580,"wires":[]},{"id":"42c5021e.042e7c","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30},{"id":"ee553bbf6476ddf0","type":"position-config","name":"Wienerstraße 95","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12","contextStore":""}]

At the moment I am facing a problem that the 'manualshutter' changes randomly between open and close and therefore the roller shutter is moving up and down without stopping... Might be somehow related to the manualshutters reset?

Furthermore I think that there is a logical error in this flow: The scheduled close never affects the roller shutter. So the roller shutters will never close at sunset - or am I missing something?

Thank you!

BR

Interesting.

Looking at the code I sent you originally this is an example of it working.

I'll import your version and see what I get.

(Not very far)

But looking at it, I suspect the AND and OR nodes aren't helping.

the code/nodes I posted are expecting the clean inputs from what ever is sending the messages.

The extra AND and OR gates could be messing up how the messages arrive.

Give this a try.

[{"id":"6aee636d875e2ce8","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"781861ab6140ac5a","type":"comment","z":"6aee636d875e2ce8","name":"Schedule events","info":"","x":660,"y":620,"wires":[]},{"id":"8766c926d34c2257","type":"comment","z":"6aee636d875e2ce8","name":"Door/window events","info":"","x":970,"y":110,"wires":[]},{"id":"9e6ecd213c809a20","type":"function","z":"6aee636d875e2ce8","name":"","func":"var stored = flow.get(\"scheduleshutters\");\n\nif (stored == \"close\")\n{\n    if (msg.payload == \"manual open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"manual close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":350,"wires":[["96cc50eeff9799ea","71e00d6369f2942c"]]},{"id":"61d835b07609d0b4","type":"function","z":"6aee636d875e2ce8","name":"","func":"var stored = flow.get(\"manualshutters\");\n\nif (stored == \"open\")\n{\n    if (msg.payload == \"schedule open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"schedule close\")\n    {\n        msg.payload = \"ABORTED\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":820,"wires":[["77b838ab379ec92c","65051e527a0e869a"]]},{"id":"77b838ab379ec92c","type":"debug","z":"6aee636d875e2ce8","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1340,"y":820,"wires":[]},{"id":"27f0b62b57796462","type":"change","z":"6aee636d875e2ce8","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":760,"wires":[["ae92e396c82749e2"]]},{"id":"76e3c5f7ca2de93e","type":"change","z":"6aee636d875e2ce8","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":700,"wires":[["ae92e396c82749e2"]]},{"id":"5aee9f92648416b6","type":"change","z":"6aee636d875e2ce8","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":290,"wires":[["0837a87bf79bf7f7"]]},{"id":"19d0000c1ef730b4","type":"change","z":"6aee636d875e2ce8","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":230,"wires":[["0837a87bf79bf7f7","a077802ec0357dec"]]},{"id":"a077802ec0357dec","type":"change","z":"6aee636d875e2ce8","name":"","rules":[{"t":"delete","p":"manualshutters","pt":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1270,"y":150,"wires":[[]]},{"id":"96cc50eeff9799ea","type":"debug","z":"6aee636d875e2ce8","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1530,"y":350,"wires":[]},{"id":"6f80ad21d206e5eb","type":"server-state-changed","z":"6aee636d875e2ce8","name":"Schlafzimmersensor","server":"42c5021e.042e7c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.schlafzimmerfenster_rechts","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":180,"y":500,"wires":[["9e25e7d46e6b0580"]]},{"id":"9e25e7d46e6b0580","type":"switch","z":"6aee636d875e2ce8","name":"closed/open","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"false","vt":"str"},{"t":"eq","v":"rue","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":420,"y":500,"wires":[["19d0000c1ef730b4"],["5aee9f92648416b6"]]},{"id":"eb3436cf8898e562","type":"comment","z":"6aee636d875e2ce8","name":"aquara doorsensor with open/closed state","info":"","x":250,"y":460,"wires":[]},{"id":"7e67f157bd129551","type":"comment","z":"6aee636d875e2ce8","name":"roller shutter has 4 states (opened, closed, closing, opening)","info":"","x":280,"y":200,"wires":[]},{"id":"ed236f0c0be0614f","type":"api-call-service","z":"6aee636d875e2ce8","name":"Schlafzimmerrollladen schließen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 0\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1570,"y":450,"wires":[[]]},{"id":"4b8eecbe9a2f04a6","type":"inject","z":"6aee636d875e2ce8","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual open","payloadType":"str","x":830,"y":350,"wires":[["9e6ecd213c809a20","5aee9f92648416b6"]]},{"id":"a3379f417b6ff4ef","type":"inject","z":"6aee636d875e2ce8","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual close","payloadType":"str","x":830,"y":150,"wires":[["19d0000c1ef730b4","9e6ecd213c809a20"]]},{"id":"7d5c530effdbef67","type":"inject","z":"6aee636d875e2ce8","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule open","payloadType":"str","x":630,"y":870,"wires":[["27f0b62b57796462","61d835b07609d0b4"]]},{"id":"a69ddfccc25ab317","type":"inject","z":"6aee636d875e2ce8","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule close","payloadType":"str","x":630,"y":660,"wires":[["76e3c5f7ca2de93e","61d835b07609d0b4"]]},{"id":"0837a87bf79bf7f7","type":"change","z":"6aee636d875e2ce8","name":"set flow","rules":[{"t":"set","p":"manualshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":230,"wires":[["732cd970798a22d5"]]},{"id":"66fa8a9adf9d16f1","type":"api-call-service","z":"6aee636d875e2ce8","name":"Schlafzimmerrollladen öffnen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 100\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1560,"y":390,"wires":[[]]},{"id":"06234edc70b73708","type":"api-call-service","z":"6aee636d875e2ce8","name":"Schlafzimmerrollladen schließen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 0\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1370,"y":920,"wires":[[]]},{"id":"d38134c0e9115555","type":"api-call-service","z":"6aee636d875e2ce8","name":"Schlafzimmerrollladen öffnen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 100\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1360,"y":860,"wires":[[]]},{"id":"b00259d1593aac56","type":"time-inject","z":"6aee636d875e2ce8","name":"","nameInt":"⏲ Blaue Morgenstunde Ende = Zeitpunkt","positionConfig":"ee553bbf6476ddf0","props":[{"p":"","pt":"msgPayload","v":"","vt":"date","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":true,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false},{"p":"","pt":"msgTopic","v":"","vt":"str","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":false,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false}],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"blueHourDawnEnd","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":220,"y":760,"wires":[["27f0b62b57796462","61d835b07609d0b4"]]},{"id":"b76b9af527ede818","type":"time-inject","z":"6aee636d875e2ce8","name":"","nameInt":"⏲ Blaue Abendstunde Ende = Zeitpunkt","positionConfig":"ee553bbf6476ddf0","props":[{"p":"","pt":"msgPayload","v":"","vt":"date","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":true,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false},{"p":"","pt":"msgTopic","v":"","vt":"str","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":false,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false}],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"blueHourDuskEnd","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":220,"y":700,"wires":[["76e3c5f7ca2de93e","27f0b62b57796462"]]},{"id":"e9d88470aacee364","type":"comment","z":"6aee636d875e2ce8","name":"opens/closes roller shutter at sunrise/sunset","info":"","x":230,"y":640,"wires":[]},{"id":"ae92e396c82749e2","type":"change","z":"6aee636d875e2ce8","name":"set flow","rules":[{"t":"set","p":"scheduleshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":700,"wires":[["a3499b373b6d3425"]]},{"id":"65051e527a0e869a","type":"switch","z":"6aee636d875e2ce8","name":"ForceOpen/ForceClose/Aborted","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"FORCE OPEN","vt":"str"},{"t":"eq","v":"FORCE CLOSE","vt":"str"},{"t":"eq","v":"ABORTED","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1040,"y":870,"wires":[["d38134c0e9115555"],["06234edc70b73708"],[]]},{"id":"71e00d6369f2942c","type":"switch","z":"6aee636d875e2ce8","name":"ForceOpen/ForceClose","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"FORCE OPEN","vt":"str"},{"t":"eq","v":"FORCE CLOSE","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1270,"y":390,"wires":[["66fa8a9adf9d16f1"],["ed236f0c0be0614f"]]},{"id":"f74e07d139877948","type":"server-state-changed","z":"6aee636d875e2ce8","name":"Schlafzimmercover","server":"42c5021e.042e7c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.schlafzimmer_state","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":110,"y":260,"wires":[["874be822308e85c7"]]},{"id":"874be822308e85c7","type":"switch","z":"6aee636d875e2ce8","name":"closed/opened/closing/opening","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"closed","vt":"str"},{"t":"eq","v":"opened","vt":"str"},{"t":"eq","v":"closing","vt":"str"},{"t":"eq","v":"opening","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":390,"y":260,"wires":[[],[],[],[]]},{"id":"732cd970798a22d5","type":"debug","z":"6aee636d875e2ce8","name":"manualshutters","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1400,"y":230,"wires":[]},{"id":"a3499b373b6d3425","type":"debug","z":"6aee636d875e2ce8","name":"scheduleshutters","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1340,"y":700,"wires":[]},{"id":"f3992a94d10929fc","type":"comment","z":"6aee636d875e2ce8","name":"READ ME!","info":"I am not sure about what is `true` and `false`\n\nAdjust as needed.\n\nI have connected things with `false` meaning CLOSED\nand `true` meaning OPEN.\n\nIf it is the oposite, just reverse how these are connected.","x":650,"y":420,"wires":[]}]

Oh, read the README node!

It isn't stated what true and false indicate. (OPEN/CLOSED shutters/doors)

You may have to swap the two connections from the node/s.

Hope this helps.

Hi,
thanks again!
I tried your code again:
In closed state the door sensor sends false and in opened state true. So it was like you expected. I think that two connections between the closed/opened switch to the function block are missing ,or?

I already tried with and without the two connections but both were not working. If I press the Open/close Inject instead of the door sensor I can see the right output in the manualshutters debug node. If I open the windows I see that the state changes, but the manualshutters debug node doesn't get triggered.

EDIT: Because of this I changed the state type of the door sensor from bool to string and the closed/opened switch to off/on. With this change It is now closing/opening with the state of the sensor when scheduled close was triggered before (so everything like expected :+1:). Because of this I think I do not need the and/or nodes and the state of the rollershutter because it will only work when the scheduled close was triggered before (and therefore it is only at night like I wanted to have it).

Two problems are still left (Both related to the scheduled open/close)

1.) In the morning the cover is (in normal conditions) closed (manualshutters = closed) and therefore the cover will not get opened in the morning at sunrise.
2.) If the window is closed and the cover is opened it should close the cover at sunset. At the moment it get Aborted (this should only get aborted if cover is open and window is also opened.)

I think both problems could be solved by changing the function node in the scheduled part of the flow.

One additional thing I changed in my flow is this connection, because I think this was an error...

This is the flow with my changes:

[{"id":"7bb54802fe15737a","type":"tab","label":"Rolllaedensteuerung","disabled":false,"info":"","env":[]},{"id":"33ba843f8f43006d","type":"comment","z":"7bb54802fe15737a","name":"Schedule events","info":"","x":800,"y":540,"wires":[]},{"id":"0e1a23e8fa5a9200","type":"comment","z":"7bb54802fe15737a","name":"Door/window events","info":"","x":1050,"y":30,"wires":[]},{"id":"3f5ae44fb250b3bf","type":"function","z":"7bb54802fe15737a","name":"","func":"var stored = flow.get(\"scheduleshutters\");\n\nif (stored == \"close\")\n{\n    if (msg.payload == \"manual open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"manual close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1120,"y":270,"wires":[["541834a24ab2cafc","82edbecb87fd71b8"]]},{"id":"aeb07edfca9d630f","type":"function","z":"7bb54802fe15737a","name":"","func":"var stored = flow.get(\"manualshutters\");\n\nif (stored == \"open\")\n{\n    if (msg.payload == \"schedule open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"schedule close\")\n    {\n        msg.payload = \"ABORTED\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":920,"y":740,"wires":[["97c516b5b5e6eb9f","e4be9cd55067b8a5"]]},{"id":"97c516b5b5e6eb9f","type":"debug","z":"7bb54802fe15737a","name":"To shutter control","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1420,"y":740,"wires":[]},{"id":"00ef89ccfb16cb1b","type":"change","z":"7bb54802fe15737a","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":680,"wires":[["2576c6d9d0d20ca2"]]},{"id":"db49e371217a1ef1","type":"change","z":"7bb54802fe15737a","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":620,"wires":[["2576c6d9d0d20ca2"]]},{"id":"eb0e40629648d98c","type":"change","z":"7bb54802fe15737a","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":210,"wires":[["f8f4a7c060a02d0a"]]},{"id":"24f90ee4631167f4","type":"change","z":"7bb54802fe15737a","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":150,"wires":[["f8f4a7c060a02d0a","31cd2f023e9f9e46"]]},{"id":"31cd2f023e9f9e46","type":"change","z":"7bb54802fe15737a","name":"","rules":[{"t":"delete","p":"manualshutters","pt":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1340,"y":140,"wires":[[]]},{"id":"541834a24ab2cafc","type":"debug","z":"7bb54802fe15737a","name":"To shutter control","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1610,"y":270,"wires":[]},{"id":"9f783bf91202f256","type":"server-state-changed","z":"7bb54802fe15737a","name":"Schlafzimmersensor","server":"42c5021e.042e7c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.schlafzimmerfenster_rechts","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":330,"y":200,"wires":[["56aeb2fe6d3803eb"]]},{"id":"56aeb2fe6d3803eb","type":"switch","z":"7bb54802fe15737a","name":"closed/open","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":200,"wires":[["24f90ee4631167f4","0ef2a7ef28323321"],["eb0e40629648d98c","076afab113721d4f"]]},{"id":"31a3d2d7eff4f075","type":"comment","z":"7bb54802fe15737a","name":"aquara doorsensor with open/closed state","info":"","x":400,"y":160,"wires":[]},{"id":"068c12b812ec6300","type":"comment","z":"7bb54802fe15737a","name":"roller shutter has 4 states (opened, closed, closing, opening)","info":"","x":400,"y":300,"wires":[]},{"id":"309b441982588579","type":"api-call-service","z":"7bb54802fe15737a","name":"Schlafzimmerrollladen schließen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 0\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1650,"y":370,"wires":[[]]},{"id":"6aa2b41af4f9c281","type":"inject","z":"7bb54802fe15737a","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual open","payloadType":"str","x":910,"y":320,"wires":[["3f5ae44fb250b3bf","eb0e40629648d98c"]]},{"id":"0af52c3da114e371","type":"inject","z":"7bb54802fe15737a","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual close","payloadType":"str","x":910,"y":120,"wires":[["24f90ee4631167f4","3f5ae44fb250b3bf"]]},{"id":"5d9c003b4f968da7","type":"inject","z":"7bb54802fe15737a","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule open","payloadType":"str","x":650,"y":840,"wires":[["00ef89ccfb16cb1b","aeb07edfca9d630f"]]},{"id":"cf3cc180a9524545","type":"inject","z":"7bb54802fe15737a","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule close","payloadType":"str","x":650,"y":580,"wires":[["db49e371217a1ef1","aeb07edfca9d630f"]]},{"id":"f8f4a7c060a02d0a","type":"change","z":"7bb54802fe15737a","name":"set flow","rules":[{"t":"set","p":"manualshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1280,"y":200,"wires":[["68c5d8e374cc2a3e"]]},{"id":"3efd8a0811f304db","type":"api-call-service","z":"7bb54802fe15737a","name":"Schlafzimmerrollladen öffnen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 100\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1640,"y":310,"wires":[[]]},{"id":"8c2f468dd5d9c75d","type":"api-call-service","z":"7bb54802fe15737a","name":"Schlafzimmerrollladen schließen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 0\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":840,"wires":[[]]},{"id":"c7e55525a355d3f6","type":"api-call-service","z":"7bb54802fe15737a","name":"Schlafzimmerrollladen öffnen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 100\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1440,"y":780,"wires":[[]]},{"id":"28599889cc2c7050","type":"time-inject","z":"7bb54802fe15737a","name":"","nameInt":"⏲ Blaue Morgenstunde Ende = Zeitpunkt","positionConfig":"ee553bbf6476ddf0","props":[{"p":"","pt":"msgPayload","v":"","vt":"date","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":true,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false},{"p":"","pt":"msgTopic","v":"","vt":"str","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":false,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false}],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"blueHourDawnEnd","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":260,"y":680,"wires":[["00ef89ccfb16cb1b","f85f082cb7d57259"]]},{"id":"94b5440ff2295b44","type":"time-inject","z":"7bb54802fe15737a","name":"","nameInt":"⏲ Blaue Abendstunde Ende = Zeitpunkt","positionConfig":"ee553bbf6476ddf0","props":[{"p":"","pt":"msgPayload","v":"","vt":"date","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":true,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false},{"p":"","pt":"msgTopic","v":"","vt":"str","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":false,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false}],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"blueHourDuskEnd","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":260,"y":620,"wires":[["db49e371217a1ef1","e2d1a52ee5940cc6"]]},{"id":"f9f785b3ded83d0d","type":"comment","z":"7bb54802fe15737a","name":"opens/closes roller shutter at sunrise/sunset","info":"","x":310,"y":560,"wires":[]},{"id":"2576c6d9d0d20ca2","type":"change","z":"7bb54802fe15737a","name":"set flow","rules":[{"t":"set","p":"scheduleshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1090,"y":620,"wires":[["a11d8f651b8eb2f8"]]},{"id":"e4be9cd55067b8a5","type":"switch","z":"7bb54802fe15737a","name":"ForceOpen/ForceClose/Aborted","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"FORCE OPEN","vt":"str"},{"t":"eq","v":"FORCE CLOSE","vt":"str"},{"t":"eq","v":"ABORTED","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1130,"y":800,"wires":[["c7e55525a355d3f6"],["8c2f468dd5d9c75d"],[]]},{"id":"82edbecb87fd71b8","type":"switch","z":"7bb54802fe15737a","name":"ForceOpen/ForceClose","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"FORCE OPEN","vt":"str"},{"t":"eq","v":"FORCE CLOSE","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1350,"y":310,"wires":[["3efd8a0811f304db"],["309b441982588579"]]},{"id":"703bd5a2630febb5","type":"server-state-changed","z":"7bb54802fe15737a","name":"Schlafzimmercover","server":"42c5021e.042e7c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.schlafzimmer_state","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":250,"y":360,"wires":[["b81d1fd4e5ec3a95"]]},{"id":"b81d1fd4e5ec3a95","type":"switch","z":"7bb54802fe15737a","name":"closed/opened/closing/opening","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"closed","vt":"str"},{"t":"eq","v":"opened","vt":"str"},{"t":"eq","v":"closing","vt":"str"},{"t":"eq","v":"opening","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":510,"y":360,"wires":[[],[],[],[]]},{"id":"68c5d8e374cc2a3e","type":"debug","z":"7bb54802fe15737a","name":"manualshutters","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1480,"y":200,"wires":[]},{"id":"a11d8f651b8eb2f8","type":"debug","z":"7bb54802fe15737a","name":"scheduleshutters","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1420,"y":620,"wires":[]},{"id":"076afab113721d4f","type":"change","z":"7bb54802fe15737a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"manual","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":280,"wires":[["3f5ae44fb250b3bf"]]},{"id":"0ef2a7ef28323321","type":"change","z":"7bb54802fe15737a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"manual","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":240,"wires":[["3f5ae44fb250b3bf"]]},{"id":"f85f082cb7d57259","type":"change","z":"7bb54802fe15737a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"schedule open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"schedule","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":760,"wires":[["aeb07edfca9d630f"]]},{"id":"e2d1a52ee5940cc6","type":"change","z":"7bb54802fe15737a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"schedule close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"schedule","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":720,"wires":[["aeb07edfca9d630f"]]},{"id":"42c5021e.042e7c","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30},{"id":"ee553bbf6476ddf0","type":"position-config","name":"Wienerstraße 95","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12","contextStore":""}]

You are doing good, but I get how confusing things can be.

One suggestion:
Get rid of those two nodes that aren't needed any more.
They aren't really doing anything.

First off here's the code:

[{"id":"7bb54802fe15737a","type":"tab","label":"Rolllaedensteuerung","disabled":false,"info":"","env":[]},{"id":"33ba843f8f43006d","type":"comment","z":"7bb54802fe15737a","name":"Schedule events","info":"","x":810,"y":600,"wires":[]},{"id":"0e1a23e8fa5a9200","type":"comment","z":"7bb54802fe15737a","name":"Door/window events","info":"","x":840,"y":180,"wires":[]},{"id":"3f5ae44fb250b3bf","type":"function","z":"7bb54802fe15737a","name":"","func":"var stored = flow.get(\"scheduleshutters\");\n\nif (stored == \"close\")\n{\n    if (msg.payload == \"manual open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"manual close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1050,"y":400,"wires":[["541834a24ab2cafc","82edbecb87fd71b8"]]},{"id":"aeb07edfca9d630f","type":"function","z":"7bb54802fe15737a","name":"","func":"var stored = flow.get(\"manualshutters\");\n\nif (stored == \"open\")\n{\n    if (msg.payload == \"schedule open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"schedule close\")\n    {\n        msg.payload = \"ABORTED\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":800,"wires":[["97c516b5b5e6eb9f","e4be9cd55067b8a5"]]},{"id":"97c516b5b5e6eb9f","type":"debug","z":"7bb54802fe15737a","name":"To shutter control","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1400,"y":800,"wires":[]},{"id":"00ef89ccfb16cb1b","type":"change","z":"7bb54802fe15737a","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":720,"wires":[["2576c6d9d0d20ca2"]]},{"id":"db49e371217a1ef1","type":"change","z":"7bb54802fe15737a","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":680,"wires":[["2576c6d9d0d20ca2"]]},{"id":"eb0e40629648d98c","type":"change","z":"7bb54802fe15737a","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":320,"wires":[["f8f4a7c060a02d0a"]]},{"id":"24f90ee4631167f4","type":"change","z":"7bb54802fe15737a","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":280,"wires":[["f8f4a7c060a02d0a","31cd2f023e9f9e46"]]},{"id":"31cd2f023e9f9e46","type":"change","z":"7bb54802fe15737a","name":"","rules":[{"t":"delete","p":"manualshutters","pt":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":250,"wires":[[]]},{"id":"541834a24ab2cafc","type":"debug","z":"7bb54802fe15737a","name":"To shutter control","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1290,"y":380,"wires":[]},{"id":"56aeb2fe6d3803eb","type":"switch","z":"7bb54802fe15737a","name":"closed/open","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":350,"wires":[["24f90ee4631167f4","0ef2a7ef28323321"],["eb0e40629648d98c","076afab113721d4f"]]},{"id":"31a3d2d7eff4f075","type":"comment","z":"7bb54802fe15737a","name":"aquara doorsensor with open/closed state","info":"","x":380,"y":310,"wires":[]},{"id":"068c12b812ec6300","type":"comment","z":"7bb54802fe15737a","name":"roller shutter has 4 states (opened, closed, closing, opening)","info":"","x":380,"y":450,"wires":[]},{"id":"309b441982588579","type":"api-call-service","z":"7bb54802fe15737a","name":"Schlafzimmerrollladen schließen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 0\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1580,"y":440,"wires":[[]]},{"id":"6aa2b41af4f9c281","type":"inject","z":"7bb54802fe15737a","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual open","payloadType":"str","x":570,"y":250,"wires":[["eb0e40629648d98c","076afab113721d4f"]]},{"id":"0af52c3da114e371","type":"inject","z":"7bb54802fe15737a","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual close","payloadType":"str","x":570,"y":210,"wires":[["24f90ee4631167f4","0ef2a7ef28323321"]]},{"id":"5d9c003b4f968da7","type":"inject","z":"7bb54802fe15737a","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule open","payloadType":"str","x":560,"y":720,"wires":[["00ef89ccfb16cb1b","aeb07edfca9d630f"]]},{"id":"cf3cc180a9524545","type":"inject","z":"7bb54802fe15737a","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule close","payloadType":"str","x":560,"y":680,"wires":[["db49e371217a1ef1","aeb07edfca9d630f"]]},{"id":"f8f4a7c060a02d0a","type":"change","z":"7bb54802fe15737a","name":"set flow","rules":[{"t":"set","p":"manualshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":300,"wires":[["68c5d8e374cc2a3e"]]},{"id":"3efd8a0811f304db","type":"api-call-service","z":"7bb54802fe15737a","name":"Schlafzimmerrollladen öffnen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 100\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1580,"y":400,"wires":[[]]},{"id":"8c2f468dd5d9c75d","type":"api-call-service","z":"7bb54802fe15737a","name":"Schlafzimmerrollladen schließen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 0\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1430,"y":930,"wires":[[]]},{"id":"c7e55525a355d3f6","type":"api-call-service","z":"7bb54802fe15737a","name":"Schlafzimmerrollladen öffnen","server":"42c5021e.042e7c","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.schlafzimmer","data":"{\t\"position\": 100\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1420,"y":870,"wires":[[]]},{"id":"28599889cc2c7050","type":"time-inject","z":"7bb54802fe15737a","name":"","nameInt":"⏲ Blaue Morgenstunde Ende = Zeitpunkt","positionConfig":"ee553bbf6476ddf0","props":[{"p":"","pt":"msgPayload","v":"","vt":"date","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":true,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false},{"p":"","pt":"msgTopic","v":"","vt":"str","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":false,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false}],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"blueHourDawnEnd","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":240,"y":830,"wires":[["f85f082cb7d57259"]]},{"id":"f9f785b3ded83d0d","type":"comment","z":"7bb54802fe15737a","name":"opens/closes roller shutter at sunrise/sunset","info":"","x":280,"y":690,"wires":[]},{"id":"2576c6d9d0d20ca2","type":"change","z":"7bb54802fe15737a","name":"set flow","rules":[{"t":"set","p":"scheduleshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":710,"wires":[["a11d8f651b8eb2f8"]]},{"id":"e4be9cd55067b8a5","type":"switch","z":"7bb54802fe15737a","name":"ForceOpen/ForceClose/Aborted","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"FORCE OPEN","vt":"str"},{"t":"eq","v":"FORCE CLOSE","vt":"str"},{"t":"eq","v":"ABORTED","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1120,"y":900,"wires":[["c7e55525a355d3f6"],["8c2f468dd5d9c75d"],[]]},{"id":"82edbecb87fd71b8","type":"switch","z":"7bb54802fe15737a","name":"ForceOpen/ForceClose","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"FORCE OPEN","vt":"str"},{"t":"eq","v":"FORCE CLOSE","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1310,"y":420,"wires":[["3efd8a0811f304db"],["309b441982588579"]]},{"id":"b81d1fd4e5ec3a95","type":"switch","z":"7bb54802fe15737a","name":"closed/opened/closing/opening","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"closed","vt":"str"},{"t":"eq","v":"opened","vt":"str"},{"t":"eq","v":"closing","vt":"str"},{"t":"eq","v":"opening","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":490,"y":510,"wires":[[],[],[],[]]},{"id":"68c5d8e374cc2a3e","type":"debug","z":"7bb54802fe15737a","name":"Not really needed (Manual)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1320,"y":300,"wires":[]},{"id":"a11d8f651b8eb2f8","type":"debug","z":"7bb54802fe15737a","name":"Not really needed (Schedule)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1430,"y":710,"wires":[]},{"id":"076afab113721d4f","type":"change","z":"7bb54802fe15737a","name":"Manual Open","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"manual","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":420,"wires":[["3f5ae44fb250b3bf"]]},{"id":"0ef2a7ef28323321","type":"change","z":"7bb54802fe15737a","name":"Manual Close","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"manual","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":380,"wires":[["3f5ae44fb250b3bf"]]},{"id":"f85f082cb7d57259","type":"change","z":"7bb54802fe15737a","name":"Schedule Close","rules":[{"t":"set","p":"payload","pt":"msg","to":"schedule open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"schedule","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":830,"wires":[["aeb07edfca9d630f","00ef89ccfb16cb1b"]]},{"id":"e2d1a52ee5940cc6","type":"change","z":"7bb54802fe15737a","name":"Schedule Close","rules":[{"t":"set","p":"payload","pt":"msg","to":"schedule close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"schedule","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":770,"wires":[["aeb07edfca9d630f","db49e371217a1ef1"]]},{"id":"94b5440ff2295b44","type":"time-inject","z":"7bb54802fe15737a","name":"","nameInt":"⏲ Blaue Abendstunde Ende = Zeitpunkt","positionConfig":"ee553bbf6476ddf0","props":[{"p":"","pt":"msgPayload","v":"","vt":"date","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":true,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false},{"p":"","pt":"msgTopic","v":"","vt":"str","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":false,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false}],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"blueHourDuskEnd","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":240,"y":770,"wires":[["e2d1a52ee5940cc6"]]},{"id":"703bd5a2630febb5","type":"server-state-changed","z":"7bb54802fe15737a","name":"Schlafzimmercover","server":"42c5021e.042e7c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.schlafzimmer_state","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":510,"wires":[["b81d1fd4e5ec3a95"]]},{"id":"9f783bf91202f256","type":"server-state-changed","z":"7bb54802fe15737a","name":"Schlafzimmersensor","server":"42c5021e.042e7c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.schlafzimmerfenster_rechts","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":310,"y":350,"wires":[["56aeb2fe6d3803eb"]]}]

But some feedback on what I did.

Get rid of those nodes crossed out. They are taking up space and not really doing anything.

I've also wired the inject nodes so they are the same as the signals from what ever those nodes are. Yes I've left the messages as they were, but doing that can cause confusion to yourself.

Sorry my code/flow wasn't too good, but I don't have the nodes you have.
So you put the outputs of your nodes where the inject nodes connect.
I've laid it out nicely to help with clarity - I hope.
The nodes (and the inject nodes) messages go into a change node that sets the message to what is needed at the next step.
As the message is split there are two changed nodes used for each input.

Though it makes no difference to the code, laying it out in columns makes things easier to understand what is going on where. See the yellow lines.

I renamed 4 change nodes to you know what is going on in them. (Green markings.)
The two debug nodes don't really do much but it helps to label them with a meaningful name so when you see the messages they make sense.

Your code doesn't allow any of the scheduled messages to get out - from what I can see.
The switch nodes are only for the FORCE messages.

That's not going to help.

In the morning the cover is (in normal conditions) closed (manualshutters = closed) and therefore the cover will not get opened in the morning at sunrise.

I think that is covered by what I just said about not allowing the scheduled messages to get any where.

The other point.... I don't understand.

(Sorry the editor has thrown a wobbily and I can't scroll back while typing to see your posts.)
(Ah, better now)

Yeah. I don't understand what you mean.

Testing it to the best of what I understand it does what is needed.

Oh, and PLEASE! Don't include those foreign nodes. I don't have them and have to keep deleting their configuration nodes when I'm done.

Oh and good on your for seeing/catching my mistake with the connections in the first picture.
Sorry. My fault.
(Just out of interest: Do you have a spreadsheet program? If so which one?)
(I want to send you a spreadsheet that will maybe help you understand what is going on)

Hi,
yes I have excel for example.

I will check your updated flow at night/tomorrow when I am at home again.

Thanks!

Hi,
I now checked all your changes and they make sense for me -thanks!

Regarding my two remaining issues: I now changed the scheduled function node and with this it seems that I fixed both problems. Here the new flow:

[{"id":"9dff3949632ae781","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"6b5d8bb9731d311e","type":"comment","z":"9dff3949632ae781","name":"Schedule events","info":"","x":1000,"y":380,"wires":[]},{"id":"64538bcd0bda0411","type":"comment","z":"9dff3949632ae781","name":"Door/window events","info":"","x":1000,"y":40,"wires":[]},{"id":"f5e58922e6ce0d01","type":"function","z":"9dff3949632ae781","name":"","func":"var stored = flow.get(\"scheduleshutters\");\n\nif (stored == \"close\")\n{\n    if (msg.payload == \"manual open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"manual close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1240,"y":260,"wires":[["18b779eccb33b4a4","a2b58d4e48ec4633"]]},{"id":"6881fa883f593ada","type":"function","z":"9dff3949632ae781","name":"","func":"var stored = flow.get(\"manualshutters\");\n\n    if (msg.payload == \"schedule open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"schedule close\" && stored == \"open\")\n    {\n        msg.payload = \"ABORTED\";\n    }else\n    if (msg.payload == \"schedule close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1250,"y":460,"wires":[["1a648c85eab97abc","a2b58d4e48ec4633"]]},{"id":"1a648c85eab97abc","type":"debug","z":"9dff3949632ae781","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1470,"y":460,"wires":[]},{"id":"330ebe99f298335a","type":"change","z":"9dff3949632ae781","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":560,"wires":[["4a0cd03a97620a84"]]},{"id":"723b068cba35e6d7","type":"change","z":"9dff3949632ae781","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":520,"wires":[["4a0cd03a97620a84"]]},{"id":"e90427d251c3043e","type":"change","z":"9dff3949632ae781","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":180,"wires":[["0503b5bab8da9a0c"]]},{"id":"b9f5ab02ad3368af","type":"change","z":"9dff3949632ae781","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":140,"wires":[["0503b5bab8da9a0c","d8cedcfa701a5749"]]},{"id":"d8cedcfa701a5749","type":"change","z":"9dff3949632ae781","name":"","rules":[{"t":"delete","p":"manualshutters","pt":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1300,"y":100,"wires":[[]]},{"id":"18b779eccb33b4a4","type":"debug","z":"9dff3949632ae781","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1470,"y":260,"wires":[]},{"id":"c075154ce42e07c8","type":"switch","z":"9dff3949632ae781","name":"closed/open","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":240,"wires":[["b9f5ab02ad3368af","7341c0b3f6a6feb0"],["e90427d251c3043e","b72e005d68f9818c"]]},{"id":"e65722664609e5a7","type":"comment","z":"9dff3949632ae781","name":"aquara doorsensor with open/closed state","info":"","x":340,"y":200,"wires":[]},{"id":"26407d5feb9dd849","type":"inject","z":"9dff3949632ae781","name":"Opened window","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual open","payloadType":"str","x":560,"y":140,"wires":[["e90427d251c3043e","b72e005d68f9818c"]]},{"id":"73e2cb4474c3b5b7","type":"inject","z":"9dff3949632ae781","name":"Closed window","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual close","payloadType":"str","x":560,"y":100,"wires":[["b9f5ab02ad3368af","7341c0b3f6a6feb0"]]},{"id":"ef1c85051e02f21a","type":"inject","z":"9dff3949632ae781","name":"At sunrise","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule open","payloadType":"str","x":540,"y":480,"wires":[["631a8b838f98091c"]]},{"id":"1242383c699fc56c","type":"inject","z":"9dff3949632ae781","name":"At sunset","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule close","payloadType":"str","x":540,"y":440,"wires":[["dc1f79602d5d702c"]]},{"id":"0503b5bab8da9a0c","type":"change","z":"9dff3949632ae781","name":"set flow","rules":[{"t":"set","p":"manualshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1240,"y":160,"wires":[["ccf8a84a267e3ba6"]]},{"id":"49b80a4f658bbb0d","type":"comment","z":"9dff3949632ae781","name":"opens/closes roller shutter at sunrise/sunset","info":"","x":450,"y":380,"wires":[]},{"id":"4a0cd03a97620a84","type":"change","z":"9dff3949632ae781","name":"set flow","rules":[{"t":"set","p":"scheduleshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1250,"y":540,"wires":[["e7cd7e8d11e72530"]]},{"id":"a2b58d4e48ec4633","type":"switch","z":"9dff3949632ae781","name":"ForceOpen/ForceClose/Aborted","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"FORCE OPEN","vt":"str"},{"t":"eq","v":"FORCE CLOSE","vt":"str"},{"t":"eq","v":"ABORTED","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1510,"y":360,"wires":[[],[],[]]},{"id":"ccf8a84a267e3ba6","type":"debug","z":"9dff3949632ae781","name":"Not really needed (Manual)","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1500,"y":160,"wires":[]},{"id":"e7cd7e8d11e72530","type":"debug","z":"9dff3949632ae781","name":"Not really needed (Schedule)","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1500,"y":540,"wires":[]},{"id":"b72e005d68f9818c","type":"change","z":"9dff3949632ae781","name":"Manual Open","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"manual","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":280,"wires":[["f5e58922e6ce0d01"]]},{"id":"7341c0b3f6a6feb0","type":"change","z":"9dff3949632ae781","name":"Manual Close","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"manual","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":240,"wires":[["f5e58922e6ce0d01"]]},{"id":"631a8b838f98091c","type":"change","z":"9dff3949632ae781","name":"Schedule Open","rules":[{"t":"set","p":"payload","pt":"msg","to":"schedule open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"schedule","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":480,"wires":[["6881fa883f593ada","330ebe99f298335a"]]},{"id":"dc1f79602d5d702c","type":"change","z":"9dff3949632ae781","name":"Schedule Close","rules":[{"t":"set","p":"payload","pt":"msg","to":"schedule close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"schedule","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":440,"wires":[["6881fa883f593ada","723b068cba35e6d7"]]}]

I will test this the next days and will give you feedback :+1:

One last thing: After deploying the flow it seems that the state of the Aquara sensor and sunset/sunrise (here I would have to check which triggered last) doesn't get defined until I open the window and the sunset/sunrise gets triggered the first time. Therefore the flow.manualshutters and flow.scheduleshutters payload is not set until the sensors get triggered the first time. Might lead into strange behaviour after each deployment. Is there a way to get the states directly after deployment?

Ok, I realised I made a small mistake.

I'll make the spreadsheet shortly. But in light of what has happened here is a better flow.

[{"id":"9dff3949632ae781","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"6b5d8bb9731d311e","type":"comment","z":"9dff3949632ae781","name":"Schedule events","info":"","x":1000,"y":380,"wires":[]},{"id":"64538bcd0bda0411","type":"comment","z":"9dff3949632ae781","name":"Door/window events","info":"","x":1000,"y":40,"wires":[]},{"id":"f5e58922e6ce0d01","type":"function","z":"9dff3949632ae781","name":"","func":"var stored = flow.get(\"scheduleshutters\");\n\nif (stored == \"close\")\n{\n    if (msg.payload == \"manual open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"manual close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1240,"y":260,"wires":[["18b779eccb33b4a4","a2b58d4e48ec4633"]]},{"id":"6881fa883f593ada","type":"function","z":"9dff3949632ae781","name":"","func":"var stored = flow.get(\"manualshutters\");\nif (stored == undefined)\n    stored = \"open\";\nif (stored == \"open\")\n{\n\n    if (msg.payload == \"schedule open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"schedule close\" && stored == \"open\")\n    {\n        msg.payload = \"ABORTED\";\n    }else\n    if (msg.payload == \"schedule close\" && stored == \"close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1250,"y":460,"wires":[["1a648c85eab97abc","a2b58d4e48ec4633"]]},{"id":"1a648c85eab97abc","type":"debug","z":"9dff3949632ae781","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1470,"y":460,"wires":[]},{"id":"330ebe99f298335a","type":"change","z":"9dff3949632ae781","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":560,"wires":[["4a0cd03a97620a84"]]},{"id":"723b068cba35e6d7","type":"change","z":"9dff3949632ae781","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":520,"wires":[["4a0cd03a97620a84"]]},{"id":"e90427d251c3043e","type":"change","z":"9dff3949632ae781","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":180,"wires":[["0503b5bab8da9a0c"]]},{"id":"b9f5ab02ad3368af","type":"change","z":"9dff3949632ae781","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":140,"wires":[["0503b5bab8da9a0c","72d95ab1d0361003"]]},{"id":"18b779eccb33b4a4","type":"debug","z":"9dff3949632ae781","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1470,"y":260,"wires":[]},{"id":"c075154ce42e07c8","type":"switch","z":"9dff3949632ae781","name":"closed/open","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":240,"wires":[["b9f5ab02ad3368af","7341c0b3f6a6feb0"],["e90427d251c3043e","b72e005d68f9818c"]]},{"id":"e65722664609e5a7","type":"comment","z":"9dff3949632ae781","name":"aquara doorsensor with open/closed state","info":"","x":340,"y":200,"wires":[]},{"id":"26407d5feb9dd849","type":"inject","z":"9dff3949632ae781","name":"Opened window","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual open","payloadType":"str","x":560,"y":140,"wires":[["e90427d251c3043e","b72e005d68f9818c"]]},{"id":"73e2cb4474c3b5b7","type":"inject","z":"9dff3949632ae781","name":"Closed window","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual close","payloadType":"str","x":560,"y":100,"wires":[["b9f5ab02ad3368af","7341c0b3f6a6feb0"]]},{"id":"ef1c85051e02f21a","type":"inject","z":"9dff3949632ae781","name":"At sunrise","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule open","payloadType":"str","x":540,"y":480,"wires":[["631a8b838f98091c"]]},{"id":"1242383c699fc56c","type":"inject","z":"9dff3949632ae781","name":"At sunset","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule close","payloadType":"str","x":540,"y":440,"wires":[["dc1f79602d5d702c"]]},{"id":"0503b5bab8da9a0c","type":"change","z":"9dff3949632ae781","name":"set flow","rules":[{"t":"set","p":"manualshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1240,"y":160,"wires":[["ccf8a84a267e3ba6"]]},{"id":"49b80a4f658bbb0d","type":"comment","z":"9dff3949632ae781","name":"opens/closes roller shutter at sunrise/sunset","info":"","x":450,"y":380,"wires":[]},{"id":"4a0cd03a97620a84","type":"change","z":"9dff3949632ae781","name":"set flow","rules":[{"t":"set","p":"scheduleshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1250,"y":540,"wires":[["e7cd7e8d11e72530"]]},{"id":"a2b58d4e48ec4633","type":"switch","z":"9dff3949632ae781","name":"ForceOpen/ForceClose/Aborted","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"FORCE OPEN","vt":"str"},{"t":"eq","v":"FORCE CLOSE","vt":"str"},{"t":"eq","v":"ABORTED","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1510,"y":360,"wires":[[],[],[]]},{"id":"ccf8a84a267e3ba6","type":"debug","z":"9dff3949632ae781","name":"Not really needed (Manual)","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1500,"y":160,"wires":[]},{"id":"e7cd7e8d11e72530","type":"debug","z":"9dff3949632ae781","name":"Not really needed (Schedule)","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1500,"y":540,"wires":[]},{"id":"b72e005d68f9818c","type":"change","z":"9dff3949632ae781","name":"Manual Open","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"manual","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":280,"wires":[["f5e58922e6ce0d01"]]},{"id":"7341c0b3f6a6feb0","type":"change","z":"9dff3949632ae781","name":"Manual Close","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"manual","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":240,"wires":[["f5e58922e6ce0d01"]]},{"id":"631a8b838f98091c","type":"change","z":"9dff3949632ae781","name":"Schedule Open","rules":[{"t":"set","p":"payload","pt":"msg","to":"schedule open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"schedule","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":480,"wires":[["6881fa883f593ada","330ebe99f298335a"]]},{"id":"dc1f79602d5d702c","type":"change","z":"9dff3949632ae781","name":"Schedule Close","rules":[{"t":"set","p":"payload","pt":"msg","to":"schedule close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"schedule","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":440,"wires":[["6881fa883f593ada","723b068cba35e6d7"]]},{"id":"72d95ab1d0361003","type":"change","z":"9dff3949632ae781","name":"","rules":[{"t":"set","p":"manualshutters","pt":"flow","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1290,"y":100,"wires":[["c8320f56a53e3990"]]},{"id":"c8320f56a53e3990","type":"trigger","z":"9dff3949632ae781","name":"Indicator","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"2","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1500,"y":100,"wires":[[]]}]

The problem is/was the flow.context for the door status. (THE state of the door)
There was a condition where the flow could cause problems because the state of the door was not set.
If you opened/closed the door that problem would go away.
I added a couple of lines in one of the function nodes to get around that problem.

I also changed the "Clear context" changed node.
Rather than deleting the flow.context, I realised it is better to set it to a value ("closed") as that was also causing problems. Sorry. My fault.

That switch node you have at the end.....
Why?
By that stage the messages should give you enough to control what happens next.

(Ok, I digress. For now it is ok. But ultimately you don't need it.)

I'm guessing from that node, you will control the next thing (node?) to get the shutters to raise/lower.

I'll stop here and make the spread sheet.
Though it will be a bit messy, as I haven't done this kind of stuff for a long time and I can't exactly remember how to do them.
But it makes it easier (in some ways) to see what is going on.

Spreadsheet not as easy to do as I thought. I'll get back to you with it later.

Ok, the spreadsheet is being difficult.

Here is a picture to maybe help explain the complexities of what you are doing.

There are 4 inputs. 2 manual and 2 scheduled.
The "Remember" ring is the flow.context.
And in the middle is what is sent to the blind/shutter controller.

Let's try looking at it in this way:
The shutters are CLOSED.
There are only two valid things that can happen.
1 - you open them.
2 - they are opened at sunrise.
(The third is you close them. But given they are already closed.... That doesn't matter)

Now the shutters are OPEN.
Again there are two options that can happen. But I'll elaborate on them a bit more here.
And the "not applicable open command that could be sent.

So the two options are:
1 - you close them.
2 - the sun sets.

The trick here is to remember how they were opened.
If they were opened automatically, they can close.

But!

If YOU opened them, they have to stay open.

Now, some confusion is starting to happen for me.

IF you open them one day: They will stay open for ever.

You need to better define how the manual commands work.
Do they live on for ever or do they become void the next day?

Scenario:
Sunrise. The shutters open.
You decide it is too hot and close them.
Later on you open them again - in the afternoon.

What happens at sunset?

There is a big area of uncertainty with how the manual override then controls how things happen later on.

Hope this helps.

Hi,

I modified the flow in order to safe the latest state of the window sensor in a file and read it in only once after deploment. With this the undefined state issue should be solved.

[{"id":"7545378c68ca4c77","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"697b83f1870821b9","type":"time-inject","z":"7545378c68ca4c77","name":"","nameInt":"⏲ ... = Blaue Morgenstunde Ende","positionConfig":"ee553bbf6476ddf0","props":[{"p":"","pt":"msgPayload","v":"blueHourDawnEnd","vt":"pdsTime","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":true,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false},{"p":"","pt":"msgTopic","v":"","vt":"str","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":false,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false}],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"blueHourDawnEnd","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":560,"y":680,"wires":[["54a5ee2cf0000e88","f70cb80ed6f79bb5"]]},{"id":"7cf590a004204428","type":"time-inject","z":"7545378c68ca4c77","name":"","nameInt":"⏲ ... = Blaue Abendstunde Beginn","positionConfig":"ee553bbf6476ddf0","props":[{"p":"","pt":"msgPayload","v":"blueHourDuskStart","vt":"pdsTime","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":true,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false},{"p":"","pt":"msgTopic","v":"","vt":"str","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"Millisekunden UNIX-Zeit","fI":"0","next":false,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false}],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"blueHourDuskStart","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":560,"y":620,"wires":[["52218d20198b307e","86649a4f8a46f3e5"]]},{"id":"52218d20198b307e","type":"file","z":"7545378c68ca4c77","name":"sunset_state","filename":"/config/node-red/JsonDB/sunset_state.json","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":890,"y":620,"wires":[[]]},{"id":"54a5ee2cf0000e88","type":"file","z":"7545378c68ca4c77","name":"sunrise_state","filename":"/config/node-red/JsonDB/sunrise_state.json","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":890,"y":680,"wires":[[]]},{"id":"b6f279c7d26630b4","type":"inject","z":"7545378c68ca4c77","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"","payloadType":"date","x":350,"y":480,"wires":[["cd80f82b417c8eee","2f8f639ec7820ecf"]]},{"id":"cd80f82b417c8eee","type":"within-time-switch","z":"7545378c68ca4c77","name":"","nameInt":"","positionConfig":"ee553bbf6476ddf0","startTime":"blueHourDuskStart","startTimeType":"pdsTime","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"blueHourDawnEnd","endTimeType":"pdsTime","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"none","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"none","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":590,"y":480,"wires":[["86649a4f8a46f3e5"],[]]},{"id":"2f8f639ec7820ecf","type":"within-time-switch","z":"7545378c68ca4c77","name":"","nameInt":"","positionConfig":"ee553bbf6476ddf0","startTime":"blueHourDawnEnd","startTimeType":"pdsTime","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"blueHourDuskStart","endTimeType":"pdsTime","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"none","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"none","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":590,"y":540,"wires":[["f70cb80ed6f79bb5"],[]]},{"id":"a6757381e93a6d30","type":"server-state-changed","z":"7545378c68ca4c77","name":"Schlafzimmersensor","server":"42c5021e.042e7c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.schlafzimmerfenster_rechts","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":190,"y":260,"wires":[["758e777e4ea9c19d","97985b3054bee056"]]},{"id":"785f8a5b6f1f032b","type":"comment","z":"7545378c68ca4c77","name":"Schedule events","info":"","x":1120,"y":320,"wires":[]},{"id":"234af03cf7794583","type":"function","z":"7545378c68ca4c77","name":"","func":"var stored = flow.get(\"scheduleshutters\");\n\nif (stored == \"close\")\n{\n    if (msg.payload == \"manual open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"manual close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1360,"y":200,"wires":[["1e58700872bfd807","ad90dcea4a47fff6"]]},{"id":"7e2e77fe8e2373ca","type":"function","z":"7545378c68ca4c77","name":"","func":"var stored = flow.get(\"manualshutters\");\n\nif (stored == undefined)\n    stored = \"open\";\n    \n    if (msg.payload == \"schedule open\")\n    {\n        msg.payload = \"FORCE OPEN\";\n    }else\n    if (msg.payload == \"schedule close\" && stored == \"open\")\n    {\n        msg.payload = \"ABORTED\";\n    }else\n    if (msg.payload == \"schedule close\" && stored == \"close\")\n    {\n        msg.payload = \"FORCE CLOSE\";\n    }\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1370,"y":400,"wires":[["10319ae7de16bd5c","ad90dcea4a47fff6"]]},{"id":"10319ae7de16bd5c","type":"debug","z":"7545378c68ca4c77","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1590,"y":400,"wires":[]},{"id":"f487e63dbb1f1956","type":"change","z":"7545378c68ca4c77","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":500,"wires":[["5c434fb87d638a1c"]]},{"id":"afb334564e3580c8","type":"change","z":"7545378c68ca4c77","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":460,"wires":[["5c434fb87d638a1c"]]},{"id":"5ba1a2fbfbe3d81c","type":"change","z":"7545378c68ca4c77","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1100,"y":120,"wires":[["358bb728bbe26973"]]},{"id":"5aeb2b4e0ea3b01e","type":"change","z":"7545378c68ca4c77","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1100,"y":80,"wires":[["358bb728bbe26973","a40e2a9505ab9045"]]},{"id":"1e58700872bfd807","type":"debug","z":"7545378c68ca4c77","name":"To shutter control","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1590,"y":200,"wires":[]},{"id":"97985b3054bee056","type":"switch","z":"7545378c68ca4c77","name":"closed/open","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":180,"wires":[["5aeb2b4e0ea3b01e","f8ae120af96f6fba"],["5ba1a2fbfbe3d81c","948e50dfafa00c22"]]},{"id":"6f18486f53d1447c","type":"comment","z":"7545378c68ca4c77","name":"aquara doorsensor with open/closed state","info":"","x":580,"y":140,"wires":[]},{"id":"358bb728bbe26973","type":"change","z":"7545378c68ca4c77","name":"set flow","rules":[{"t":"set","p":"manualshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1360,"y":100,"wires":[["c8f5641c7e17c6a2"]]},{"id":"bed30f0183e3eefd","type":"comment","z":"7545378c68ca4c77","name":"opens/closes roller shutter at sunrise/sunset","info":"","x":570,"y":320,"wires":[]},{"id":"5c434fb87d638a1c","type":"change","z":"7545378c68ca4c77","name":"set flow","rules":[{"t":"set","p":"scheduleshutters","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1370,"y":480,"wires":[["fb75d9ee1ab311f6"]]},{"id":"ad90dcea4a47fff6","type":"switch","z":"7545378c68ca4c77","name":"ForceOpen/ForceClose/Aborted","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"FORCE OPEN","vt":"str"},{"t":"eq","v":"FORCE CLOSE","vt":"str"},{"t":"eq","v":"ABORTED","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1630,"y":300,"wires":[[],[],[]]},{"id":"c8f5641c7e17c6a2","type":"debug","z":"7545378c68ca4c77","name":"Not really needed (Manual)","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1620,"y":100,"wires":[]},{"id":"fb75d9ee1ab311f6","type":"debug","z":"7545378c68ca4c77","name":"Not really needed (Schedule)","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1620,"y":480,"wires":[]},{"id":"948e50dfafa00c22","type":"change","z":"7545378c68ca4c77","name":"Manual Open","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"manual","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":220,"wires":[["234af03cf7794583"]]},{"id":"f8ae120af96f6fba","type":"change","z":"7545378c68ca4c77","name":"Manual Close","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"manual","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":180,"wires":[["234af03cf7794583"]]},{"id":"f70cb80ed6f79bb5","type":"change","z":"7545378c68ca4c77","name":"Schedule Open","rules":[{"t":"set","p":"payload","pt":"msg","to":"schedule open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"schedule","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":420,"wires":[["7e2e77fe8e2373ca","f487e63dbb1f1956"]]},{"id":"86649a4f8a46f3e5","type":"change","z":"7545378c68ca4c77","name":"Schedule Close","rules":[{"t":"set","p":"payload","pt":"msg","to":"schedule close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"schedule","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":380,"wires":[["7e2e77fe8e2373ca","afb334564e3580c8"]]},{"id":"c43b5508148fc503","type":"inject","z":"7545378c68ca4c77","name":"Opened window","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual open","payloadType":"str","x":620,"y":80,"wires":[["5ba1a2fbfbe3d81c","948e50dfafa00c22"]]},{"id":"96ecf063b3579fab","type":"inject","z":"7545378c68ca4c77","name":"Closed window","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"manual","payload":"manual close","payloadType":"str","x":620,"y":40,"wires":[["5aeb2b4e0ea3b01e","f8ae120af96f6fba"]]},{"id":"7018f5ebb2e570ae","type":"inject","z":"7545378c68ca4c77","name":"At sunrise","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule open","payloadType":"str","x":640,"y":420,"wires":[["f70cb80ed6f79bb5"]]},{"id":"451c7cbb93f59684","type":"inject","z":"7545378c68ca4c77","name":"At sunset","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"schedule","payload":"schedule close","payloadType":"str","x":640,"y":380,"wires":[["86649a4f8a46f3e5"]]},{"id":"a40e2a9505ab9045","type":"change","z":"7545378c68ca4c77","name":"","rules":[{"t":"set","p":"manualshutters","pt":"flow","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":40,"wires":[["3ed7a55007473152"]]},{"id":"3ed7a55007473152","type":"trigger","z":"7545378c68ca4c77","name":"Indicator","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"2","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1620,"y":40,"wires":[[]]},{"id":"758e777e4ea9c19d","type":"file","z":"7545378c68ca4c77","name":"Schlafzimmersensor_state","filename":"/config/node-red/JsonDB/Schlafzimmersensor_state.json","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":680,"y":240,"wires":[[]]},{"id":"fc563b759f925ba0","type":"file in","z":"7545378c68ca4c77","name":"Schlafzimmersensor_state","filename":"/config/node-red/JsonDB/Schlafzimmersensor_state.json","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":400,"y":180,"wires":[["97985b3054bee056"]]},{"id":"ba9cbd6b2dacded8","type":"inject","z":"7545378c68ca4c77","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payloadType":"date","x":170,"y":180,"wires":[["fc563b759f925ba0"]]},{"id":"ee553bbf6476ddf0","type":"position-config","name":"Wienerstraße 95","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12","contextStore":""},{"id":"42c5021e.042e7c","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

Furthermore I modified the scheduled function from

var stored = flow.get("manualshutters");
if (stored == undefined)
    stored = "open";
if (stored == "open")
{

    if (msg.payload == "schedule open")
    {
        msg.payload = "FORCE OPEN";
    }else
    if (msg.payload == "schedule close" && stored == "open")
    {
        msg.payload = "ABORTED";
    }else
    if (msg.payload == "schedule close" && stored == "close")
    {
        msg.payload = "FORCE CLOSE";
    }
}
return msg;

to

var stored = flow.get("manualshutters");

if (stored == undefined)
    stored = "open";
    
    if (msg.payload == "schedule open")
    {
        msg.payload = "FORCE OPEN";
    }else
    if (msg.payload == "schedule close" && stored == "open")
    {
        msg.payload = "ABORTED";
    }else
    if (msg.payload == "schedule close" && stored == "close")
    {
        msg.payload = "FORCE CLOSE";
    }

return msg;

Now I believe it does exactly what I wanted... I will try this the next days. :slight_smile:

Good to hear.

The undefined problem is/was a problem. And I have to say I didn't help with it.

It is/was undefined because of the changed node that deleted it when the window was closed.

I have deleted the node in my latest post of the code.

Why was it put there?

I am stupid.
Plain and simple.

I forgot that just below it was another change node that set it to closed and so the problem was resolved anyway.

I added the node that deleted the flow.context for a very weird - and now unknown - reason.
It should never be there.

But!

I agree in what you did.
THE FIRST TIME the flow is run that value is undefined and setting it to open is a good idea. Fail safe.

Glad things have moved on to better.