Using Automation AND manual actions at same time?

Hi there,

i am using some automations for switching some stuff on when i am at home. That is simple and working without problems.
´´´
alias: Anwesend_Heizung_Wohnzimmer_an
description: ‘’
trigger:

  • platform: state
    to: ‘on’
    entity_id: binary_sensor.moritz
    condition: []
    action:
  • service: script.heizung_an
    data: {}
    mode: single
    ´´´
    Here is the Problem: If i want to switch off the “thing” manually, its workin for some secondes. The automation is switching it on again.

How can i solve that?

When you turn off the device manually, you want to prevent the automation from turning it back on. For how long should the automation be suspended?

So the binary_sensor.moritz changes its state to “on”, triggers the automation and calls the script to turn on the heating as the action.

If you want to switch it off manually you either have to change to state of the binary_sensor.moritz to “off” (so it does not trigger the script again again) or you can make use of a binary helper like “auto-heating”: When you press the switch to turn off the heating add an action to set the helper to “off”
Then add a condition to only continue when “auto-heating” is set to on.