Restore position of cover not working as expected with restore_from_flash

Hi,

I’m having an issue with the restoring the state of a cover (sun blind).

On the time_based cover component page it is still stated:
The state of the cover can be restored from flash after a node reboot, with esp8266_restore_from_flash: true option set. See [esp8266_restore_from_flash]

I then found that this option is no longer valid and it should be this:

esp8266:
  board: nodemcuv2
  restore_from_flash: True

The restored position of the cover is still always 50% open with this option active.

I’ve searched the forums and found this post about the same problem:

The thread is closed with this final comment:
FINAL EDIT : enabling esp8266_restore_from_flash all the automations that i added to manage globals (and even globals too) are unnecessary: cover position is natively saved through reboots.

It seems that the transition from esp8266_restore_from_flash to restore_from_flash has broken the expected behaviour in my use-case.

One thing that I’m not sure of is if there is a restore_mode option involved but as far as I can tell this is for GPIO pin states and not for remembering the position of a cover. The board does not have to do anything upon booting, it just has to know the value of the cover postion and adapt the opening and closing time in seconds to that value. This seems to be all included in the cover code but it is just not working for me.

Any advice or tips are greatly appreciated. Thank you!

Mkt

This is my first question here and I’m surprised that there are no responses while the forum seems very active (tons of later questions have been answered).

Is this because my question is not as it should be or because no-one knows the answer?

Thank you.

I think it’s probably because people don’t know.

For more unique issues it can take time.

If you don’t get bites here after a few days you can also try the ESPHome Discord (see ESPHome webpage).

Posting your full config won’t hurt.

1 Like

You could try converting it to a Feedback cover and see if the issue remains?

I’ve found the issue.

assumed_state: False
This option was the culprit. After removing that the state of the cover is restored upon booting the board.

The penny dropped when I read that assumed_state is always true in a time-based cover so I guess this option is not meant to be used and causes problems like this.

1 Like

Good on you for sharing back the solution!