Async and timer for custom component

Hi everyone,

we have covers in our home that can go up/down and stop. There is no position feature but … can I solve this with hass?

I was thinking about working with the time it takes to go from completely up to completely down (eg 30 seconds). If I start (in a custom component) a timer and if the time between start and stop is eg 15 seconds, than I know th cover is 50% open. I think my idea is feasible but I do not know enough Python to get it started in a async home-assistant custom component.

Can somebody help me or point me in the right direction (other component or so)?

TIA

M

Check out AppDaemon, it gives you an easy but flexible Python environment to develop in. You would probably listen to start/stop events, and use their timestamps to calculate the position.