Identify position of cover/shutter - always reports open

I am unable to detect whether my shutter, controlled by a shelly 2pm is open or closed. In the template editor when I interogate the attributes:

{{ states.cover.roof_terrace_control_switch }}

I get this:

<template TemplateState(<state cover.roof_terrace_control_switch=open; 
current_position=-1,
device_class=shutter, 
icon=mdi:balcony, 
friendly_name=roof-terrace-control-switch, 
supported_features=15 @ 2024-06-29T10:23:17.717223+01:00>)>

<template DomainStates('cover')>

I’ve looked at cover.roof_terrace_control_switch=open which does change to ‘opening’ or ‘closing’ during movement. However, it returns to the ‘open’ state whether the shutters are either open or closed.

I’ve looked at current_position=-1. This doesn’t change at all, at any point.

I am trying to send a notification if we have forgotten to close the shutter at the end of the evening…and maybe in the future to even automatically close them but I need to detect whether open or closed. I looked into template covers but dismissed this because I’m only using one integration. Can anyone help point me to what I’m doing wrong please? Thanks.

{{ states("cover.roof_terrace_control_switch") }}

or (not recommended)

{{ states.cover.roof_terrace_control_switch.state }}

P.S.: Doesn’t answer the question, but nevertheless…

Thank you. I will remember that. It still returns open when it is closed :laughing: