Automation without function

Hey, I’m completely new to HM.

My intention to install HM was to switch off my 3D printer after printing in connection with Octoprint and smart socket.

Therefore, I set the following automation in the settings, which is also active.

alias: 3D Drucker nach Druck ausschalten
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.octoprint_current_state
    from: Drucken
    to: Betriebsbereit
    for:
      hours: 0
      minutes: 10
      seconds: 0
condition:
  - condition: numeric_state
    entity_id: sensor.octoprint_actual_tool0_temp
    below: 145
action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.3d_drucker_socket_1
mode: single

But after a print is finished, nothing happens.

HM is running in Docker on a Synology Diskstation, and Octoprint and the socket are already integrated and working.

Can anyone give me some food for thought?

Did the automation trigger?
Are you sure the tool temperature was below 145?

Automations do not wait around for conditions to become true. If the conditions are not true immediately after the trigger fires, the automation will stop. If you need an automation to wait, use one of the available Wait actions

alias: 3D Drucker nach Druck ausschalten
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.octoprint_current_state
    from: Drucken
    to: Betriebsbereit
    for:
      hours: 0
      minutes: 10
      seconds: 0
condition: []
action:
  - wait_for_trigger:
      - platform: numeric_state
        entity_id: sensor.octoprint_actual_tool0_temp
        below: 145
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.3d_drucker_socket_1
mode: single

Or turn it around. Trigger by temperature and use the state as condition.