Automation switch-off turns on after turning off

Automation fow switching off sometimes turns on after 1 second (see time 6.25 in log). Yaml included.
How can i solve this problem? Thank you

Log:
Ventilátor turned off triggered by automation Vytápění WC - vypnout triggered by time pattern

7:05:00 PM - 4 hours ago

Ventilátor turned on triggered by automation Vytápění WC - zapnout triggered by time pattern

7:00:00 PM - 4 hours ago

Ventilátor turned off triggered by automation Vytápění WC - vypnout triggered by time pattern

6:45:00 PM - 5 hours ago

Ventilátor turned on triggered by automation Vytápění WC - vypnout triggered by time pattern

6:25:01 PM - 5 hours ago

Ventilátor turned off triggered by automation Vytápění WC - vypnout triggered by time pattern

6:25:00 PM - 5 hours ago

Ventilátor turned on triggered by automation Vytápění WC - zapnout triggered by time pattern

6:20:00 PM - 5 hours ago

Yaml:

alias: Vytápění WC - vypnout
description: ""
triggers:
  - trigger: time_pattern
    minutes: "5"
  - trigger: time_pattern
    minutes: "25"
  - trigger: time_pattern
    minutes: "45"
conditions: []
actions:
  - action: switch.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: switch.jb_pg_10
mode: single

What is Vytápění WC - zapnout?

Please use the </> button when posting YAML.

alias: Vytápění WC - zapnout
description: ""
triggers:
  - trigger: time_pattern
    minutes: "0"
  - trigger: time_pattern
    minutes: "20"
  - trigger: time_pattern
    minutes: "40"
conditions:
  - condition: numeric_state
    entity_id: sensor.jb_33_teplota
    above: sensor.aqara_thp_2_teplota
    value_template: "{{ float(state.state) - 4 }}"
  - condition: device
    device_id: ce509b0d0f2344f3f4d6290803a3cf33
    domain: alarm_control_panel
    entity_id: 8f716771e3aad671e7ea5ae60c089cae
    type: is_disarmed
actions:
  - action: switch.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: switch.jb_pg_10
mode: single

Thanks for information about quoting the Yaml code - this is my first post to this forum.
I don’t understand why ventilator turns on 1 second after turning off, both triggered by automation turn_off

Agreed it doesn’t make sense. What is the switch hardware, and how is it connected to HA?

Can you download and post an automation trace that is from one of the turn_on events — or if there isn’t one, from the turn_off event just before?

The situation did not appear for two days, before it was approx. twice a day. Traces are not available for last error. So i will wait for next … Thank you a lot!