Short version: Is there a way to make a single button call the ‘cover.toggle’ service when the cover (a blind in this case) isn’t moving, but tell the blind to stop moving when pressed when it is moving?
Long version: I bought a couple of Ikea tradfri buttons – an N2 (4-button) and a tradfri shortcut button. I’d like to use the shortcut button as a super-simple local controller for the motor I’ve attached to a vertical blind, but as the blind is across a bifold door, a lot of the time we only need the blind to open ⅓ of the way (to expose the first pane of the door). I could use the 4-way button and bind open, close and stop (or indeed a preset position) to three of the four buttons but I was wondering if there’s a way to make the simple shortcut button toggle open and close when the blind is still, but to work as a ‘stop’ command if the blind is currently moving.
Late yesterday I did some further experimenting (using the visual ui) and I suspect that most of my blinds (which are controlled via the Motion Blinds integration) don’t seem to report their current state while they’re in motion, but I’ll try using your code later today as it’s entirely possibly I misunderstood the ui.