Power on state Node Red

Dear folks, when I restart Node Red or restart my Pi running node red under Home assitant, some switches change state. From on to off.
I have noticed that there is tugging at a restart,

How can I ensure that the status remains as before the restart.

You can set that “in the nodes”

can you please explane ?

If the switch is not changed in Home assistant, Node red will use that state (unchanged thus). If you have a node red node, it depends on the node how you want it to react. E.g. to start or not start as on of off.

Edi: Else paste a picture of the switch and its configuration here that you are having trouble with.

You use toggle, and output on connect. That seems to toggle your state.

Yes that’s right. but otherwise i have to make 2 buds in ha. 1 for on and 1 for off.

Indeed, but now you toggle unwanted.