<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Home Assistant Automation vereinfachen? (YAML)]]></title><description><![CDATA[<p>Moin, ich finde die Syntax von HA teils extrem schwer überprüfbar, aber vielleicht ist das auch nur Gewöhnungssache.</p>
<p>Was möchte ich?</p>
<p>Es ist Winter und neben einer Tür steht ein Temperatursensor. Wenn ich die Tür öffne, wird es innen kälter (da Winter ist, und die Außentemperatur kleiner ist als die Innentemperatur). Daraufhin soll eine LED automatisch eingeschaltet werden. Danach und wenn ich die Tür wieder schließe, wird es innen nicht mehr kälter und die LED soll wieder ausgeschaltet werden.</p>
<p>Vice versa, wenn es Sommer ist (die Innentemperatur ist dann kleiner und es wird wärmer, wenn die Tür geöffnet wird).</p>
<p>Was ist das Problem?</p>
<p>Die Automation startet bei jeder Temperaturänderung des Türsensors. Das ist so weit in Ordnung. Aber ich möchte einen Early-Stop erreichen: Wenn der Threshold gar nicht erreicht wird und die LED nicht eingeschaltet ist, dann soll auch gar nichts passieren. Und ich weiß nicht, ob es auch so etwas wie globale Automation-States gibt.</p>
<p>Die LED soll eben nicht unnötig oft ein- und ausgeschaltet werden oder &quot;angefunkt&quot; werden, obwohl nix ist.</p>
<pre><code class="language-plain">alias: Dyn Temp Shift Door
description: Automatically adjusts the sensitivity based on the temperature difference.
triggers:
  - trigger: state
    entity_id: sensor.temp_shift_door
actions:
  - variables:
      temp_innen_1: '{{ states(''sensor.temp_combi'') | float(24) }}'
      temp_innen_2: '{{ states(''sensor.wohnzimmer_tp357_klein_temperature'') | float(24) }}'
      temp_aussen: '{{ states(''sensor.aktuelle_wetter_temperatur'') | float(15) }}'
      temp_shift_door: '{{ states(''sensor.temp_shift_door'') | float(0) }}'
      delta: '{{ max((temp_innen_2 - temp_aussen) | abs, 4) }}'
      threshold: '{{ 0.01 + (delta * 0.005) }}'
  - choose:
      - conditions:
          - condition: template
            value_template: '{{ temp_innen_1 &gt;= temp_aussen }}'
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: '{{ temp_shift_door &lt; (threshold * -1) }}'
                sequence:
                  - action: light.turn_on
                    target:
                      entity_id: light.tapo_l530_balkon
              - conditions:
                  - condition: template
                    value_template: '{{ temp_shift_door &gt; 0.01 }}'
                  - condition: state
                    entity_id: light.tapo_l530_balkon
                    state: 'on'
                sequence:
                  - action: light.turn_off
                    target:
                      entity_id: light.tapo_l530_balkon
      - conditions:
          - condition: template
            value_template: '{{ temp_innen_1 &lt; temp_aussen }}'
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: '{{ temp_shift_door &gt; threshold }}'
                sequence:
                  - action: light.turn_on
                    target:
                      entity_id: light.tapo_l530_balkon
              - conditions:
                  - condition: template
                    value_template: '{{ temp_shift_door &lt; -0.01 }}'
                  - condition: state
                    entity_id: light.tapo_l530_balkon
                    state: 'on'
                sequence:
                  - action: light.turn_off
                    target:
                      entity_id: light.tapo_l530_balkon

</code></pre>
<p>temp_combi ist ein Kombinationssensor aus allen Temperatursensoren im Raum (arithmetisches Mittel, ändert sich kaum, wenn die Tür geöffnet wird), tp357 ist der Türsensor und temp_shift_door ist die Ableitung des Türsensors.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/355490/home-assistant-automation-vereinfachen-yaml</link><generator>RSS for Node</generator><lastBuildDate>Fri, 28 Aug 2026 13:27:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/355490.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Aug 2026 08:03:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Home Assistant Automation vereinfachen? (YAML) on Fri, 28 Aug 2026 08:03:58 GMT]]></title><description><![CDATA[<p>Moin, ich finde die Syntax von HA teils extrem schwer überprüfbar, aber vielleicht ist das auch nur Gewöhnungssache.</p>
<p>Was möchte ich?</p>
<p>Es ist Winter und neben einer Tür steht ein Temperatursensor. Wenn ich die Tür öffne, wird es innen kälter (da Winter ist, und die Außentemperatur kleiner ist als die Innentemperatur). Daraufhin soll eine LED automatisch eingeschaltet werden. Danach und wenn ich die Tür wieder schließe, wird es innen nicht mehr kälter und die LED soll wieder ausgeschaltet werden.</p>
<p>Vice versa, wenn es Sommer ist (die Innentemperatur ist dann kleiner und es wird wärmer, wenn die Tür geöffnet wird).</p>
<p>Was ist das Problem?</p>
<p>Die Automation startet bei jeder Temperaturänderung des Türsensors. Das ist so weit in Ordnung. Aber ich möchte einen Early-Stop erreichen: Wenn der Threshold gar nicht erreicht wird und die LED nicht eingeschaltet ist, dann soll auch gar nichts passieren. Und ich weiß nicht, ob es auch so etwas wie globale Automation-States gibt.</p>
<p>Die LED soll eben nicht unnötig oft ein- und ausgeschaltet werden oder &quot;angefunkt&quot; werden, obwohl nix ist.</p>
<pre><code class="language-plain">alias: Dyn Temp Shift Door
description: Automatically adjusts the sensitivity based on the temperature difference.
triggers:
  - trigger: state
    entity_id: sensor.temp_shift_door
actions:
  - variables:
      temp_innen_1: '{{ states(''sensor.temp_combi'') | float(24) }}'
      temp_innen_2: '{{ states(''sensor.wohnzimmer_tp357_klein_temperature'') | float(24) }}'
      temp_aussen: '{{ states(''sensor.aktuelle_wetter_temperatur'') | float(15) }}'
      temp_shift_door: '{{ states(''sensor.temp_shift_door'') | float(0) }}'
      delta: '{{ max((temp_innen_2 - temp_aussen) | abs, 4) }}'
      threshold: '{{ 0.01 + (delta * 0.005) }}'
  - choose:
      - conditions:
          - condition: template
            value_template: '{{ temp_innen_1 &gt;= temp_aussen }}'
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: '{{ temp_shift_door &lt; (threshold * -1) }}'
                sequence:
                  - action: light.turn_on
                    target:
                      entity_id: light.tapo_l530_balkon
              - conditions:
                  - condition: template
                    value_template: '{{ temp_shift_door &gt; 0.01 }}'
                  - condition: state
                    entity_id: light.tapo_l530_balkon
                    state: 'on'
                sequence:
                  - action: light.turn_off
                    target:
                      entity_id: light.tapo_l530_balkon
      - conditions:
          - condition: template
            value_template: '{{ temp_innen_1 &lt; temp_aussen }}'
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: '{{ temp_shift_door &gt; threshold }}'
                sequence:
                  - action: light.turn_on
                    target:
                      entity_id: light.tapo_l530_balkon
              - conditions:
                  - condition: template
                    value_template: '{{ temp_shift_door &lt; -0.01 }}'
                  - condition: state
                    entity_id: light.tapo_l530_balkon
                    state: 'on'
                sequence:
                  - action: light.turn_off
                    target:
                      entity_id: light.tapo_l530_balkon

</code></pre>
<p>temp_combi ist ein Kombinationssensor aus allen Temperatursensoren im Raum (arithmetisches Mittel, ändert sich kaum, wenn die Tür geöffnet wird), tp357 ist der Türsensor und temp_shift_door ist die Ableitung des Türsensors.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2625160</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2625160</guid><dc:creator><![CDATA[Anon-81275]]></dc:creator><pubDate>Fri, 28 Aug 2026 08:03:58 GMT</pubDate></item><item><title><![CDATA[Reply to Home Assistant Automation vereinfachen? (YAML) on Fri, 28 Aug 2026 13:04:42 GMT]]></title><description><![CDATA[<p>Hab's übersichtlicher hinbekommen, und auch einen Fehler behoben, glaube ich:</p>
<pre><code class="language-plain">alias: Dyn Temp Shift Door
description: Automatically adjusts the sensitivity based on the temperature difference.
triggers:
  - trigger: state
    entity_id: sensor.temp_shift_door
actions:
  - variables:
      temp_innen_1: '{{ states(''sensor.temp_combi'') | float(24) }}'
      temp_innen_2: '{{ states(''sensor.wohnzimmer_tp357_klein_temperature'') | float(24) }}'
      temp_aussen: '{{ states(''sensor.aktuelle_wetter_temperatur'') | float(15) }}'
      temp_shift_door: '{{ states(''sensor.temp_shift_door'') | float(0) }}'
      is_winter: '{{ temp_aussen &lt; temp_innen_1 }}'
      delta: '{{ (temp_aussen - temp_innen_1) | abs }}'
      threshold: '{{ (-1.0 if is_winter else 1.0) * (0.03 + (delta * 0.005)) }}'
  - choose:
      - conditions:
          - condition: state
            entity_id: light.tapo_l530_balkon
            state: 'off'
          - condition: template
            value_template: &gt;-
              {{ (is_winter and temp_shift_door &lt; threshold) or (not is_winter
              and temp_shift_door &gt; threshold) }}
        sequence:
          - action: light.turn_on
            target:
              entity_id: light.tapo_l530_balkon
      - conditions:
          - condition: state
            entity_id: light.tapo_l530_balkon
            state: 'on'
          - condition: template
            value_template: &gt;-
              {{ (is_winter and temp_shift_door &gt; 0.01) or (not is_winter and
              temp_shift_door &lt; -0.01) }}
        sequence:
          - action: light.turn_off
            target:
              entity_id: light.tapo_l530_balkon

</code></pre>
<p>temp_innen_2 braucht man, glaube ich, gar nicht, da dieser Wert ja schon in temp_shift_door ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2625164</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2625164</guid><dc:creator><![CDATA[Anon-81275]]></dc:creator><pubDate>Fri, 28 Aug 2026 13:04:42 GMT</pubDate></item></channel></rss>