Add attributes 'opening' / 'closing' to Ikea Tradfri covers

trying to show the frontend the Ikea covers are moving, we find there is no attribute ‘opening’ or ‘closing’.

Having tried to template that based on last_changed, tells us this only changes from opening to closing, and (not vice versa, and) not in between.

I have also tried the trend binary sensor, but that only changes when an actual motion is started, again, not when stopped…

see: How to template a 'covering' cover

so, please consider adding the attribute in core, to allow the frontend to show ‘Opening’, and ‘Closing’.

thanks!

I think that can be achieved just implementing two properties: is_opening(self) and is_closing(self).

Maybe tracking current position against the set_position value you can determinate if cover is opening or closing:

    @property
    def is_opening(self):
        return set_position_value > self._device_data.current_cover_position


    @property
    def is_closing(self):
        return set_position_value < self._device_data.current_cover_position

The set_position_value value will need to be ‘stored’ to compare against.
Also, the value need to be updated in every call to open, close & stop cover.

could you please post that at the bug issue https://github.com/home-assistant/core/issues/37223, maybe the author of the integration can assist

Done :ok_hand:

1 Like