Turn off heating when door open for some time

I want to turn off the heating in the bathroom when the door is open for some time, I’m using an aqara door sensor. The below automation should work according to this forum but it doesn’t.
I also want the heating to be switched off when it is put on (remotely) while the door is open.

alias: Verwarming badkamer uit wanneer de deur open staat
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.deur_badkamer
    attribute: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 10
condition: []
action:
  - service: climate.set_hvac_mode
    metadata: {}
    data:
      hvac_mode: "off"
    target:
      area_id: badkamer
mode: single

The only thing I see that I’m not used to is the area.
What happens if you replace that with entity of the TRV (or whatever you got there)?

Also what does the trace say?
Does it trigger? Error messages?

1 Like

@Hellis81 is spot on

target:
      entity_id: climate.your_thermostat
1 Like