Customize window sensor

I have a simple entity card to show me the status of a window sensor and it works just fine showing the right values when I open and close the window with the proper icon toggle.

Now I would like to customize it in order to chose other icons then the ones by default and also to change the status text to another thing than “open/close”. But despite my multiple tries I had no success. Can anyone explain me how to do it please?

I first tried creating another sensor:
image

Then tried using the customization:
image

But unfortunately any of this solutions worked for me.

Thanks in advance!

Pleas don’t post images of text. We can’t easily copy and edit them. Post correctly formatted text using code blocks. See point 11 here: How to help us help you - or How to ask a good question

The first line of you icon template is missing “if” in {% if is_state(...