This is excellent. And what is best, that it remembers state between HA restarts.
Now the problem is that my covers are RF based, and there are 3 separate RF codes needed for each cover: one for up, one for down and one for stop (the RF codes can be sent out through MQTT via an RF bridge running Tasmota). I tried making mqtt switch with ON state or up code and OFF state for stop code, and respectively for down/stop code, but it doesn’t work because when I hit up arrow in lovelace it just moves a bit then stops.
But looking through your code this can be modified easily.