Changing iconS (closed and open) of contact sensor

I have a Tuya contact sensor (which shows as “Door”) I am using for my gate.
In the entity settings, I can set one icon (e.g. the gate icon).

How can I set the gate such that it shows the closed gate (mdi:gate-alert) when the state is closed and an open gate (mdi:gate) when the gate is open?

PS: Hopefully this works without having to define a new (template) sensor and digging deep into yaml as I am not very comfortable with it…

You could create a template cover with a gate device class.

Hmm, I see but that would make a cover out of it and adding the commands. While the commands could just do nothing I feel it’s not semantically correct.

I think I might be able to create a binary sensor template, but this creates an additional entity and I was not able to create the correct YAML ; I do not have too much experience working with Yaml code directly. And I was hoping that there is a straight forward way to do this since it feels like something very common…

Yeah, I see what you mean about the commands if it is only a sensor.

Unfortunately the way binary_sensors are displayed is controlled with device classes. And while there are quite a few binary sensor device classes they do not cover all use cases. e.g. There is no gate. So you might like to vote here:

https://community.home-assistant.io/t/custom-device-classes/368238

Thanks, voted!