Add 'opening'/'closing' to Tradfri cover state

since the tradfri covers (FYRTUR block-out roller blind) are either ‘open’ or ‘closed’, we need to resort to more complex templates to allow triggering automations or templates on the current_position.

Also, since these covers are very dynamic in the HA state machine, I would hope it to be possible to add ‘opening’ and ‘closing’ as state when applicable.

currently we need to resort to some intermediary entity to be able to set an icon like:


          if (entities['input_select.raamverduistering_stookhok'].state == 'Opening') return 'mdi:archive-arrow-up';
          if (entities['input_select.raamverduistering_stookhok'].state == 'Closing') return 'mdi:archive-arrow-down';
          if (attributes.current_position == 100) return 'mdi:window-shutter-open';
          if (state == 'closed') return 'mdi:window-shutter';
          return 'mdi:window-shutter-alert';

and use that JS template on a button.
eg Somfy Tahoma covers use the opening/closing, please consider syncing that behavior in the Tradfri covers?

thanks

What happens if you add the appropriate device class using customize?

https://www.home-assistant.io/integrations/cover/#device-class

thanks!
not a lot, state remains open/closed.
which is to be expected really, because those classes are merely a frontend thing are they?

Indeed they are. Sorry, misinterpreted your request.

dont be sorry! it was a great thought, and checking it made me notice those covers are the only ones without a device_class set.

Need to add that to the FR :wink:

1 Like