The condition from input.string is ignored during automation

The automation should cause the heating to switch on when the window contact is closed and the text “automatik_ein” is displayed in the helper status_warmepumpe:

alias: Fenster zu
description: ""
triggers:
  - type: not_opened
    device_id: c4261b568786d7816794ef85ed0cd124
    entity_id: 4bf67f61128044d0ca662576f1eb75e6
    domain: binary_sensor
    trigger: device
conditions:
  - condition: state
    entity_id: input_text.status_warmepumpe
    state: automatik_ein
actions:
  - device_id: 379195b498396227318415e2d64fa15a
    domain: climate
    entity_id: 45911bacafcdc6f2465a9e1c5c5de4e8
    type: set_hvac_mode
    hvac_mode: heat
mode: single

When executing the automation manually, the thermostat is always set to heating, regardless of what is specified in the helper.
Is this due to the manual execution?

Best regards
Volker

That’s the intended way yes.
It says run actions, and that’s what it does

Avoid using device id’s if ever possible. You used “Binary sensor” in he automation editor. Start again and select “Entity”. In the next screen you can choose your window contact, groups, or areas and set condition “closed”. This will generate this yaml:

triggers:
  - trigger: state
    entity_id:
      - binary_sensor.YOUR_FRIENDLY_NAME
    to:
      - "off"

This automation triggers when the status of your window is changing to closed. Testing would be done in the developers tools section where you can easily manually set any entitiy’s state without physicvally opening and closing the window.