Recorder - Switch State after Restart

Hi,
I tried to find a solution online for a while, but I can’t find the issue.

I have some switches and I want them to keep the state even after reboot.
My config is following:

switch:
  - platform: mcp23017
    i2c_address: 0x20
    pins:
      0: Relais1
      1: Relais2
      2: Relais3
      3: Relais4
      4: Relais5
      5: Relais6
      6: Relais7

recorder:
  include:
    entities:
      - switch.relais1
      - switch.relais2
      - switch.relais3
      - switch.relais4
      - switch.relais5
      - switch.relais6
      - switch.relais7

But the switches get turned off during start-up. Is there something wrong?