Detect if cover is in motion

Hi there,

my wife asked me if it possible to animate an icon in the ui if the correspondig cover is moving.

So now i am looking for a solution to detect motion of a cover. My first idea is to detect the change in the position of the shutter. Like: If the position does not change for more than 5 seconds the cover is not moving.

Unfortunately i have no idea how to implement that.

Any help is apprciated.