Binary Sensor last known state when unavailable

Hello,

I tried applying this solution to my problem, but it’s not working properly:

configuration.yaml entry:
#…
recorder:
#…
input_text:
wohnzimmer_temperatur_most_recent:
name: Last known value of sensor.wohnzimmer_temperatur

automations.yaml entry:
- alias: Record state of sensor.wohnzimmer_temperatur
trigger:
platform: state
entity_id: sensor.wohnzimmer_temperatur
condition:
condition: template
value_template: >
{{ trigger.to_state.state not in [trigger.from_state.state, ‘unavailable’] }}
action:
service: input_text.set_value
entity_id: input_text.wohnzimmer_temperatur_most_recent
data_template:
value: “{{ trigger.to_state.state }}”

How do I get input_text to know the last known state of my sensor.wohnzimmer_temperatur? I supposed via the record: component, but I’m missing the point to connect both components.

BTW: The </> Button seems not to work for me?