Last binary sensor state

Hi,
read quite a few posts on the matter without ‘ZE’ answer.
Ok, so, i have some binary sensors (door open close aqara through DECONZ). They work properly and I have them in lovelace. so far so good

So I see here that my door is closed (and it really is closed).
Closed is the last ‘known’ state so in Home assistant, somewhere the value closed for that binary sensor is stored.
the problem is that when I try to notify on the the state of this sensor, it gives me ‘unknown’ and not closed.
I understand that through some yalm I could create another binary sensor that stores the known states of that sensor and then I could have like this the last state value of the sensor but that is a bit too bad, not to say stupid… considering that HA already knwos what that is because… it displays it to me already.

do you know how I could retreive the state that is displayed in this picture instead of unknown?
thanks

najot36

Welcome to the forums, najot!

Please post your automation (what you have so far).

Technically speaking, it’s the entity’s current state and it’s in Home Assistant’s state-machine.

If you want the entity’s current state, use the states() function in a template.

{{ states('binary_sensor.porte_garage') }}

Reference: Templating - States