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.
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.