EVCC spricht Home Assistant: So einfach geht’s jetzt mit HACS Integration 🚗⚡

YouTube player

Mit EVCC und Home Assistant wird das Management deines Elektroautos einfacher als je zuvor! 🚗⚡ In diesem Video zeige ich dir, wie du EVCC mit HACS und dem passenden Add-On in Home Assistant integrieren kannst. Egal ob Ladeplanung, Energieoptimierung oder smarte Automatisierungen – mit dieser Anleitung holst du das Maximum aus deinem Smart Home heraus. Schau rein und erfahre, wie simpel die Einrichtung wirklich ist!

HACS Integration: GitHub – marq24/ha-evcc: Home Assistant integration for evcc☀️🚘- optimized charging of electric vehicles, connecting your EV charger with your PV system. The integration use local polling (interval configurable) of the evcc API. Please note, that this integration is not official and not supported by the evcc developers. This project is not affiliated with evcc in any way.

Wichtiger Hinweis !: Im Video habe ich an der Stelle 6:03 benannt, dass ihr die IP Eures Home Assistant Servers (mit dem Port 7070) angeben sollt. Dies ist korrekt, wenn Ihr zusätzlich das HomeAssistant EVCC Addon installiert habt. Sollte Euere EVCC Installation nicht innerhalb von Home Assistant laufen, müsst Ihr hier die Adresse, unter der die EVCC Weboberfläche bei Euch im Netzwerk zu erreichen ist, eintragen. Nochmals der Hinweis, bevor ihr diese Integration über HACS hinzufügt, müsst Ihr EVCC bei Euch installiert haben (hier der link zum Video).

Code zum Bonus im Video:

Hinweis ! Die Entitäten müsst ihr mit den Namen eurer Entitäten im YAML Code ersetzen
Template Sensor Helfer „evcc_Tariff_Level“

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
{% set current_time = now().replace(minute=0, second=0, microsecond=0) %}
{% set rates = state_attr('sensor.evcc_tariff_forecast', 'result')['rates'] %}
{% set future_rates = rates | selectattr('start', '>=', current_time.isoformat()) | list %}
{% if future_rates | length > 0 %}
{% set prices = future_rates | map(attribute='price') | list %}
{% set avg_price = prices | average(0) %}
{% set min_price = prices | min(0) %}
{% set max_price = prices | max(0) %}
{% set current_price = states('sensor.evcc_tariff_grid_2') | float(0) %}
{# Definiere den Schwellenwert in Prozent (z.B. 80%) #}
{% set threshold_percent = 10 %}
{# Berechne den Preisunterschied basierend auf dem Schwellenwert #}
{% set price_diff = avg_price * (threshold_percent / 100) %}
{# Kategorisiere den aktuellen Preis basierend auf der Berechnung #}
{% if current_price < (avg_price - price_diff) %}
günstig
{% elif current_price > (avg_price + price_diff) %}
teuer
{% else %}
mittel
{% endif %}
{% else %}
unbekannt
{% endif %}
{% set current_time = now().replace(minute=0, second=0, microsecond=0) %} {% set rates = state_attr('sensor.evcc_tariff_forecast', 'result')['rates'] %} {% set future_rates = rates | selectattr('start', '>=', current_time.isoformat()) | list %} {% if future_rates | length > 0 %} {% set prices = future_rates | map(attribute='price') | list %} {% set avg_price = prices | average(0) %} {% set min_price = prices | min(0) %} {% set max_price = prices | max(0) %} {% set current_price = states('sensor.evcc_tariff_grid_2') | float(0) %} {# Definiere den Schwellenwert in Prozent (z.B. 80%) #} {% set threshold_percent = 10 %} {# Berechne den Preisunterschied basierend auf dem Schwellenwert #} {% set price_diff = avg_price * (threshold_percent / 100) %} {# Kategorisiere den aktuellen Preis basierend auf der Berechnung #} {% if current_price < (avg_price - price_diff) %} günstig {% elif current_price > (avg_price + price_diff) %} teuer {% else %} mittel {% endif %} {% else %} unbekannt {% endif %}
{% set current_time = now().replace(minute=0, second=0, microsecond=0) %}
{% set rates = state_attr('sensor.evcc_tariff_forecast', 'result')['rates'] %}
{% set future_rates = rates | selectattr('start', '>=', current_time.isoformat()) | list %}
{% if future_rates | length > 0 %}
  {% set prices = future_rates | map(attribute='price') | list %}
  {% set avg_price = prices | average(0) %}
  {% set min_price = prices | min(0) %}
  {% set max_price = prices | max(0) %}
  {% set current_price = states('sensor.evcc_tariff_grid_2') | float(0) %}
    {# Definiere den Schwellenwert in Prozent (z.B. 80%) #}
  {% set threshold_percent = 10 %}
  
  {# Berechne den Preisunterschied basierend auf dem Schwellenwert #}
  {% set price_diff = avg_price * (threshold_percent / 100) %}

  {# Kategorisiere den aktuellen Preis basierend auf der Berechnung #}
  {% if current_price < (avg_price - price_diff) %}
     günstig
  {% elif current_price > (avg_price + price_diff) %}
     teuer
  {% else %}
     mittel
  {% endif %}
  
{% else %}
    unbekannt
{% endif %}

Bonus Automatisierung:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: EVCC_Speicherladung
description: ""
triggers:
- entity_id:
- sensor.evcc_battery_soc_2
for:
minutes: 1
trigger: state
- entity_id:
- sensor.evcc_tariff_level
for:
minutes: 1
trigger: state
- entity_id:
- sensor.solcast_pv_forecast_prognose_verbleibende_leistung_heute
for:
minutes: 1
trigger: state
- trigger: state
entity_id:
- sensor.evcc_tariff_grid_2
for:
hours: 0
minutes: 1
seconds: 0
conditions: []
actions:
- if:
- condition: or
conditions:
- condition: state
entity_id: sensor.evcc_tariff_level
state: mittel
- condition: state
entity_id: sensor.evcc_tariff_level
state: teuer
- condition: numeric_state
entity_id: sensor.evcc_battery_soc_2
above: 99
- condition: numeric_state
entity_id: sensor.solcast_pv_forecast_prognose_verbleibende_leistung_heute
above: 10
then:
- action: number.set_value
data:
value: "0.0"
target:
entity_id: number.evcc_battery_grid_charge_limit
else:
- if:
- condition: and
conditions:
- condition: state
entity_id: sensor.evcc_tariff_level
state: günstig
for:
minutes: 1
- condition: numeric_state
entity_id: >-
sensor.solcast_pv_forecast_prognose_verbleibende_leistung_heute
below: 10
- condition: numeric_state
entity_id: sensor.evcc_battery_soc_2
below: 100
then:
- action: number.set_value
data:
value: "{{ states('sensor.evcc_tariff_grid_2') | float(0) }}"
target:
entity_id: number.evcc_battery_grid_charge_limit
- action: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.test_speicherladung
else:
- action: number.set_value
data:
value: "0.0"
target:
entity_id: number.evcc_battery_grid_charge_limit
mode: single
alias: EVCC_Speicherladung description: "" triggers: - entity_id: - sensor.evcc_battery_soc_2 for: minutes: 1 trigger: state - entity_id: - sensor.evcc_tariff_level for: minutes: 1 trigger: state - entity_id: - sensor.solcast_pv_forecast_prognose_verbleibende_leistung_heute for: minutes: 1 trigger: state - trigger: state entity_id: - sensor.evcc_tariff_grid_2 for: hours: 0 minutes: 1 seconds: 0 conditions: [] actions: - if: - condition: or conditions: - condition: state entity_id: sensor.evcc_tariff_level state: mittel - condition: state entity_id: sensor.evcc_tariff_level state: teuer - condition: numeric_state entity_id: sensor.evcc_battery_soc_2 above: 99 - condition: numeric_state entity_id: sensor.solcast_pv_forecast_prognose_verbleibende_leistung_heute above: 10 then: - action: number.set_value data: value: "0.0" target: entity_id: number.evcc_battery_grid_charge_limit else: - if: - condition: and conditions: - condition: state entity_id: sensor.evcc_tariff_level state: günstig for: minutes: 1 - condition: numeric_state entity_id: >- sensor.solcast_pv_forecast_prognose_verbleibende_leistung_heute below: 10 - condition: numeric_state entity_id: sensor.evcc_battery_soc_2 below: 100 then: - action: number.set_value data: value: "{{ states('sensor.evcc_tariff_grid_2') | float(0) }}" target: entity_id: number.evcc_battery_grid_charge_limit - action: input_boolean.turn_on metadata: {} data: {} target: entity_id: input_boolean.test_speicherladung else: - action: number.set_value data: value: "0.0" target: entity_id: number.evcc_battery_grid_charge_limit mode: single
alias: EVCC_Speicherladung
description: ""
triggers:
  - entity_id:
      - sensor.evcc_battery_soc_2
    for:
      minutes: 1
    trigger: state
  - entity_id:
      - sensor.evcc_tariff_level
    for:
      minutes: 1
    trigger: state
  - entity_id:
      - sensor.solcast_pv_forecast_prognose_verbleibende_leistung_heute
    for:
      minutes: 1
    trigger: state
  - trigger: state
    entity_id:
      - sensor.evcc_tariff_grid_2
    for:
      hours: 0
      minutes: 1
      seconds: 0
conditions: []
actions:
  - if:
      - condition: or
        conditions:
          - condition: state
            entity_id: sensor.evcc_tariff_level
            state: mittel
          - condition: state
            entity_id: sensor.evcc_tariff_level
            state: teuer
          - condition: numeric_state
            entity_id: sensor.evcc_battery_soc_2
            above: 99
          - condition: numeric_state
            entity_id: sensor.solcast_pv_forecast_prognose_verbleibende_leistung_heute
            above: 10
    then:
      - action: number.set_value
        data:
          value: "0.0"
        target:
          entity_id: number.evcc_battery_grid_charge_limit
    else:
      - if:
          - condition: and
            conditions:
              - condition: state
                entity_id: sensor.evcc_tariff_level
                state: günstig
                for:
                  minutes: 1
              - condition: numeric_state
                entity_id: >-
                  sensor.solcast_pv_forecast_prognose_verbleibende_leistung_heute
                below: 10
              - condition: numeric_state
                entity_id: sensor.evcc_battery_soc_2
                below: 100
        then:
          - action: number.set_value
            data:
              value: "{{ states('sensor.evcc_tariff_grid_2') | float(0) }}"
            target:
              entity_id: number.evcc_battery_grid_charge_limit
          - action: input_boolean.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: input_boolean.test_speicherladung
        else:
          - action: number.set_value
            data:
              value: "0.0"
            target:
              entity_id: number.evcc_battery_grid_charge_limit
mode: single

Blogbeitrag und Youtube Video zum Thema dynamischen Strompreis aus EVCC auslesen.

Home Assistant: EVCC-Daten zu dynamischen Strompreisen auslesen, visualisieren und damit rechnen – smarthome & more

Ulanzi✨ Home Assistant – Awtrix 3/Ulanzi TC001 ❤️ – So funktioniert die perfekte Interaktion 🎛️🚀Ulanzi

Diese Uhr ist nicht nur ein stilvolles Accessoire, sondern auch ein wahres Multitalent im Smart Home. Dank ihrer nahtlosen Integration in Home Assistant kannst du die Ulanzi TC001 ganz nach deinen Wünschen anpassen und automatisieren. Stell dir vor, wie sie dir nicht nur die Uhrzeit anzeigt, sondern auch aktuelle Wetterdaten in lebendigen Animationen präsentiert oder dich rechtzeitig an deine nächsten Termine erinnert. Lass deiner Kreativität freien Lauf und gestalte deine Uhr mit individuellen Designs, die deine Persönlichkeit widerspiegeln. Die Ulanzi TC001 Smart Pixel Uhr ist der Schlüssel, um dein Zuhause intelligenter und stilvoller zu machen. Entdecke die unendlichen Möglichkeiten der modernen Technologie und verwandle dein Zuhause in einen Ort, der sowohl funktional als auch ästhetisch ansprechend ist – mit der Ulanzi TC001 wird jeder Tag zu einem besonderen Erlebnis!

In meinem Video habe ich die Installation von awtrix 3 auf dem Pixel Display nicht vorgestellt. Bei mir geht es um die Kommunikation mit awtrix 3 und Home Assistant. Und zwar ohne dem teilweise bekannten Memory Leak.

Matthias vom Kanal haus:automation hat den Installationsvorgang und das Produkt sehr gut erklärt, so dass ich gerne darauf verweise:
https://youtu.be/hsc_yUWwcVY?si=EMikkCt64jbqckt7

Bis zur Nacht vor der Veröffentlichung lag mir auch noch kein Affiliate Link vor. Aber nach nun einigen Wochen Wartezeit habe auch ich tatsächlich einen Link erhalten, wo ihr das Produkt erwerben könnt. Lag wohl doch nicht an der Kanalgröße 🙂

Die Uhr bekommt ihr hier: Ulanzi TV001 smarte Pixel Uhr *

Für die Kommunikation mit dem Pixeldisplay habe ich im Video mehrere Skripte vorgestellt.

Bei der Entwicklung, dem Code und auch beim Bugfixing habe ich mit @Herr Spiegelmann ( Moderator auf meinem Discord Server ) eng zusammengearbeitet. Auch an dieser Stelle meinen herzlichen Dank für die sehr angenehme und konstruktive Zusammenarbeit.

  • awtrix – new app
  • awtrix – delete app
  • awtrix – indicator
  • awtrix – power off
  • awtrix – power on
  • awtrix – reboot

Icons für das Display lassen sich auf der Seite LaMetric Icon Gallery herunterladen. Im Video wurden folgende Icon Numbers verwendet:

  • 3813 – für Tibber
  • 37323 – für PV Leistung
  • 2422 – für Aussentemperatur
  • 389 – für SOC des Hausspeichers
  • 974 – für Youtube Views und Likes
  • 56166 – für Gelbe Tonne
  • 12155 – für Graue Tonne
  • 56626 – für Grüne Tonne

!Hinweis vom 24.01.2025!

Ab der Version 0.97 funktionieren die LaMetrics Icon´s wieder.

Zur Müllanzeige gibt es im Video vom 24.01.2025 ( Veröffentlichungszeitpunkt 17:00 Uhr ) ein Update zum Thema. Ihr findet das Video unter: https://youtu.be/3jxeRZBt4u4

!Hinweis vom 16.12.2024!

Aktuell lässt sich in der awtrix Weboberfläche von LaMetrics kein Icon auf das Display laden. Aber es gibt eine alternative Lösung. Blueforcer , der Entwickler von awtrix 3 hat eine App für Android und IPhone entwickelt, wo ihr auch eine Icon Gallerie zur Verfügung gestellt bekommt und die Icons direkt auf das Display laden könnt. Die App kostet für iOs weniger als 4€ ( Stand: 16.12.2024), was ich für den Funktionsumfang für absolut gerechtfertigt halte. Es gilt zu beachten, wenn man die Icons von awtrix verwendet, dann müssen die Icon ID´s angepasst werden.

awtrix – new app

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: awtrix - new app
sequence:
- action: mqtt.publish
metadata: {}
data:
evaluate_payload: false
qos: 0
retain: false
topic: awtrix/custom/{{topicname}}
payload: |-
{
"text": "{{text}}",
"rainbow": {{rainbow|tojson}},
"duration": "{{duration}}",
"icon": "{{icon}}",
"scrollSpeed": 80,
"textCase": "{{textcase}}",
"lifetime": "{{lifetime}}"
}
- if:
- condition: template
value_template: "{{ showimmediately == true or showimmediately == True}}"
then:
- action: mqtt.publish
metadata: {}
data:
evaluate_payload: false
qos: 0
retain: false
topic: awtrix/switch
payload: "{\"name\": \"{{topicname}}\"}"
description: ""
icon: mdi:led-strip
fields:
topicname:
selector:
text: null
name: topicname
required: true
description: Name of the topic - one topic per app
text:
selector:
text: null
name: text
required: true
description: Text to be displayed
icon:
selector:
number:
min: 0
max: 100000
name: icon
required: true
description: Icon ID, needs to be present on the awtrix filesystem - default no icon
default: 1
rainbow:
selector:
boolean: {}
name: rainbow
default: false
required: true
description: Rainbow text yes/no
lifetime:
selector:
number:
min: 0
max: 86400
step: 1
name: lifetime
default: 0
description: Discard app after X seconds - default 0 (never expire)
duration:
selector:
number:
min: 1
max: 180
step: 1
name: duration
default: 3
description: How many seconds should the message be displayed - default 3
textcase:
selector:
number:
min: 0
max: 2
step: 1
name: textCase
default: 0
description: >-
Changes the Uppercase setting. 0=global setting, 1=forces uppercase;
2=shows as it sent - default 0
showimmediately:
selector:
boolean: {}
name: showImmediately
required: false
description: Jumps the queue and displays the message immediately - default false
mode: parallel
max: 10
alias: awtrix - new app sequence: - action: mqtt.publish metadata: {} data: evaluate_payload: false qos: 0 retain: false topic: awtrix/custom/{{topicname}} payload: |- { "text": "{{text}}", "rainbow": {{rainbow|tojson}}, "duration": "{{duration}}", "icon": "{{icon}}", "scrollSpeed": 80, "textCase": "{{textcase}}", "lifetime": "{{lifetime}}" } - if: - condition: template value_template: "{{ showimmediately == true or showimmediately == True}}" then: - action: mqtt.publish metadata: {} data: evaluate_payload: false qos: 0 retain: false topic: awtrix/switch payload: "{\"name\": \"{{topicname}}\"}" description: "" icon: mdi:led-strip fields: topicname: selector: text: null name: topicname required: true description: Name of the topic - one topic per app text: selector: text: null name: text required: true description: Text to be displayed icon: selector: number: min: 0 max: 100000 name: icon required: true description: Icon ID, needs to be present on the awtrix filesystem - default no icon default: 1 rainbow: selector: boolean: {} name: rainbow default: false required: true description: Rainbow text yes/no lifetime: selector: number: min: 0 max: 86400 step: 1 name: lifetime default: 0 description: Discard app after X seconds - default 0 (never expire) duration: selector: number: min: 1 max: 180 step: 1 name: duration default: 3 description: How many seconds should the message be displayed - default 3 textcase: selector: number: min: 0 max: 2 step: 1 name: textCase default: 0 description: >- Changes the Uppercase setting. 0=global setting, 1=forces uppercase; 2=shows as it sent - default 0 showimmediately: selector: boolean: {} name: showImmediately required: false description: Jumps the queue and displays the message immediately - default false mode: parallel max: 10
alias: awtrix - new app
sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: awtrix/custom/{{topicname}}
      payload: |-
        {
          "text": "{{text}}",
          "rainbow": {{rainbow|tojson}},
          "duration": "{{duration}}",
          "icon": "{{icon}}",
          "scrollSpeed": 80,
          "textCase": "{{textcase}}",
          "lifetime": "{{lifetime}}"
        }
  - if:
      - condition: template
        value_template: "{{ showimmediately == true or showimmediately == True}}"
    then:
      - action: mqtt.publish
        metadata: {}
        data:
          evaluate_payload: false
          qos: 0
          retain: false
          topic: awtrix/switch
          payload: "{\"name\": \"{{topicname}}\"}"
description: ""
icon: mdi:led-strip
fields:
  topicname:
    selector:
      text: null
    name: topicname
    required: true
    description: Name of the topic - one topic per app
  text:
    selector:
      text: null
    name: text
    required: true
    description: Text to be displayed
  icon:
    selector:
      number:
        min: 0
        max: 100000
    name: icon
    required: true
    description: Icon ID, needs to be present on the awtrix filesystem - default no icon
    default: 1
  rainbow:
    selector:
      boolean: {}
    name: rainbow
    default: false
    required: true
    description: Rainbow text yes/no
  lifetime:
    selector:
      number:
        min: 0
        max: 86400
        step: 1
    name: lifetime
    default: 0
    description: Discard app after X seconds - default 0 (never expire)
  duration:
    selector:
      number:
        min: 1
        max: 180
        step: 1
    name: duration
    default: 3
    description: How many seconds should the message be displayed - default 3
  textcase:
    selector:
      number:
        min: 0
        max: 2
        step: 1
    name: textCase
    default: 0
    description: >-
      Changes the Uppercase setting. 0=global setting, 1=forces uppercase;
      2=shows as it sent - default 0
  showimmediately:
    selector:
      boolean: {}
    name: showImmediately
    required: false
    description: Jumps the queue and displays the message immediately - default false
mode: parallel
max: 10

awtrix – delete app

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: awtrix - delete app
sequence:
- action: mqtt.publish
metadata: {}
data:
evaluate_payload: false
qos: 0
retain: false
topic: awtrix/custom/{{topicname}}
payload: "{}"
description: ""
icon: mdi:led-strip
fields:
topicname:
selector:
text: null
name: topicname
required: true
description: Name of the app to be deleted
mode: parallel
max: 10
alias: awtrix - delete app sequence: - action: mqtt.publish metadata: {} data: evaluate_payload: false qos: 0 retain: false topic: awtrix/custom/{{topicname}} payload: "{}" description: "" icon: mdi:led-strip fields: topicname: selector: text: null name: topicname required: true description: Name of the app to be deleted mode: parallel max: 10
alias: awtrix - delete app
sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: awtrix/custom/{{topicname}}
      payload: "{}"
description: ""
icon: mdi:led-strip
fields:
  topicname:
    selector:
      text: null
    name: topicname
    required: true
    description: Name of the app to be deleted
mode: parallel
max: 10

awtrix – indicator

Hinweis zur Verwendung: Wenn man den Indikator wieder deaktivieren ( nicht anzeigen ) lassen will, so muss lediglich die Farbe „schwarz“ selektiert werden.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: awtrix - indicator
sequence:
- action: mqtt.publish
metadata: {}
data:
evaluate_payload: false
qos: 0
retain: false
topic: awtrix/indicator{{indicator}}
payload: "{\"color\":{{colour}}, \"fade\":{{fade}}}"
description: ""
icon: mdi:led-strip
fields:
indicator:
selector:
number:
min: 1
max: 3
step: 1
name: indicator
required: true
description: Index of the indicator
default: 1
colour:
selector:
color_rgb: {}
default:
- 255
- 0
- 0
name: colour
description: Colour of the indicator
required: true
fade:
selector:
number:
min: 500
max: 3000
step: 100
name: fade
required: true
default: 0
description: >-
Fade the indicator on and off with a fade interval in milliseconds - 0 is
don't fade
mode: parallel
max: 10
alias: awtrix - indicator sequence: - action: mqtt.publish metadata: {} data: evaluate_payload: false qos: 0 retain: false topic: awtrix/indicator{{indicator}} payload: "{\"color\":{{colour}}, \"fade\":{{fade}}}" description: "" icon: mdi:led-strip fields: indicator: selector: number: min: 1 max: 3 step: 1 name: indicator required: true description: Index of the indicator default: 1 colour: selector: color_rgb: {} default: - 255 - 0 - 0 name: colour description: Colour of the indicator required: true fade: selector: number: min: 500 max: 3000 step: 100 name: fade required: true default: 0 description: >- Fade the indicator on and off with a fade interval in milliseconds - 0 is don't fade mode: parallel max: 10
alias: awtrix - indicator
sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: awtrix/indicator{{indicator}}
      payload: "{\"color\":{{colour}}, \"fade\":{{fade}}}"
description: ""
icon: mdi:led-strip
fields:
  indicator:
    selector:
      number:
        min: 1
        max: 3
        step: 1
    name: indicator
    required: true
    description: Index of the indicator
    default: 1
  colour:
    selector:
      color_rgb: {}
    default:
      - 255
      - 0
      - 0
    name: colour
    description: Colour of the indicator
    required: true
  fade:
    selector:
      number:
        min: 500
        max: 3000
        step: 100
    name: fade
    required: true
    default: 0
    description: >-
      Fade the indicator on and off with a fade interval in milliseconds - 0 is
      don't fade
mode: parallel
max: 10

awtrix – power off

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: awtrix - power off
sequence:
- action: mqtt.publish
metadata: {}
data:
topic: awtrix/power
payload: "{\"power\" : false}"
evaluate_payload: false
qos: 0
retain: false
description: power off device
icon: mdi:led-strip
fields: {}
mode: parallel
max: 10
alias: awtrix - power off sequence: - action: mqtt.publish metadata: {} data: topic: awtrix/power payload: "{\"power\" : false}" evaluate_payload: false qos: 0 retain: false description: power off device icon: mdi:led-strip fields: {} mode: parallel max: 10
alias: awtrix - power off
sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      topic: awtrix/power
      payload: "{\"power\" : false}"
      evaluate_payload: false
      qos: 0
      retain: false
description: power off device
icon: mdi:led-strip
fields: {}
mode: parallel
max: 10

awtrix – power on

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: awtrix - power on
sequence:
- action: mqtt.publish
metadata: {}
data:
topic: awtrix/power
payload: "{\"power\" : true}"
evaluate_payload: false
qos: 0
retain: false
description: power on device
icon: mdi:led-strip
fields: {}
mode: parallel
max: 10
alias: awtrix - power on sequence: - action: mqtt.publish metadata: {} data: topic: awtrix/power payload: "{\"power\" : true}" evaluate_payload: false qos: 0 retain: false description: power on device icon: mdi:led-strip fields: {} mode: parallel max: 10
alias: awtrix - power on
sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      topic: awtrix/power
      payload: "{\"power\" : true}"
      evaluate_payload: false
      qos: 0
      retain: false
description: power on device
icon: mdi:led-strip
fields: {}
mode: parallel
max: 10

awtrix – reboot

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: awtrix - reboot
sequence:
- action: mqtt.publish
metadata: {}
data:
topic: awtrix/reboot
payload: "{}"
evaluate_payload: false
qos: 0
retain: false
description: reboot device
icon: mdi:led-strip
fields: {}
mode: parallel
max: 10
alias: awtrix - reboot sequence: - action: mqtt.publish metadata: {} data: topic: awtrix/reboot payload: "{}" evaluate_payload: false qos: 0 retain: false description: reboot device icon: mdi:led-strip fields: {} mode: parallel max: 10
alias: awtrix - reboot
sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      topic: awtrix/reboot
      payload: "{}"
      evaluate_payload: false
      qos: 0
      retain: false
description: reboot device
icon: mdi:led-strip
fields: {}
mode: parallel
max: 10

Für die Müllanzeige werden ein Input Button Helfer und ein Template Helfer benötigt.

Der Input Button Helfer übernimmt bei Betätigung einen aktuellen Zeitstempel, welcher im Template „Müllinformation“ verwendet wird.

Das Template Müllinformation liest aus einem Kalender Zeitpunkte für die jeweiligen Müllabholungstermine aus und differenziert in diesem Beispiel nach

  • Gelber Sack
  • Grüne Tonne
  • Graue Tonne

Template Helfer Sensor „Müllinformation“

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
{% set last_pressed = as_datetime(states('input_button.mulltonne_rausgestellt')).date() %}
{% set start_time = state_attr('calendar.abfall', 'start_time') %}
{% if start_time %}
{% set event_datetime = as_datetime(start_time) %}
{% set event_date = event_datetime.date() %}
{# Wenn der Button innerhalb des gültigen Zeitraums (heute oder gestern) gedrückt wurde und das Ereignis noch nicht vorbei ist #}
{% if (last_pressed == event_date or last_pressed == event_date - timedelta(days=1)) %}
Tonne wurde rausgestellt.
{% else %}
{# Am Tag vor dem Ereignis #}
{% if (event_date - now().date()).days == 1 %}
{{ state_attr('calendar.abfall', 'message') }} rausstellen!
{# Am Tag des Ereignisses #}
{% elif event_date == now().date() %}
{{ state_attr('calendar.abfall', 'message') }} rausstellen!
{# Ansonsten kein Termin #}
{% else %}
Kein Müll
{% endif %}
{% endif %}
{% else %}
Kein Termin
{% endif %}
{% set last_pressed = as_datetime(states('input_button.mulltonne_rausgestellt')).date() %} {% set start_time = state_attr('calendar.abfall', 'start_time') %} {% if start_time %} {% set event_datetime = as_datetime(start_time) %} {% set event_date = event_datetime.date() %} {# Wenn der Button innerhalb des gültigen Zeitraums (heute oder gestern) gedrückt wurde und das Ereignis noch nicht vorbei ist #} {% if (last_pressed == event_date or last_pressed == event_date - timedelta(days=1)) %} Tonne wurde rausgestellt. {% else %} {# Am Tag vor dem Ereignis #} {% if (event_date - now().date()).days == 1 %} {{ state_attr('calendar.abfall', 'message') }} rausstellen! {# Am Tag des Ereignisses #} {% elif event_date == now().date() %} {{ state_attr('calendar.abfall', 'message') }} rausstellen! {# Ansonsten kein Termin #} {% else %} Kein Müll {% endif %} {% endif %} {% else %} Kein Termin {% endif %}
{% set last_pressed = as_datetime(states('input_button.mulltonne_rausgestellt')).date() %}
{% set start_time = state_attr('calendar.abfall', 'start_time') %}
{% if start_time %}
  {% set event_datetime = as_datetime(start_time) %}
  {% set event_date = event_datetime.date() %}
  {# Wenn der Button innerhalb des gültigen Zeitraums (heute oder gestern) gedrückt wurde und das Ereignis noch nicht vorbei ist #}
  {% if (last_pressed == event_date or last_pressed == event_date - timedelta(days=1))  %}
    Tonne wurde rausgestellt.
  {% else %}
    {# Am Tag vor dem Ereignis #}
    {% if (event_date - now().date()).days == 1 %}
      {{ state_attr('calendar.abfall', 'message') }} rausstellen!

    {# Am Tag des Ereignisses #}
    {% elif event_date == now().date() %}
      {{ state_attr('calendar.abfall', 'message') }} rausstellen!

    {# Ansonsten kein Termin #}
    {% else %}
      Kein Müll
    {% endif %}
  {% endif %}
{% else %}
  Kein Termin
{% endif %}

1 Tag vor dem Abholungstermin bis zum Tag der Abholung, wird der Termin mit der jeweiligen herauszustellenden Tonne über das Template angezeigt. Ich verwende dafür die HACS Mushroom Cards .

Tonne rausstellen (Mushroom Template-Badge)

Yaml Code:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
type: custom:mushroom-template-badge
content: "{{ states('sensor.mullinformation') }}"
icon: mdi:trash-can
color: |-
{% if states('sensor.mullinformation') == 'Gelber Sack rausstellen!' %}
yellow
{% elif states('sensor.mullinformation') == 'Grüne Tonne rausstellen!' %}
green
{% elif states('sensor.mullinformation') == 'Graue Tonne rausstellen!' %}
grey
{% else %}
white
{% endif %}
type: custom:mushroom-template-badge content: "{{ states('sensor.mullinformation') }}" icon: mdi:trash-can color: |- {% if states('sensor.mullinformation') == 'Gelber Sack rausstellen!' %} yellow {% elif states('sensor.mullinformation') == 'Grüne Tonne rausstellen!' %} green {% elif states('sensor.mullinformation') == 'Graue Tonne rausstellen!' %} grey {% else %} white {% endif %}
type: custom:mushroom-template-badge
content: "{{ states('sensor.mullinformation') }}"
icon: mdi:trash-can
color: |-
  {% if states('sensor.mullinformation') == 'Gelber Sack rausstellen!' %}
  yellow
  {% elif states('sensor.mullinformation') == 'Grüne Tonne rausstellen!' %}
  green
  {% elif states('sensor.mullinformation') == 'Graue Tonne rausstellen!' %}
  grey
  {% else %}
  white
  {% endif %}

Wurde die Tonne herausgestellt, kann über den Input Button quittiert werden, dass die Mülltonne herausgestellt wurde.

Wird der Vorgang quittiert, wird die Anzeige aktualisiert und auch auf dem Display die Nachricht entfernt.

Müll quittieren (Mushroom Template-Badge)

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
type: custom:mushroom-template-badge
content: Müll quittieren
icon: mdi:trash-can
color: >-
{% set last_pressed =
as_datetime(states('input_button.mulltonne_rausgestellt')).date() %}
{% set start_time = state_attr('calendar.abfall', 'start_time') %}
{% if start_time %}
{% set event_datetime = as_datetime(start_time) %}
{% set event_date = event_datetime.date() %}
{# Wenn der Button innerhalb des gültigen Zeitraums (heute oder gestern) gedrückt wurde und das Ereignis noch nicht vorbei ist #}
{% if (last_pressed == event_date or last_pressed == event_date - timedelta(days=1)) %}
green
{% else %}
blue
{% endif %}
{% endif %}
label: |2-
entity: input_button.mulltonne_rausgestellt
tap_action:
action: toggle
visibility:
- condition: and
conditions:
- condition: state
entity: sensor.mullinformation
state_not: Kein Müll
- condition: state
entity: sensor.mullinformation
state_not: Tonne wurde rausgestellt.
- condition: and
conditions: []
type: custom:mushroom-template-badge content: Müll quittieren icon: mdi:trash-can color: >- {% set last_pressed = as_datetime(states('input_button.mulltonne_rausgestellt')).date() %} {% set start_time = state_attr('calendar.abfall', 'start_time') %} {% if start_time %} {% set event_datetime = as_datetime(start_time) %} {% set event_date = event_datetime.date() %} {# Wenn der Button innerhalb des gültigen Zeitraums (heute oder gestern) gedrückt wurde und das Ereignis noch nicht vorbei ist #} {% if (last_pressed == event_date or last_pressed == event_date - timedelta(days=1)) %} green {% else %} blue {% endif %} {% endif %} label: |2- entity: input_button.mulltonne_rausgestellt tap_action: action: toggle visibility: - condition: and conditions: - condition: state entity: sensor.mullinformation state_not: Kein Müll - condition: state entity: sensor.mullinformation state_not: Tonne wurde rausgestellt. - condition: and conditions: []
type: custom:mushroom-template-badge
content: Müll quittieren
icon: mdi:trash-can
color: >-
  {% set last_pressed =
  as_datetime(states('input_button.mulltonne_rausgestellt')).date() %}

  {% set start_time = state_attr('calendar.abfall', 'start_time') %}

  {% if start_time %}
    {% set event_datetime = as_datetime(start_time) %}
    {% set event_date = event_datetime.date() %}
    {# Wenn der Button innerhalb des gültigen Zeitraums (heute oder gestern) gedrückt wurde und das Ereignis noch nicht vorbei ist #}
    {% if (last_pressed == event_date or last_pressed == event_date - timedelta(days=1))  %}
      green
    {% else %}
      blue
    {% endif %}
  {% endif %}
label: |2-


    
entity: input_button.mulltonne_rausgestellt
tap_action:
  action: toggle
visibility:
  - condition: and
    conditions:
      - condition: state
        entity: sensor.mullinformation
        state_not: Kein Müll
      - condition: state
        entity: sensor.mullinformation
        state_not: Tonne wurde rausgestellt.
      - condition: and
        conditions: []

Die Automatisierung sieht dann wie folgt aus. Hier bitte die eigenen Entitäten verwenden und nicht benötigte Anzeigen entfernen.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: awtrix Zustandstrigger
description: ""
triggers:
- trigger: state
entity_id:
- sensor.evcc_tariff_grid
- sensor.evcc_pv_power
- sensor.aussentemperatur_ds18b20_temperature
- sensor.evcc_battery_soc
- sensor.smart_home_more_views
- sensor.mullinformation
for:
hours: 0
minutes: 0
seconds: 10
- trigger: state
entity_id:
- sensor.smart_home_more
attribute: stars
for:
hours: 0
minutes: 0
seconds: 10
conditions: []
actions:
- action: script.awtrix_new_app
metadata: {}
data:
icon: 3813
rainbow: false
lifetime: 0
duration: 5
textcase: 0
topicname: Tibber
text: "{{ states('sensor.evcc_tariff_grid') | round(3) }}"
alias: "Skript new App : Tibber"
- action: script.awtrix_new_app
metadata: {}
data:
icon: 37323
rainbow: false
lifetime: 0
duration: 5
textcase: 0
topicname: PV
text: "{{ states('sensor.evcc_pv_power') }}"
alias: "Skript new App : Solar Power"
- action: script.awtrix_new_app
metadata: {}
data:
icon: 2422
rainbow: false
lifetime: 0
duration: 5
textcase: 0
topicname: Temperatur
text: "{{ states('sensor.aussentemperatur_ds18b20_temperature') }} °"
alias: "Skript new App : Aussentemperatur"
- action: script.awtrix_new_app
metadata: {}
data:
icon: 389
rainbow: false
lifetime: 0
duration: 5
textcase: 0
topicname: SOC
text: "{{ states('sensor.evcc_battery_soc') }} %"
alias: "Skript new App : SOC Hausspeicher"
- action: script.awtrix_new_app
metadata: {}
data:
icon: 974
rainbow: false
lifetime: 0
duration: 5
textcase: 2
topicname: Youtube
text: >-
{{ states('sensor.smart_home_more_views') }} -
{{state_attr('sensor.smart_home_more', 'stars')}}
alias: "Skript new App : YT Views und Likes"
- alias: Indikator für genügend PV oder günstiger Preis
if:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.evcc_pv_power
above: 1500
- condition: numeric_state
entity_id: sensor.evcc_tariff_grid
below: 0.28
then:
- action: script.awtrix_indicator
metadata: {}
data:
indicator: 1
colour:
- 30
- 255
- 0
fade: 0
else:
- action: script.awtrix_indicator
metadata: {}
data:
indicator: 1
colour:
- 255
- 0
- 0
fade: 0
- alias: Abfall Anzeige
choose:
- conditions:
- condition: state
entity_id: sensor.mullinformation
state: Gelber Sack rausstellen!
sequence:
- action: script.awtrix_new_app
metadata: {}
data:
icon: 56166
rainbow: false
lifetime: 0
duration: 10
textcase: 2
topicname: Abfall
text: "{{ states('sensor.mullinformation')}}"
- conditions:
- condition: state
entity_id: sensor.mullinformation
state: Graue Tonne rausstellen!
sequence:
- action: script.awtrix_new_app
metadata: {}
data:
icon: 12155
rainbow: false
lifetime: 0
duration: 10
textcase: 2
topicname: Abfall
text: "{{ states('sensor.mullinformation')}}"
- conditions:
- condition: state
entity_id: sensor.mullinformation
state: Grüne Tonne rausstellen!
sequence:
- action: script.awtrix_new_app
metadata: {}
data:
icon: 56625
rainbow: false
lifetime: 0
duration: 10
textcase: 2
topicname: Abfall
text: "{{ states('sensor.mullinformation')}}"
default:
- action: script.awtrix_delete_app
metadata: {}
data:
topicname: Abfall
- alias: Abfall Anzeige
choose:
- conditions:
- condition: or
conditions:
- condition: state
entity_id: sensor.mullinformation
state: Gelber Sack rausstellen!
- condition: state
entity_id: sensor.mullinformation
state: Graue Tonne rausstellen!
- condition: state
entity_id: sensor.mullinformation
state: Grüne Tonne rausstellen!
alias: Wenn eine der Tonnen rausgestellt werden muss
sequence:
- action: script.awtrix_new_app
metadata: {}
data:
icon: 56166
rainbow: false
lifetime: 0
duration: 10
textcase: 2
topicname: Abfall
text: "{{ states('sensor.mullinformation')}}"
default:
- action: script.awtrix_delete_app
metadata: {}
data:
topicname: Abfall
enabled: false
- alias: Reboot, wenn RAM knapp wird
if:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.awtrix_b3dc90_free_ram
below: 50000
- condition: numeric_state
entity_id: sensor.awtrix_bebc10_free_ram
below: 50000
then:
- action: script.awtrix_reboot
metadata: {}
data: {}
mode: single
alias: awtrix Zustandstrigger description: "" triggers: - trigger: state entity_id: - sensor.evcc_tariff_grid - sensor.evcc_pv_power - sensor.aussentemperatur_ds18b20_temperature - sensor.evcc_battery_soc - sensor.smart_home_more_views - sensor.mullinformation for: hours: 0 minutes: 0 seconds: 10 - trigger: state entity_id: - sensor.smart_home_more attribute: stars for: hours: 0 minutes: 0 seconds: 10 conditions: [] actions: - action: script.awtrix_new_app metadata: {} data: icon: 3813 rainbow: false lifetime: 0 duration: 5 textcase: 0 topicname: Tibber text: "{{ states('sensor.evcc_tariff_grid') | round(3) }}" alias: "Skript new App : Tibber" - action: script.awtrix_new_app metadata: {} data: icon: 37323 rainbow: false lifetime: 0 duration: 5 textcase: 0 topicname: PV text: "{{ states('sensor.evcc_pv_power') }}" alias: "Skript new App : Solar Power" - action: script.awtrix_new_app metadata: {} data: icon: 2422 rainbow: false lifetime: 0 duration: 5 textcase: 0 topicname: Temperatur text: "{{ states('sensor.aussentemperatur_ds18b20_temperature') }} °" alias: "Skript new App : Aussentemperatur" - action: script.awtrix_new_app metadata: {} data: icon: 389 rainbow: false lifetime: 0 duration: 5 textcase: 0 topicname: SOC text: "{{ states('sensor.evcc_battery_soc') }} %" alias: "Skript new App : SOC Hausspeicher" - action: script.awtrix_new_app metadata: {} data: icon: 974 rainbow: false lifetime: 0 duration: 5 textcase: 2 topicname: Youtube text: >- {{ states('sensor.smart_home_more_views') }} - {{state_attr('sensor.smart_home_more', 'stars')}} alias: "Skript new App : YT Views und Likes" - alias: Indikator für genügend PV oder günstiger Preis if: - condition: or conditions: - condition: numeric_state entity_id: sensor.evcc_pv_power above: 1500 - condition: numeric_state entity_id: sensor.evcc_tariff_grid below: 0.28 then: - action: script.awtrix_indicator metadata: {} data: indicator: 1 colour: - 30 - 255 - 0 fade: 0 else: - action: script.awtrix_indicator metadata: {} data: indicator: 1 colour: - 255 - 0 - 0 fade: 0 - alias: Abfall Anzeige choose: - conditions: - condition: state entity_id: sensor.mullinformation state: Gelber Sack rausstellen! sequence: - action: script.awtrix_new_app metadata: {} data: icon: 56166 rainbow: false lifetime: 0 duration: 10 textcase: 2 topicname: Abfall text: "{{ states('sensor.mullinformation')}}" - conditions: - condition: state entity_id: sensor.mullinformation state: Graue Tonne rausstellen! sequence: - action: script.awtrix_new_app metadata: {} data: icon: 12155 rainbow: false lifetime: 0 duration: 10 textcase: 2 topicname: Abfall text: "{{ states('sensor.mullinformation')}}" - conditions: - condition: state entity_id: sensor.mullinformation state: Grüne Tonne rausstellen! sequence: - action: script.awtrix_new_app metadata: {} data: icon: 56625 rainbow: false lifetime: 0 duration: 10 textcase: 2 topicname: Abfall text: "{{ states('sensor.mullinformation')}}" default: - action: script.awtrix_delete_app metadata: {} data: topicname: Abfall - alias: Abfall Anzeige choose: - conditions: - condition: or conditions: - condition: state entity_id: sensor.mullinformation state: Gelber Sack rausstellen! - condition: state entity_id: sensor.mullinformation state: Graue Tonne rausstellen! - condition: state entity_id: sensor.mullinformation state: Grüne Tonne rausstellen! alias: Wenn eine der Tonnen rausgestellt werden muss sequence: - action: script.awtrix_new_app metadata: {} data: icon: 56166 rainbow: false lifetime: 0 duration: 10 textcase: 2 topicname: Abfall text: "{{ states('sensor.mullinformation')}}" default: - action: script.awtrix_delete_app metadata: {} data: topicname: Abfall enabled: false - alias: Reboot, wenn RAM knapp wird if: - condition: or conditions: - condition: numeric_state entity_id: sensor.awtrix_b3dc90_free_ram below: 50000 - condition: numeric_state entity_id: sensor.awtrix_bebc10_free_ram below: 50000 then: - action: script.awtrix_reboot metadata: {} data: {} mode: single
alias: awtrix Zustandstrigger
description: ""
triggers:
  - trigger: state
    entity_id:
      - sensor.evcc_tariff_grid
      - sensor.evcc_pv_power
      - sensor.aussentemperatur_ds18b20_temperature
      - sensor.evcc_battery_soc
      - sensor.smart_home_more_views
      - sensor.mullinformation
    for:
      hours: 0
      minutes: 0
      seconds: 10
  - trigger: state
    entity_id:
      - sensor.smart_home_more
    attribute: stars
    for:
      hours: 0
      minutes: 0
      seconds: 10
conditions: []
actions:
  - action: script.awtrix_new_app
    metadata: {}
    data:
      icon: 3813
      rainbow: false
      lifetime: 0
      duration: 5
      textcase: 0
      topicname: Tibber
      text: "{{ states('sensor.evcc_tariff_grid') | round(3) }}"
    alias: "Skript new App : Tibber"
  - action: script.awtrix_new_app
    metadata: {}
    data:
      icon: 37323
      rainbow: false
      lifetime: 0
      duration: 5
      textcase: 0
      topicname: PV
      text: "{{ states('sensor.evcc_pv_power') }}"
    alias: "Skript new App : Solar Power"
  - action: script.awtrix_new_app
    metadata: {}
    data:
      icon: 2422
      rainbow: false
      lifetime: 0
      duration: 5
      textcase: 0
      topicname: Temperatur
      text: "{{ states('sensor.aussentemperatur_ds18b20_temperature') }} °"
    alias: "Skript new App : Aussentemperatur"
  - action: script.awtrix_new_app
    metadata: {}
    data:
      icon: 389
      rainbow: false
      lifetime: 0
      duration: 5
      textcase: 0
      topicname: SOC
      text: "{{ states('sensor.evcc_battery_soc') }} %"
    alias: "Skript new App : SOC Hausspeicher"
  - action: script.awtrix_new_app
    metadata: {}
    data:
      icon: 974
      rainbow: false
      lifetime: 0
      duration: 5
      textcase: 2
      topicname: Youtube
      text: >-
        {{ states('sensor.smart_home_more_views') }} -
        {{state_attr('sensor.smart_home_more', 'stars')}}
    alias: "Skript new App : YT Views und Likes"
  - alias: Indikator für genügend PV oder günstiger Preis
    if:
      - condition: or
        conditions:
          - condition: numeric_state
            entity_id: sensor.evcc_pv_power
            above: 1500
          - condition: numeric_state
            entity_id: sensor.evcc_tariff_grid
            below: 0.28
    then:
      - action: script.awtrix_indicator
        metadata: {}
        data:
          indicator: 1
          colour:
            - 30
            - 255
            - 0
          fade: 0
    else:
      - action: script.awtrix_indicator
        metadata: {}
        data:
          indicator: 1
          colour:
            - 255
            - 0
            - 0
          fade: 0
  - alias: Abfall Anzeige
    choose:
      - conditions:
          - condition: state
            entity_id: sensor.mullinformation
            state: Gelber Sack rausstellen!
        sequence:
          - action: script.awtrix_new_app
            metadata: {}
            data:
              icon: 56166
              rainbow: false
              lifetime: 0
              duration: 10
              textcase: 2
              topicname: Abfall
              text: "{{ states('sensor.mullinformation')}}"
      - conditions:
          - condition: state
            entity_id: sensor.mullinformation
            state: Graue Tonne rausstellen!
        sequence:
          - action: script.awtrix_new_app
            metadata: {}
            data:
              icon: 12155
              rainbow: false
              lifetime: 0
              duration: 10
              textcase: 2
              topicname: Abfall
              text: "{{ states('sensor.mullinformation')}}"
      - conditions:
          - condition: state
            entity_id: sensor.mullinformation
            state: Grüne Tonne rausstellen!
        sequence:
          - action: script.awtrix_new_app
            metadata: {}
            data:
              icon: 56625
              rainbow: false
              lifetime: 0
              duration: 10
              textcase: 2
              topicname: Abfall
              text: "{{ states('sensor.mullinformation')}}"
    default:
      - action: script.awtrix_delete_app
        metadata: {}
        data:
          topicname: Abfall
  - alias: Abfall Anzeige
    choose:
      - conditions:
          - condition: or
            conditions:
              - condition: state
                entity_id: sensor.mullinformation
                state: Gelber Sack rausstellen!
              - condition: state
                entity_id: sensor.mullinformation
                state: Graue Tonne rausstellen!
              - condition: state
                entity_id: sensor.mullinformation
                state: Grüne Tonne rausstellen!
            alias: Wenn eine der Tonnen rausgestellt werden muss
        sequence:
          - action: script.awtrix_new_app
            metadata: {}
            data:
              icon: 56166
              rainbow: false
              lifetime: 0
              duration: 10
              textcase: 2
              topicname: Abfall
              text: "{{ states('sensor.mullinformation')}}"
    default:
      - action: script.awtrix_delete_app
        metadata: {}
        data:
          topicname: Abfall
    enabled: false
  - alias: Reboot, wenn RAM knapp wird
    if:
      - condition: or
        conditions:
          - condition: numeric_state
            entity_id: sensor.awtrix_b3dc90_free_ram
            below: 50000
          - condition: numeric_state
            entity_id: sensor.awtrix_bebc10_free_ram
            below: 50000
    then:
      - action: script.awtrix_reboot
        metadata: {}
        data: {}
mode: single

Für Müll quittieren, verwende ich ein Mushroom Template Badge.

Update vom 27.11.2024 dynamische Wetter-Icons

Das Thema beschäftigt mich weiterhin, so dass ich euch noch weitere Ergänzungen und Updates zum awtrix 3 zur Verfügung stellen möchte.

Angeregt durch einige Kommentare bzgl. einer in Abhängigkeit vom aktuellen Wetter anzuzeigendes Icon , möchte ich euch eine Erweiterung der Automatisierung, bzw. des Skripts vorstellen, so dass ihr ohne eine zusätzliche Automatisierung oder Skript den Zustand des Wetters als Icon ( z.B. Sonnig, Regnerisch, Bewölkt etc.. ) nutzen könnt. Grundvoraussetzung dafür ist eine Wetterintegration wie z.B. der Deutsche Wetterdienst (GitHub – FL550/dwd_weather: Deutscher Wetterdienst integration for Home-Assistant)

Partly Cloudly

Rainy

Snowy

Bei dieser Lösung wird der aktuelle Zustand der Wetter Entität ausgelesen und in der Automatisierung verwendet.

Wir benötigen dazu ein Template, welches den aktuellen Zustand des Wetters ausgibt. Die Ausgaben des Wetter Templates sind in jeder Integration identisch und können auf der Home Assistant Dokumentationsseite nachgelesen werden.

In meinem Beispiel heißt die Entität “ weather.lahr „.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
{{ states('weather.lahr') }}
{{ states('weather.lahr') }}
{{ states('weather.lahr') }}

Rückgabe ist in diesem Beispiel bewölkt, also cloudy.

Es gibt nach der Home Assistant Dokumentation 15 unterschiedliche Wetter Zustände. Für jeden der Zustände habe ich uns ein Icon von der Seite LaMetric Icon Gallery herausgesucht und auf der awtrix 3 Weboberfläche heruntergeladen.

ICON-IDWetter Zustand
2283cloudy
13505clear-night
8551fog
52386hail
21174lighting (thunderstorm)
51457lightning-rainy
2286partlycloudy
56677pouring
56548rainy
58081snowy
49301snowy-rainy
11201sunny
15618windy
62874windy-variant
56705exceptional

Ladet diese Icons über die awtrix 3 Weboberfläche herunter und speichert die Einstellungen.

Nachdem die Icons alle heruntergeladen sind, geht zum Tab Files und lasst euch dort alle Dateien im Verzeichnis ICONS anzeigen.

Dort gebt ihr den Dateien mit der jeweiligen ID den Namen aus der obigen Tabelle.

Die Beispiel ID 2283.gif, wird somit aus der Datei cloudy.gif umbenannt. Dieser Vorgang wird für alle in der Tabelle enthaltenen IDs wiederholt.

Ist der Vorgang abgeschlossen, sollten folgende Bilddaten im Verzeichnis ICONS vorhanden sein.

Im Skript awtrix – new app muss eine Änderung vorgenommen werden.

Unter dem Feld icon, muss Zahl in Text geändert und gespeichert werden.

Ändern in Text:

Nach dem Speichern ist das Skript nun in der Lage ein Icon über einen Namen ( wie z.B. cloudy oder sunny ) zu laden.

Hier nochmal das vollständige Skript awtrix – new app

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: awtrix - new app
sequence:
- action: mqtt.publish
metadata: {}
data:
evaluate_payload: false
qos: 0
retain: false
topic: awtrix/custom/{{topicname}}
payload: |-
{
"text": "{{text}}",
"rainbow": {{rainbow|tojson}},
"duration": "{{duration}}",
"icon": "{{icon}}",
"scrollSpeed": 80,
"textCase": "{{textcase}}",
"lifetime": "{{lifetime}}"
}
- if:
- condition: template
value_template: "{{ showimmediately == true or showimmediately == True}}"
then:
- action: mqtt.publish
metadata: {}
data:
evaluate_payload: false
qos: 0
retain: false
topic: awtrix/switch
payload: "{\"name\": \"{{topicname}}\"}"
description: ""
icon: mdi:led-strip
fields:
topicname:
selector:
text: null
name: topicname
required: true
description: Name of the topic - one topic per app
text:
selector:
text: null
name: text
required: true
description: Text to be displayed
icon:
selector:
text: {}
name: icon
required: true
description: Icon ID, needs to be present on the awtrix filesystem - default no icon
rainbow:
selector:
boolean: {}
name: rainbow
default: false
required: true
description: Rainbow text yes/no
lifetime:
selector:
number:
min: 0
max: 86400
step: 1
name: lifetime
default: 0
description: Discard app after X seconds - default 0 (never expire)
duration:
selector:
number:
min: 1
max: 180
step: 1
name: duration
default: 3
description: How many seconds should the message be displayed - default 3
textcase:
selector:
number:
min: 0
max: 2
step: 1
name: textCase
default: 0
description: >-
Changes the Uppercase setting. 0=global setting, 1=forces uppercase;
2=shows as it sent - default 0
showimmediately:
selector:
boolean: {}
name: showImmediately
required: false
description: Jumps the queue and displays the message immediately - default false
mode: parallel
max: 10
alias: awtrix - new app sequence: - action: mqtt.publish metadata: {} data: evaluate_payload: false qos: 0 retain: false topic: awtrix/custom/{{topicname}} payload: |- { "text": "{{text}}", "rainbow": {{rainbow|tojson}}, "duration": "{{duration}}", "icon": "{{icon}}", "scrollSpeed": 80, "textCase": "{{textcase}}", "lifetime": "{{lifetime}}" } - if: - condition: template value_template: "{{ showimmediately == true or showimmediately == True}}" then: - action: mqtt.publish metadata: {} data: evaluate_payload: false qos: 0 retain: false topic: awtrix/switch payload: "{\"name\": \"{{topicname}}\"}" description: "" icon: mdi:led-strip fields: topicname: selector: text: null name: topicname required: true description: Name of the topic - one topic per app text: selector: text: null name: text required: true description: Text to be displayed icon: selector: text: {} name: icon required: true description: Icon ID, needs to be present on the awtrix filesystem - default no icon rainbow: selector: boolean: {} name: rainbow default: false required: true description: Rainbow text yes/no lifetime: selector: number: min: 0 max: 86400 step: 1 name: lifetime default: 0 description: Discard app after X seconds - default 0 (never expire) duration: selector: number: min: 1 max: 180 step: 1 name: duration default: 3 description: How many seconds should the message be displayed - default 3 textcase: selector: number: min: 0 max: 2 step: 1 name: textCase default: 0 description: >- Changes the Uppercase setting. 0=global setting, 1=forces uppercase; 2=shows as it sent - default 0 showimmediately: selector: boolean: {} name: showImmediately required: false description: Jumps the queue and displays the message immediately - default false mode: parallel max: 10
alias: awtrix - new app
sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: awtrix/custom/{{topicname}}
      payload: |-
        {
          "text": "{{text}}",
          "rainbow": {{rainbow|tojson}},
          "duration": "{{duration}}",
          "icon": "{{icon}}",
          "scrollSpeed": 80,
          "textCase": "{{textcase}}",
          "lifetime": "{{lifetime}}"
        }
  - if:
      - condition: template
        value_template: "{{ showimmediately == true or showimmediately == True}}"
    then:
      - action: mqtt.publish
        metadata: {}
        data:
          evaluate_payload: false
          qos: 0
          retain: false
          topic: awtrix/switch
          payload: "{\"name\": \"{{topicname}}\"}"
description: ""
icon: mdi:led-strip
fields:
  topicname:
    selector:
      text: null
    name: topicname
    required: true
    description: Name of the topic - one topic per app
  text:
    selector:
      text: null
    name: text
    required: true
    description: Text to be displayed
  icon:
    selector:
      text: {}
    name: icon
    required: true
    description: Icon ID, needs to be present on the awtrix filesystem - default no icon
  rainbow:
    selector:
      boolean: {}
    name: rainbow
    default: false
    required: true
    description: Rainbow text yes/no
  lifetime:
    selector:
      number:
        min: 0
        max: 86400
        step: 1
    name: lifetime
    default: 0
    description: Discard app after X seconds - default 0 (never expire)
  duration:
    selector:
      number:
        min: 1
        max: 180
        step: 1
    name: duration
    default: 3
    description: How many seconds should the message be displayed - default 3
  textcase:
    selector:
      number:
        min: 0
        max: 2
        step: 1
    name: textCase
    default: 0
    description: >-
      Changes the Uppercase setting. 0=global setting, 1=forces uppercase;
      2=shows as it sent - default 0
  showimmediately:
    selector:
      boolean: {}
    name: showImmediately
    required: false
    description: Jumps the queue and displays the message immediately - default false
mode: parallel
max: 10

In der Automatisierung kann nun das Skript für die dynamischen Wettericons wie folgt aufgerufen werden, ich verwende es zusammen mit einem Außentemperatursensor und übergebe als Icon den aktuellen Zustand der Wetter Entität.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
action: script.awtrix_new_app
metadata: {}
data:
icon: "{{ states('weather.lahr') }}"
rainbow: false
lifetime: 0
duration: 5
textcase: 0
topicname: Temperatur
text: "{{ states('sensor.aussentemperatur_ds18b20_temperature') }} °"
alias: "Skript new App : Aussentemperatur"
action: script.awtrix_new_app metadata: {} data: icon: "{{ states('weather.lahr') }}" rainbow: false lifetime: 0 duration: 5 textcase: 0 topicname: Temperatur text: "{{ states('sensor.aussentemperatur_ds18b20_temperature') }} °" alias: "Skript new App : Aussentemperatur"
action: script.awtrix_new_app
metadata: {}
data:
  icon: "{{ states('weather.lahr') }}"
  rainbow: false
  lifetime: 0
  duration: 5
  textcase: 0
  topicname: Temperatur
  text: "{{ states('sensor.aussentemperatur_ds18b20_temperature') }} °"
alias: "Skript new App : Aussentemperatur"

Zur Vollständigkeit hier nochmal die gesamte Automatisierung:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: awtrix Zustandstrigger
description: ""
triggers:
- trigger: state
entity_id:
- sensor.evcc_tariff_grid
- sensor.evcc_pv_power
- sensor.aussentemperatur_ds18b20_temperature
- sensor.evcc_battery_soc
- sensor.smart_home_more_views
- sensor.mullinformation
- weather.lahr
for:
hours: 0
minutes: 0
seconds: 10
- trigger: state
entity_id:
- sensor.smart_home_more
attribute: stars
for:
hours: 0
minutes: 0
seconds: 10
conditions: []
actions:
- action: script.awtrix_new_app
metadata: {}
data:
icon: 3813
rainbow: false
lifetime: 0
duration: 5
textcase: 0
topicname: Tibber
text: "{{ states('sensor.evcc_tariff_grid') | round(3) }}"
alias: "Skript new App : Tibber"
- if:
- condition: numeric_state
entity_id: sensor.evcc_pv_power
above: 0
then:
- action: script.awtrix_new_app
metadata: {}
data:
icon: 37323
rainbow: false
lifetime: 0
duration: 5
textcase: 0
topicname: PV
text: "{{ states('sensor.evcc_pv_power') }}"
alias: "Skript new App : Solar Power"
else:
- action: script.awtrix_delete_app
metadata: {}
data:
topicname: PV
alias: "PV Ertrag vorhanden "
- action: script.awtrix_new_app
metadata: {}
data:
icon: "{{ states('weather.lahr') }}"
rainbow: false
lifetime: 0
duration: 5
textcase: 0
topicname: Temperatur
text: "{{ states('sensor.aussentemperatur_ds18b20_temperature') }} °"
alias: "Skript new App : Aussentemperatur"
- action: script.awtrix_new_app
metadata: {}
data:
icon: 389
rainbow: false
lifetime: 0
duration: 5
textcase: 0
topicname: SOC
text: "{{ states('sensor.evcc_battery_soc') }} %"
alias: "Skript new App : SOC Hausspeicher"
- action: script.awtrix_new_app
metadata: {}
data:
icon: 974
rainbow: false
lifetime: 0
duration: 5
textcase: 2
topicname: Youtube
text: >-
{{ states('sensor.smart_home_more_views') }} -
{{state_attr('sensor.smart_home_more', 'stars')}}
alias: "Skript new App : YT Views und Likes"
- alias: Indikator für genügend PV oder günstiger Preis
if:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.evcc_pv_power
above: 1500
- condition: numeric_state
entity_id: sensor.evcc_tariff_grid
below: 0.28
then:
- action: script.awtrix_indicator
metadata: {}
data:
indicator: 1
colour:
- 30
- 255
- 0
fade: 0
else:
- action: script.awtrix_indicator
metadata: {}
data:
indicator: 1
colour:
- 255
- 0
- 0
fade: 0
- alias: Abfall Anzeige
choose:
- conditions:
- condition: state
entity_id: sensor.mullinformation
state: Gelber Sack rausstellen!
sequence:
- action: script.awtrix_new_app
metadata: {}
data:
icon: 56166
rainbow: false
lifetime: 0
duration: 10
textcase: 2
topicname: Abfall
text: "{{ states('sensor.mullinformation')}}"
- conditions:
- condition: state
entity_id: sensor.mullinformation
state: Graue Tonne rausstellen!
sequence:
- action: script.awtrix_new_app
metadata: {}
data:
icon: 12155
rainbow: false
lifetime: 0
duration: 10
textcase: 2
topicname: Abfall
text: "{{ states('sensor.mullinformation')}}"
- conditions:
- condition: state
entity_id: sensor.mullinformation
state: Grüne Tonne rausstellen!
sequence:
- action: script.awtrix_new_app
metadata: {}
data:
icon: 56625
rainbow: false
lifetime: 0
duration: 10
textcase: 2
topicname: Abfall
text: "{{ states('sensor.mullinformation')}}"
default:
- action: script.awtrix_delete_app
metadata: {}
data:
topicname: Abfall
- alias: Reboot, wenn RAM knapp wird
if:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.awtrix_b3dc90_free_ram
below: 50000
- condition: numeric_state
entity_id: sensor.awtrix_bebc10_free_ram
below: 50000
then:
- action: script.awtrix_reboot
metadata: {}
data: {}
mode: single
alias: awtrix Zustandstrigger description: "" triggers: - trigger: state entity_id: - sensor.evcc_tariff_grid - sensor.evcc_pv_power - sensor.aussentemperatur_ds18b20_temperature - sensor.evcc_battery_soc - sensor.smart_home_more_views - sensor.mullinformation - weather.lahr for: hours: 0 minutes: 0 seconds: 10 - trigger: state entity_id: - sensor.smart_home_more attribute: stars for: hours: 0 minutes: 0 seconds: 10 conditions: [] actions: - action: script.awtrix_new_app metadata: {} data: icon: 3813 rainbow: false lifetime: 0 duration: 5 textcase: 0 topicname: Tibber text: "{{ states('sensor.evcc_tariff_grid') | round(3) }}" alias: "Skript new App : Tibber" - if: - condition: numeric_state entity_id: sensor.evcc_pv_power above: 0 then: - action: script.awtrix_new_app metadata: {} data: icon: 37323 rainbow: false lifetime: 0 duration: 5 textcase: 0 topicname: PV text: "{{ states('sensor.evcc_pv_power') }}" alias: "Skript new App : Solar Power" else: - action: script.awtrix_delete_app metadata: {} data: topicname: PV alias: "PV Ertrag vorhanden " - action: script.awtrix_new_app metadata: {} data: icon: "{{ states('weather.lahr') }}" rainbow: false lifetime: 0 duration: 5 textcase: 0 topicname: Temperatur text: "{{ states('sensor.aussentemperatur_ds18b20_temperature') }} °" alias: "Skript new App : Aussentemperatur" - action: script.awtrix_new_app metadata: {} data: icon: 389 rainbow: false lifetime: 0 duration: 5 textcase: 0 topicname: SOC text: "{{ states('sensor.evcc_battery_soc') }} %" alias: "Skript new App : SOC Hausspeicher" - action: script.awtrix_new_app metadata: {} data: icon: 974 rainbow: false lifetime: 0 duration: 5 textcase: 2 topicname: Youtube text: >- {{ states('sensor.smart_home_more_views') }} - {{state_attr('sensor.smart_home_more', 'stars')}} alias: "Skript new App : YT Views und Likes" - alias: Indikator für genügend PV oder günstiger Preis if: - condition: or conditions: - condition: numeric_state entity_id: sensor.evcc_pv_power above: 1500 - condition: numeric_state entity_id: sensor.evcc_tariff_grid below: 0.28 then: - action: script.awtrix_indicator metadata: {} data: indicator: 1 colour: - 30 - 255 - 0 fade: 0 else: - action: script.awtrix_indicator metadata: {} data: indicator: 1 colour: - 255 - 0 - 0 fade: 0 - alias: Abfall Anzeige choose: - conditions: - condition: state entity_id: sensor.mullinformation state: Gelber Sack rausstellen! sequence: - action: script.awtrix_new_app metadata: {} data: icon: 56166 rainbow: false lifetime: 0 duration: 10 textcase: 2 topicname: Abfall text: "{{ states('sensor.mullinformation')}}" - conditions: - condition: state entity_id: sensor.mullinformation state: Graue Tonne rausstellen! sequence: - action: script.awtrix_new_app metadata: {} data: icon: 12155 rainbow: false lifetime: 0 duration: 10 textcase: 2 topicname: Abfall text: "{{ states('sensor.mullinformation')}}" - conditions: - condition: state entity_id: sensor.mullinformation state: Grüne Tonne rausstellen! sequence: - action: script.awtrix_new_app metadata: {} data: icon: 56625 rainbow: false lifetime: 0 duration: 10 textcase: 2 topicname: Abfall text: "{{ states('sensor.mullinformation')}}" default: - action: script.awtrix_delete_app metadata: {} data: topicname: Abfall - alias: Reboot, wenn RAM knapp wird if: - condition: or conditions: - condition: numeric_state entity_id: sensor.awtrix_b3dc90_free_ram below: 50000 - condition: numeric_state entity_id: sensor.awtrix_bebc10_free_ram below: 50000 then: - action: script.awtrix_reboot metadata: {} data: {} mode: single
alias: awtrix Zustandstrigger
description: ""
triggers:
  - trigger: state
    entity_id:
      - sensor.evcc_tariff_grid
      - sensor.evcc_pv_power
      - sensor.aussentemperatur_ds18b20_temperature
      - sensor.evcc_battery_soc
      - sensor.smart_home_more_views
      - sensor.mullinformation
      - weather.lahr
    for:
      hours: 0
      minutes: 0
      seconds: 10
  - trigger: state
    entity_id:
      - sensor.smart_home_more
    attribute: stars
    for:
      hours: 0
      minutes: 0
      seconds: 10
conditions: []
actions:
  - action: script.awtrix_new_app
    metadata: {}
    data:
      icon: 3813
      rainbow: false
      lifetime: 0
      duration: 5
      textcase: 0
      topicname: Tibber
      text: "{{ states('sensor.evcc_tariff_grid') | round(3) }}"
    alias: "Skript new App : Tibber"
  - if:
      - condition: numeric_state
        entity_id: sensor.evcc_pv_power
        above: 0
    then:
      - action: script.awtrix_new_app
        metadata: {}
        data:
          icon: 37323
          rainbow: false
          lifetime: 0
          duration: 5
          textcase: 0
          topicname: PV
          text: "{{ states('sensor.evcc_pv_power') }}"
        alias: "Skript new App : Solar Power"
    else:
      - action: script.awtrix_delete_app
        metadata: {}
        data:
          topicname: PV
    alias: "PV Ertrag vorhanden "
  - action: script.awtrix_new_app
    metadata: {}
    data:
      icon: "{{ states('weather.lahr') }}"
      rainbow: false
      lifetime: 0
      duration: 5
      textcase: 0
      topicname: Temperatur
      text: "{{ states('sensor.aussentemperatur_ds18b20_temperature') }} °"
    alias: "Skript new App : Aussentemperatur"
  - action: script.awtrix_new_app
    metadata: {}
    data:
      icon: 389
      rainbow: false
      lifetime: 0
      duration: 5
      textcase: 0
      topicname: SOC
      text: "{{ states('sensor.evcc_battery_soc') }} %"
    alias: "Skript new App : SOC Hausspeicher"
  - action: script.awtrix_new_app
    metadata: {}
    data:
      icon: 974
      rainbow: false
      lifetime: 0
      duration: 5
      textcase: 2
      topicname: Youtube
      text: >-
        {{ states('sensor.smart_home_more_views') }} -
        {{state_attr('sensor.smart_home_more', 'stars')}}
    alias: "Skript new App : YT Views und Likes"
  - alias: Indikator für genügend PV oder günstiger Preis
    if:
      - condition: or
        conditions:
          - condition: numeric_state
            entity_id: sensor.evcc_pv_power
            above: 1500
          - condition: numeric_state
            entity_id: sensor.evcc_tariff_grid
            below: 0.28
    then:
      - action: script.awtrix_indicator
        metadata: {}
        data:
          indicator: 1
          colour:
            - 30
            - 255
            - 0
          fade: 0
    else:
      - action: script.awtrix_indicator
        metadata: {}
        data:
          indicator: 1
          colour:
            - 255
            - 0
            - 0
          fade: 0
  - alias: Abfall Anzeige
    choose:
      - conditions:
          - condition: state
            entity_id: sensor.mullinformation
            state: Gelber Sack rausstellen!
        sequence:
          - action: script.awtrix_new_app
            metadata: {}
            data:
              icon: 56166
              rainbow: false
              lifetime: 0
              duration: 10
              textcase: 2
              topicname: Abfall
              text: "{{ states('sensor.mullinformation')}}"
      - conditions:
          - condition: state
            entity_id: sensor.mullinformation
            state: Graue Tonne rausstellen!
        sequence:
          - action: script.awtrix_new_app
            metadata: {}
            data:
              icon: 12155
              rainbow: false
              lifetime: 0
              duration: 10
              textcase: 2
              topicname: Abfall
              text: "{{ states('sensor.mullinformation')}}"
      - conditions:
          - condition: state
            entity_id: sensor.mullinformation
            state: Grüne Tonne rausstellen!
        sequence:
          - action: script.awtrix_new_app
            metadata: {}
            data:
              icon: 56625
              rainbow: false
              lifetime: 0
              duration: 10
              textcase: 2
              topicname: Abfall
              text: "{{ states('sensor.mullinformation')}}"
    default:
      - action: script.awtrix_delete_app
        metadata: {}
        data:
          topicname: Abfall
  - alias: Reboot, wenn RAM knapp wird
    if:
      - condition: or
        conditions:
          - condition: numeric_state
            entity_id: sensor.awtrix_b3dc90_free_ram
            below: 50000
          - condition: numeric_state
            entity_id: sensor.awtrix_bebc10_free_ram
            below: 50000
    then:
      - action: script.awtrix_reboot
        metadata: {}
        data: {}
mode: single

Update vom 03.12.2024 Textfarbe

Ich habe das Script noch erweitert, so dass auch eine RGB Farbe übergeben werden kann. Defaultwert ist „weiß“ , es muss auch keine Farbe angegeben werden.

Der neue Parameter nennt sich textcolor. Im Beispiel ist die Schriftfarbe auf „rot“ gesetzt worden.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: awtrix - new app
sequence:
- action: mqtt.publish
metadata: {}
data:
evaluate_payload: false
qos: 0
retain: false
topic: awtrix/custom/{{topicname}}
payload: |-
{
"text": "{{text}}",
"rainbow": {{rainbow|tojson}},
"duration": "{{duration}}",
"icon": "{{icon}}",
"scrollSpeed": 80,
"textCase": "{{textcase}}",
"lifetime": "{{lifetime}}",
"color": {{textcolor or [255, 255, 255] | tojson}}
}
- if:
- condition: template
value_template: "{{ showimmediately == true or showimmediately == TRUE }}"
then:
- action: mqtt.publish
metadata: {}
data:
evaluate_payload: false
qos: 0
retain: false
topic: awtrix/switch
payload: "{\"name\": \"{{topicname}}\"}"
description: ""
icon: mdi:led-strip
fields:
topicname:
selector:
text: null
name: topicname
required: true
description: Name of the topic - one topic per app
text:
selector:
text: null
name: text
required: true
description: Text to be displayed
icon:
selector:
text: {}
name: icon
required: true
description: Icon ID, needs to be present on the awtrix filesystem - default no icon
rainbow:
selector:
boolean: {}
name: rainbow
default: false
required: true
description: Rainbow text yes/no
lifetime:
selector:
number:
min: 0
max: 86400
step: 1
name: lifetime
default: 0
description: Discard app after X seconds - default 0 (never expire)
duration:
selector:
number:
min: 1
max: 180
step: 1
name: duration
default: 3
description: How many seconds should the message be displayed - default 3
textcase:
selector:
number:
min: 0
max: 2
step: 1
name: textCase
default: 0
description: >-
Changes the Uppercase setting. 0=global setting, 1=forces uppercase;
2=shows as it sent - default 0
showimmediately:
selector:
boolean: {}
name: showImmediately
required: false
description: Jumps the queue and displays the message immediately - default false
textcolor:
selector:
color_rgb: {}
name: textcolor
default:
- 255
- 255
- 255
required: false
description: set text color
mode: parallel
max: 10
alias: awtrix - new app sequence: - action: mqtt.publish metadata: {} data: evaluate_payload: false qos: 0 retain: false topic: awtrix/custom/{{topicname}} payload: |- { "text": "{{text}}", "rainbow": {{rainbow|tojson}}, "duration": "{{duration}}", "icon": "{{icon}}", "scrollSpeed": 80, "textCase": "{{textcase}}", "lifetime": "{{lifetime}}", "color": {{textcolor or [255, 255, 255] | tojson}} } - if: - condition: template value_template: "{{ showimmediately == true or showimmediately == TRUE }}" then: - action: mqtt.publish metadata: {} data: evaluate_payload: false qos: 0 retain: false topic: awtrix/switch payload: "{\"name\": \"{{topicname}}\"}" description: "" icon: mdi:led-strip fields: topicname: selector: text: null name: topicname required: true description: Name of the topic - one topic per app text: selector: text: null name: text required: true description: Text to be displayed icon: selector: text: {} name: icon required: true description: Icon ID, needs to be present on the awtrix filesystem - default no icon rainbow: selector: boolean: {} name: rainbow default: false required: true description: Rainbow text yes/no lifetime: selector: number: min: 0 max: 86400 step: 1 name: lifetime default: 0 description: Discard app after X seconds - default 0 (never expire) duration: selector: number: min: 1 max: 180 step: 1 name: duration default: 3 description: How many seconds should the message be displayed - default 3 textcase: selector: number: min: 0 max: 2 step: 1 name: textCase default: 0 description: >- Changes the Uppercase setting. 0=global setting, 1=forces uppercase; 2=shows as it sent - default 0 showimmediately: selector: boolean: {} name: showImmediately required: false description: Jumps the queue and displays the message immediately - default false textcolor: selector: color_rgb: {} name: textcolor default: - 255 - 255 - 255 required: false description: set text color mode: parallel max: 10
alias: awtrix - new app
sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: awtrix/custom/{{topicname}}
      payload: |-
        {
          "text": "{{text}}",
          "rainbow": {{rainbow|tojson}},
          "duration": "{{duration}}",
          "icon": "{{icon}}",
          "scrollSpeed": 80,
          "textCase": "{{textcase}}",
          "lifetime": "{{lifetime}}",
          "color": {{textcolor or [255, 255, 255] | tojson}}
        }
  - if:
      - condition: template
        value_template: "{{ showimmediately == true or showimmediately == TRUE }}"
    then:
      - action: mqtt.publish
        metadata: {}
        data:
          evaluate_payload: false
          qos: 0
          retain: false
          topic: awtrix/switch
          payload: "{\"name\": \"{{topicname}}\"}"
description: ""
icon: mdi:led-strip
fields:
  topicname:
    selector:
      text: null
    name: topicname
    required: true
    description: Name of the topic - one topic per app
  text:
    selector:
      text: null
    name: text
    required: true
    description: Text to be displayed
  icon:
    selector:
      text: {}
    name: icon
    required: true
    description: Icon ID, needs to be present on the awtrix filesystem - default no icon
  rainbow:
    selector:
      boolean: {}
    name: rainbow
    default: false
    required: true
    description: Rainbow text yes/no
  lifetime:
    selector:
      number:
        min: 0
        max: 86400
        step: 1
    name: lifetime
    default: 0
    description: Discard app after X seconds - default 0 (never expire)
  duration:
    selector:
      number:
        min: 1
        max: 180
        step: 1
    name: duration
    default: 3
    description: How many seconds should the message be displayed - default 3
  textcase:
    selector:
      number:
        min: 0
        max: 2
        step: 1
    name: textCase
    default: 0
    description: >-
      Changes the Uppercase setting. 0=global setting, 1=forces uppercase;
      2=shows as it sent - default 0
  showimmediately:
    selector:
      boolean: {}
    name: showImmediately
    required: false
    description: Jumps the queue and displays the message immediately - default false
  textcolor:
    selector:
      color_rgb: {}
    name: textcolor
    default:
      - 255
      - 255
      - 255
    required: false
    description: set text color
mode: parallel
max: 10

Update vom 05.12.2024 : Fortschrittsanzeige

Desto mehr man mit dem Display arbeitet, desto mehr Dinge fallen einem ein, was man damit alles realisieren kann. Ich habe das Script ergänzt um eine Fortschrittsanzeige, so dass ihr z.B. den Fortschritt eures Waschvorgangs oder eurer Geschirrspülmaschine anzeigen lassen könnt. Dann hat man im Blick, wann man die Wäsche aufhängen darf, oder das Geschirr ausräumen:-)

In diesem Beispiel habe ich einen Geschirrspüler dargestellt, der gerade ca. 80% seines Vorgangs beendet hat.

Ein neues Feld wurde dazu im Script ergänzt. Im Feld „progress“ übergebt ihr eure Entität , die einen Fortschritt in Prozent enthält ( 0-100% ).

Als Icon habe ich dafür die Nr. 55848 verwendet.

Das Feld muss nicht zwingend übergeben werden, so dass eure Automatisierungen davon nicht betroffen sind. Wird kein Wert übergeben, wird der Default Wert auf -1 gesetzt und kein Fortschritt wird angezeigt.

Das aktualisierte Script awtrix – new app

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: awtrix - new app
sequence:
- action: mqtt.publish
metadata: {}
data:
evaluate_payload: false
qos: 0
retain: false
topic: awtrix/custom/{{topicname}}
payload: |-
{
"text": "{{text}}",
"rainbow": {{rainbow|tojson}},
"duration": "{{duration}}",
"icon": "{{icon}}",
"scrollSpeed": 80,
"textCase": "{{textcase}}",
"lifetime": "{{lifetime}}",
"color": {{textcolor or [255, 255, 255] | tojson}},
"progress": {{ progress or -1 }}
}
- if:
- condition: template
value_template: "{{ showimmediately == true or showimmediately == True}}"
then:
- action: mqtt.publish
metadata: {}
data:
evaluate_payload: false
qos: 0
retain: false
topic: awtrix/switch
payload: "{\"name\": \"{{topicname}}\"}"
description: ""
icon: mdi:led-strip
fields:
topicname:
selector:
text: null
name: topicname
required: true
description: Name of the topic - one topic per app
text:
selector:
text: null
name: text
required: true
description: Text to be displayed
icon:
selector:
text: {}
name: icon
required: true
description: Icon ID, needs to be present on the awtrix filesystem - default no icon
rainbow:
selector:
boolean: {}
name: rainbow
default: false
required: true
description: Rainbow text yes/no
lifetime:
selector:
number:
min: 0
max: 86400
step: 1
name: lifetime
default: 0
description: Discard app after X seconds - default 0 (never expire)
duration:
selector:
number:
min: 1
max: 180
step: 1
name: duration
default: 3
description: How many seconds should the message be displayed - default 3
textcase:
selector:
number:
min: 0
max: 2
step: 1
name: textCase
default: 0
description: >-
Changes the Uppercase setting. 0=global setting, 1=forces uppercase;
2=shows as it sent - default 0
showimmediately:
selector:
boolean: {}
name: showImmediately
required: false
description: Jumps the queue and displays the message immediately - default false
textcolor:
selector:
color_rgb: {}
name: textcolor
default:
- 255
- 255
- 255
required: false
description: set text color
progress:
selector:
number:
min: 0
max: 99
step: 1
name: progress
description: "shows a progress bar (value range from 0-100) "
default: 0
mode: parallel
max: 10
alias: awtrix - new app sequence: - action: mqtt.publish metadata: {} data: evaluate_payload: false qos: 0 retain: false topic: awtrix/custom/{{topicname}} payload: |- { "text": "{{text}}", "rainbow": {{rainbow|tojson}}, "duration": "{{duration}}", "icon": "{{icon}}", "scrollSpeed": 80, "textCase": "{{textcase}}", "lifetime": "{{lifetime}}", "color": {{textcolor or [255, 255, 255] | tojson}}, "progress": {{ progress or -1 }} } - if: - condition: template value_template: "{{ showimmediately == true or showimmediately == True}}" then: - action: mqtt.publish metadata: {} data: evaluate_payload: false qos: 0 retain: false topic: awtrix/switch payload: "{\"name\": \"{{topicname}}\"}" description: "" icon: mdi:led-strip fields: topicname: selector: text: null name: topicname required: true description: Name of the topic - one topic per app text: selector: text: null name: text required: true description: Text to be displayed icon: selector: text: {} name: icon required: true description: Icon ID, needs to be present on the awtrix filesystem - default no icon rainbow: selector: boolean: {} name: rainbow default: false required: true description: Rainbow text yes/no lifetime: selector: number: min: 0 max: 86400 step: 1 name: lifetime default: 0 description: Discard app after X seconds - default 0 (never expire) duration: selector: number: min: 1 max: 180 step: 1 name: duration default: 3 description: How many seconds should the message be displayed - default 3 textcase: selector: number: min: 0 max: 2 step: 1 name: textCase default: 0 description: >- Changes the Uppercase setting. 0=global setting, 1=forces uppercase; 2=shows as it sent - default 0 showimmediately: selector: boolean: {} name: showImmediately required: false description: Jumps the queue and displays the message immediately - default false textcolor: selector: color_rgb: {} name: textcolor default: - 255 - 255 - 255 required: false description: set text color progress: selector: number: min: 0 max: 99 step: 1 name: progress description: "shows a progress bar (value range from 0-100) " default: 0 mode: parallel max: 10
alias: awtrix - new app
sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: awtrix/custom/{{topicname}}
      payload: |-
        {
          "text": "{{text}}",
          "rainbow": {{rainbow|tojson}},
          "duration": "{{duration}}",
          "icon": "{{icon}}",
          "scrollSpeed": 80,
          "textCase": "{{textcase}}",
          "lifetime": "{{lifetime}}",
          "color": {{textcolor or [255, 255, 255] | tojson}},
          "progress": {{ progress or -1 }}
        }
  - if:
      - condition: template
        value_template: "{{ showimmediately == true or showimmediately == True}}"
    then:
      - action: mqtt.publish
        metadata: {}
        data:
          evaluate_payload: false
          qos: 0
          retain: false
          topic: awtrix/switch
          payload: "{\"name\": \"{{topicname}}\"}"
description: ""
icon: mdi:led-strip
fields:
  topicname:
    selector:
      text: null
    name: topicname
    required: true
    description: Name of the topic - one topic per app
  text:
    selector:
      text: null
    name: text
    required: true
    description: Text to be displayed
  icon:
    selector:
      text: {}
    name: icon
    required: true
    description: Icon ID, needs to be present on the awtrix filesystem - default no icon
  rainbow:
    selector:
      boolean: {}
    name: rainbow
    default: false
    required: true
    description: Rainbow text yes/no
  lifetime:
    selector:
      number:
        min: 0
        max: 86400
        step: 1
    name: lifetime
    default: 0
    description: Discard app after X seconds - default 0 (never expire)
  duration:
    selector:
      number:
        min: 1
        max: 180
        step: 1
    name: duration
    default: 3
    description: How many seconds should the message be displayed - default 3
  textcase:
    selector:
      number:
        min: 0
        max: 2
        step: 1
    name: textCase
    default: 0
    description: >-
      Changes the Uppercase setting. 0=global setting, 1=forces uppercase;
      2=shows as it sent - default 0
  showimmediately:
    selector:
      boolean: {}
    name: showImmediately
    required: false
    description: Jumps the queue and displays the message immediately - default false
  textcolor:
    selector:
      color_rgb: {}
    name: textcolor
    default:
      - 255
      - 255
      - 255
    required: false
    description: set text color
  progress:
    selector:
      number:
        min: 0
        max: 99
        step: 1
    name: progress
    description: "shows a progress bar (value range from 0-100) "
    default: 0
mode: parallel
max: 10

Die Automatisierung dazu habe ich so gestaltet, dass mir die Meldung und der Fortschritt nur dann angezeigt werden, wenn der Fortschritt > 0 % ist. Ansonsten wird die Meldung wieder entfernt. Getriggert wird auf Änderung des Fortschritts.

Der Teilabschnitt für die Wenn/Dann Bedingung unter den Aktionen sieht wie folgt aus:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Geschirrspüler läuft
if:
- condition: numeric_state
entity_id: sensor.geschirrspuler_program_progress
above: 0
then:
- action: script.awtrix_new_app
metadata: {}
data:
icon: 55848
rainbow: false
lifetime: 0
duration: 5
textcase: 0
topicname: Dishwasher
text: Geschirrspüler läuft!
progress: "{{ states('sensor.geschirrspuler_program_progress') | int }}"
alias: "Skript new App : Fortschritt Geschirrspüler"
enabled: true
else:
- action: script.awtrix_delete_app
metadata: {}
data:
topicname: Dishwasher
alias: Geschirrspüler läuft if: - condition: numeric_state entity_id: sensor.geschirrspuler_program_progress above: 0 then: - action: script.awtrix_new_app metadata: {} data: icon: 55848 rainbow: false lifetime: 0 duration: 5 textcase: 0 topicname: Dishwasher text: Geschirrspüler läuft! progress: "{{ states('sensor.geschirrspuler_program_progress') | int }}" alias: "Skript new App : Fortschritt Geschirrspüler" enabled: true else: - action: script.awtrix_delete_app metadata: {} data: topicname: Dishwasher
alias: Geschirrspüler läuft
if:
  - condition: numeric_state
    entity_id: sensor.geschirrspuler_program_progress
    above: 0
then:
  - action: script.awtrix_new_app
    metadata: {}
    data:
      icon: 55848
      rainbow: false
      lifetime: 0
      duration: 5
      textcase: 0
      topicname: Dishwasher
      text: Geschirrspüler läuft!
      progress: "{{ states('sensor.geschirrspuler_program_progress') | int }}"
    alias: "Skript new App : Fortschritt Geschirrspüler"
    enabled: true
else:
  - action: script.awtrix_delete_app
    metadata: {}
    data:
      topicname: Dishwasher

📘 Home Assistant Helfer Kompendium 2/? 📲 [ Statistik]

Optimierung von Home Assistant Automatisierungen mit dem Statistik-Helfer

In meinem heutigen Artikel möchte ich dir zeigen, wie du den Statistik-Helfer in Home Assistant effektiv nutzen kannst, um tiefere Einblicke in deine Smart Home-Daten zu erhalten. Durch die richtigen Berechnungen kannst du deine Automatisierungen noch präziser und smarter gestalten. Hier sind die wichtigsten Charakteristika, die du mit dem Statistik-Helfer auswerten kannst:

1. Absoluter Abstand

Der absolute Abstand zeigt dir den Unterschied zwischen zwei Messwerten, ohne die Richtung zu berücksichtigen. Diese Berechnung ist besonders nützlich, wenn du Schwankungen in einem Wert überwachen möchtest, ohne die genaue Richtung zu verfolgen. Ich nutze diese Methode oft, um schnelle Veränderungen zu erkennen.

2. Abstand von 95% und 99% der Werte

Mit dieser Berechnung kann ich herausfinden, wie sich ein Wert im Vergleich zu den meisten anderen Werten verhält. Der Abstand von 95% und 99% der Werte hilft mir dabei, Ausreißer zu identifizieren und meine Automatisierungen so anzupassen, dass sie nur unter den typischen Bedingungen reagieren.

3. Ältester Zeitpunkt

Der älteste Zeitpunkt zeigt mir, wann der älteste Messwert aufgezeichnet wurde. Das ist besonders nützlich, wenn ich nach älteren Daten suche oder herausfinden möchte, wie lange es her ist, dass ein Wert zuletzt aktualisiert wurde. Diese Information kann wichtige Auswirkungen auf Automatisierungen haben, die sich auf historische Daten stützen.

4. Änderung

Die Änderung zeigt mir, wie stark sich ein Wert verändert hat, sei es positiv oder negativ. Ich verwende diese Berechnung, um zu verstehen, wie schnell oder langsam sich Werte entwickeln, was für zeitkritische Automatisierungen sehr hilfreich ist.

5. Anzahl der Werte

Die Anzahl der Werte gibt mir eine einfache Übersicht darüber, wie viele Messwerte über einen bestimmten Zeitraum hinweg erfasst wurden. Diese Zahl hilft mir dabei, Trends zu erkennen und zu überprüfen, ob die Sensoren korrekt arbeiten.

6. Arithmetisches Mittel

Das arithmetische Mittel (der Durchschnitt) ist eine der grundlegendsten Berechnungen und gibt mir eine Vorstellung vom allgemeinen Trend eines Messwerts. Ich nutze das Mittel, um Automatisierungen zu erstellen, die auf den durchschnittlichen Bedingungen basieren.

7. Durchschnittliche Änderung pro Probe oder Sekunde

Diese Berechnung zeigt mir, wie schnell sich ein Wert im Zeitverlauf verändert. Ich finde diese Kennzahl besonders nützlich bei der Überwachung von Sensoren, die schnelle Reaktionen erfordern, wie zum Beispiel Bewegungsmelder oder Temperaturfühler.

8. Gesamt

Die Gesamtberechnung summiert alle Werte innerhalb eines bestimmten Zeitrahmens. Ich verwende diese Methode oft, um den Gesamtverbrauch von Energie oder die Gesamtzahl von Ereignissen zu ermitteln. Diese Zahl ist besonders nützlich, wenn ich die gesamte Leistung oder Aktivität über einen längeren Zeitraum beobachten möchte.

9. Linearisierter Durchschnitt

Der linearisierte Durchschnitt hilft mir, Daten zu glätten und langfristige Trends zu erkennen. Diese Methode ist besonders hilfreich, wenn ich mit periodischen Schwankungen zu tun habe und die Daten auf eine lineare Skala übertragen möchte, um langfristige Muster besser sichtbar zu machen.


Durch die Nutzung dieser Berechnungen und der Einblicke, die der Statistik-Helfer bietet, kann ich meine Automatisierungen in Home Assistant noch gezielter und effizienter gestalten. Egal, ob du den Abstand zwischen Messwerten überwachen, die Änderungsgeschwindigkeit analysieren oder die Gesamttrends erkennen möchtest – dieser Helfer ist eine wertvolle Unterstützung für jede Home Assistant-Instanz.

In dieser Playlist findest du alle bisherigen und kommenden Videos zum Thema Home Assistant Helfer:

YouTube player

📘 Home Assistant Helfer Kompendium 1/? 📲 Mehr Kontrolle, weniger Aufwand!

Du willst das Beste aus deinem Home Assistant herausholen und suchst nach Möglichkeiten, deine Automationen smarter und individueller zu gestalten? In diesem Beitrag stelle ich dir drei Home Assistant Helfer vor, die dir genau das ermöglichen: den Ableitungssensor, das Dropdown-Menü und den generischen Hygrostat. Mit diesen Tools kannst du präzise Automatisierungen erstellen, die deine Wünsche und Anforderungen perfekt erfüllen.

Inhalt

  1. Ableitungssensor – Dynamische Anpassungen leicht gemacht 🚀Der Ableitungssensor ist ein geniales Tool, wenn du auf dynamische Veränderungen reagieren möchtest. Er eignet sich zum Beispiel, um den Anstieg oder Abfall eines Werts (wie Temperatur oder Luftfeuchtigkeit) zu erfassen und daraus passende Aktionen abzuleiten. So lässt sich etwa erkennen, ob eine Temperatur schnell steigt oder sinkt, und dann eine entsprechende Automation aktivieren – perfekt für Klimasteuerungen oder Belüftungsmanagement!
  2. Dropdown – Auswahlmöglichkeiten im Smart Home schaffen 📋Mit Dropdown-Listen kannst du verschiedene Auswahloptionen für dein Smart Home anlegen. Ob es sich um Räume, Gerätemodi oder Szenen handelt – Dropdown-Menüs bieten dir eine bequeme und übersichtliche Möglichkeit, Optionen zu verwalten und per Klick auszuwählen. Damit sparst du dir manuelle Eingaben und kannst über vordefinierte Auswahlfelder spezifische Aktionen und Automationen schnell und unkompliziert steuern.
  3. Generischer Hygrostat – Die perfekte Feuchtigkeitskontrolle 🌫️Der generische Hygrostat ist dein Helfer, wenn es um die Steuerung der Luftfeuchtigkeit in deinem Zuhause geht. Gerade für Räume wie das Badezimmer oder den Keller ist eine konstante Feuchtigkeitskontrolle entscheidend, um Schimmelbildung zu vermeiden und das Raumklima zu verbessern. Mit diesem Helfer kannst du gezielt Lüftungen oder Entfeuchter steuern und die Feuchtigkeit so optimal anpassen.

Fazit

Diese drei Home Assistant Helfer sind echte Multitalente und erweitern deine Möglichkeiten enorm. Von dynamischen Steuerungen mit dem Ableitungssensor über bequeme Auswahlmöglichkeiten mit Dropdown-Listen bis hin zur genauen Feuchtigkeitsregulierung mit dem generischen Hygrostat – hier findest du die passenden Werkzeuge für jede Automationsidee.

Falls du noch mehr über diese und andere Home Assistant Helfer erfahren möchtest, schau gerne auch in das zugehörige Video rein! Ich zeige dir Schritt für Schritt, wie du diese Helfer einrichten und nutzen kannst, um dein Smart Home noch intelligenter zu machen.


Willst du mehr solcher Smart-Home-Tipps und Ideen? Dann bleib dran – auf meinem Blog und YouTube-Kanal gibt’s regelmäßig neue Inhalte, um dein Zuhause noch smarter zu gestalten!

In dieser Playlist findest du alle bisherigen und kommenden Videos zum Thema Home Assistant Helfer:

YouTube player

🔍 Überwache Dein Smart Home wie ein Profi! 📊 Home Assistant Systemmonitoring einfach erklärt 🚀

In diesem Video zeige ich dir, wie du dein Smart Home mit Home Assistant perfekt überwachen kannst, damit alles reibungslos läuft! Durch das Systemmonitoring bleibst du immer über den Zustand deines Systems informiert, erkennst Probleme rechtzeitig und hältst die Leistung deines Smart Homes auf einem hohen Niveau. Gerade wenn du regelmäßig Geräte steuerst oder Automationen laufen lässt, ist ein zuverlässiges Monitoring unverzichtbar. Es sorgt nicht nur für Sicherheit, sondern gibt dir auch die Kontrolle, wie dein System „tickt“. Ich zeige dir, wie du das Monitoring-Tool in Home Assistant installieren und einrichten kannst – Schritt für Schritt und einfach erklärt. Anschließend gehen wir darauf ein, wie die einzelnen Komponenten und Sensoren funktionieren, damit du genau weißt, welche Daten dir angezeigt werden und was diese bedeuten. Sensoren spielen hier eine zentrale Rolle, da sie dir wichtige Infos liefern: von der CPU-Auslastung über die Temperatur bis hin zum freien Speicherplatz. So hast du alles auf einen Blick und kannst Störungen frühzeitig erkennen. Zum Schluss zeige ich dir, wie du diese Daten in eine kleine Automatisierung einbindest, sodass dein System im Notfall automatisch reagiert, etwa bei einem kritischen Speicherstand oder zu hoher Auslastung. Dein Home Assistant wird damit nicht nur smarter, sondern auch robuster. Perfekt für Einsteiger und erfahrene Home-Assistant-Nutzer, die ihr System auf das nächste Level heben möchten. Abonniere, um keine Tipps rund um dein Smart Home zu verpassen, und lass uns loslegen! 🎉

Die Automatisierung aus dem Video:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Systemzustände überwachen
description: >-
Sendet eine Benachrichtigung, wenn wichtige Systemzustände kritische Werte
überschreiten.
triggers:
- entity_id: sensor.localhost_cpu_auslastung_2
above: 80
trigger: numeric_state
- entity_id: sensor.localhost_speicherauslastung
above: 75
trigger: numeric_state
- entity_id: sensor.localhost_data_datentragernutzung
above: 90
trigger: numeric_state
actions:
- action: script.notify_all
metadata: {}
data:
alexa: false
message: " Warnung: Ein kritischer Systemzustand wurde erreicht! {% if trigger.entity_id == 'sensor.localhost_cpu_auslastung_2' %} CPU-Auslastung: {{ states('sensor.localhost_cpu_auslastung_2') }}% {% elif trigger.entity_id == 'sensor.localhost_speicherauslastung' %} RAM-Nutzung: {{ states('sensor.localhost_speicherauslastung') }}% {% elif trigger.entity_id == 'sensor.localhost_data_datentragernutzung' %} Festplattennutzung: {{ states('sensor.localhost_data_datentragernutzung') }}% {% endif %}"
mode: single
alias: Systemzustände überwachen description: >- Sendet eine Benachrichtigung, wenn wichtige Systemzustände kritische Werte überschreiten. triggers: - entity_id: sensor.localhost_cpu_auslastung_2 above: 80 trigger: numeric_state - entity_id: sensor.localhost_speicherauslastung above: 75 trigger: numeric_state - entity_id: sensor.localhost_data_datentragernutzung above: 90 trigger: numeric_state actions: - action: script.notify_all metadata: {} data: alexa: false message: " Warnung: Ein kritischer Systemzustand wurde erreicht! {% if trigger.entity_id == 'sensor.localhost_cpu_auslastung_2' %} CPU-Auslastung: {{ states('sensor.localhost_cpu_auslastung_2') }}% {% elif trigger.entity_id == 'sensor.localhost_speicherauslastung' %} RAM-Nutzung: {{ states('sensor.localhost_speicherauslastung') }}% {% elif trigger.entity_id == 'sensor.localhost_data_datentragernutzung' %} Festplattennutzung: {{ states('sensor.localhost_data_datentragernutzung') }}% {% endif %}" mode: single
alias: Systemzustände überwachen
description: >-
  Sendet eine Benachrichtigung, wenn wichtige Systemzustände kritische Werte
  überschreiten.
triggers:
  - entity_id: sensor.localhost_cpu_auslastung_2
    above: 80
    trigger: numeric_state
  - entity_id: sensor.localhost_speicherauslastung
    above: 75
    trigger: numeric_state
  - entity_id: sensor.localhost_data_datentragernutzung
    above: 90
    trigger: numeric_state
actions:
  - action: script.notify_all
    metadata: {}
    data:
      alexa: false
      message: "    Warnung: Ein kritischer Systemzustand wurde erreicht! {% if     trigger.entity_id == 'sensor.localhost_cpu_auslastung_2' %} CPU-Auslastung:     {{ states('sensor.localhost_cpu_auslastung_2') }}% {% elif trigger.entity_id     == 'sensor.localhost_speicherauslastung' %} RAM-Nutzung: {{     states('sensor.localhost_speicherauslastung') }}% {% elif trigger.entity_id     == 'sensor.localhost_data_datentragernutzung' %} Festplattennutzung: {{     states('sensor.localhost_data_datentragernutzung') }}% {% endif %}"
mode: single

Hinweis: In dieser Automatisierung wird ein Skript zur Ausgabe der Nachrichten verwendet. Weitere Informationen zum Skript findet ihr in hier. Bitte beachten, im Beispiel auf der verlinkten Seite nennt sich das Skript nicht „skript.notify_all“ sondern „script.notify_all_video2“. D.h. wenn ihr den Code kopieren wollt, müsst ihr den Namen des Skripts in der Automatisierung anpassen. Weitere Anpassungen von Device IDs und Notification Entitäten sind natürlich ebenfalls nach euren Entitäten anzupassen.

Ergänzend zum Blogbeitrag über Skripte, möchte ich euch hier nochmal das passende Skript für die obige Automatisierung veröffentlichen.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: notify_all
sequence:
- action: notify.mobile_app_iphone_tobias
metadata: {}
data:
message: "{{ message }}"
title: "{{ title }}"
- if:
- condition: template
value_template: "{{ alexa }}"
then:
- action: notify.alexa_media_keller
metadata: {}
data:
message: "{{ message }}"
title: "{{ title }}"
fields:
message:
selector:
text: null
name: message
title:
selector:
text: null
name: title
alexa:
selector:
boolean: {}
name: alexa
default: false
description: ""
alias: notify_all sequence: - action: notify.mobile_app_iphone_tobias metadata: {} data: message: "{{ message }}" title: "{{ title }}" - if: - condition: template value_template: "{{ alexa }}" then: - action: notify.alexa_media_keller metadata: {} data: message: "{{ message }}" title: "{{ title }}" fields: message: selector: text: null name: message title: selector: text: null name: title alexa: selector: boolean: {} name: alexa default: false description: ""
alias: notify_all
sequence:
  - action: notify.mobile_app_iphone_tobias
    metadata: {}
    data:
      message: "{{ message }}"
      title: "{{ title }}"
  - if:
      - condition: template
        value_template: "{{ alexa }}"
    then:
      - action: notify.alexa_media_keller
        metadata: {}
        data:
          message: "{{ message }}"
          title: "{{ title }}"
fields:
  message:
    selector:
      text: null
    name: message
  title:
    selector:
      text: null
    name: title
  alexa:
    selector:
      boolean: {}
    name: alexa
    default: false
description: ""

Brauchst du wirklich Skripte in Home Assistant? 🤔 So holst du das Maximum raus! 🚀💡

In diesem Video dreht sich alles um Skripte in Home Assistant – von den Grundlagen bis hin zu fortgeschrittenen Funktionen! 💡 Skripte helfen dir, deine Automatisierungen noch flexibler und leistungsfähiger zu gestalten. Ich zeige dir Schritt für Schritt, wie du ein Skript für Benachrichtigungen 📲 erstellst, es in deine Automatisierungen integrierst ⚙️ und mit erweiterten Features noch effizienter machst. Egal, ob du Einsteiger bist oder bereits tiefer in Home Assistant steckst – hier findest du wertvolle Tipps für das nächste Level deines Smart Homes! 🚀

Ich möchte euch heute einen allgemeinen Amazon-Link teilen, über den ihr eine Vielzahl von Produkten entdecken könnt. Egal, ob ihr nach Smart Home-Geräten, Gadgets oder anderen nützlichen Artikeln sucht, Amazon hat für jeden etwas zu bieten.

Wenn ihr über diesen Link einkauft, unterstützt ihr meinen Kanal, ohne dass es für euch zusätzliche Kosten verursacht. Das hilft mir, weiterhin spannende Inhalte für euch zu erstellen!

Hier ist der Link zu Amazon: https://amzn.to/3KsGngK

Vielen Dank für eure Unterstützung!

Skript mit Übergabeparametern

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Notify_ALL_Video2
sequence:
- action: notify.mobile_app_iphone_tobias
metadata: {}
data:
message: "{{ message }}"
title: "{{ title }}"
- if:
- condition: template
value_template: "{{ alexa }}"
then:
- action: notify.alexa_media_keller
metadata: {}
data:
message: "{{ message }}"
title: "{{ title }}"
fields:
message:
selector:
text: null
name: message
title:
selector:
text: null
name: title
alexa:
selector:
boolean: {}
name: alexa
default: false
description: ""
alias: Notify_ALL_Video2 sequence: - action: notify.mobile_app_iphone_tobias metadata: {} data: message: "{{ message }}" title: "{{ title }}" - if: - condition: template value_template: "{{ alexa }}" then: - action: notify.alexa_media_keller metadata: {} data: message: "{{ message }}" title: "{{ title }}" fields: message: selector: text: null name: message title: selector: text: null name: title alexa: selector: boolean: {} name: alexa default: false description: ""
alias: Notify_ALL_Video2
sequence:
  - action: notify.mobile_app_iphone_tobias
    metadata: {}
    data:
      message: "{{ message }}"
      title: "{{ title }}"
  - if:
      - condition: template
        value_template: "{{ alexa }}"
    then:
      - action: notify.alexa_media_keller
        metadata: {}
        data:
          message: "{{ message }}"
          title: "{{ title }}"
fields:
  message:
    selector:
      text: null
    name: message
  title:
    selector:
      text: null
    name: title
  alexa:
    selector:
      boolean: {}
    name: alexa
    default: false
description: ""

Automatisierung in dem das Skript mit Übergabeparametern verwendet wird

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Notify All Video 2
description: ""
triggers: []
conditions: []
actions:
- action: script.notify_all_video2
metadata: {}
data:
alexa: false
message: Es sind {{ states('sensor.temperatur_aussen_temperature') }} Grad
title: " Information"
mode: single
alias: Notify All Video 2 description: "" triggers: [] conditions: [] actions: - action: script.notify_all_video2 metadata: {} data: alexa: false message: Es sind {{ states('sensor.temperatur_aussen_temperature') }} Grad title: " Information" mode: single
alias: Notify All Video 2
description: ""
triggers: []
conditions: []
actions:
  - action: script.notify_all_video2
    metadata: {}
    data:
      alexa: false
      message: Es sind {{ states('sensor.temperatur_aussen_temperature') }} Grad
      title: " Information"
mode: single

Skript mit Rückgabewerten

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Rückgabewerte
sequence:
- variables:
ergebnis:
value: "{{ states(a) | int + states(b) | float }}"
- stop: Beendet
response_variable: ergebnis
fields:
b:
selector:
entity: {}
name: b
a:
selector:
entity: {}
name: a
description: ""
alias: Rückgabewerte sequence: - variables: ergebnis: value: "{{ states(a) | int + states(b) | float }}" - stop: Beendet response_variable: ergebnis fields: b: selector: entity: {} name: b a: selector: entity: {} name: a description: ""
alias: Rückgabewerte
sequence:
  - variables:
      ergebnis:
        value: "{{ states(a) | int + states(b) | float }}"
  - stop: Beendet
    response_variable: ergebnis
fields:
  b:
    selector:
      entity: {}
    name: b
  a:
    selector:
      entity: {}
    name: a
description: ""

Automatisierung zur Verwendung des Skripts mit Rückgabewerten

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Rückgabewerte
description: ""
triggers: []
conditions: []
actions:
- action: script.ruckgabewerte
metadata: {}
data:
b: sensor.temperatur_aussen_temperature
a: sensor.temperatur_aussen_temperature
response_variable: ergebnis
- action: notify.mobile_app_iphone_tobias
metadata: {}
data:
message: "{{ ergebnis.value}}"
- action: notify.alexa_media_keller
metadata: {}
data:
message: "{{ ergebnis.value}}"
mode: single
alias: Rückgabewerte description: "" triggers: [] conditions: [] actions: - action: script.ruckgabewerte metadata: {} data: b: sensor.temperatur_aussen_temperature a: sensor.temperatur_aussen_temperature response_variable: ergebnis - action: notify.mobile_app_iphone_tobias metadata: {} data: message: "{{ ergebnis.value}}" - action: notify.alexa_media_keller metadata: {} data: message: "{{ ergebnis.value}}" mode: single
alias: Rückgabewerte
description: ""
triggers: []
conditions: []
actions:
  - action: script.ruckgabewerte
    metadata: {}
    data:
      b: sensor.temperatur_aussen_temperature
      a: sensor.temperatur_aussen_temperature
    response_variable: ergebnis
  - action: notify.mobile_app_iphone_tobias
    metadata: {}
    data:
      message: "{{ ergebnis.value}}"
  - action: notify.alexa_media_keller
    metadata: {}
    data:
      message: "{{ ergebnis.value}}"
mode: single

Home Assistant meets Community | Deine Automatisierungen im Spotlight! 💡🏡

In meinem neuesten Video „Home Assistant meets Community“ zeigen drei Mitglieder unserer tollen Smart Home-Community ihre beeindruckenden und auch praktischen Automatisierungen.

Die Vielfalt der Möglichkeiten, die Home Assistant bietet, direkt aus der Community.


Mach mit und präsentiere deine eigenen Automatisierungen!

Aber das ist erst der Anfang! In diesem neuen Format geht es darum, dass du als Teil der Community deine eigenen Automatisierungen vorstellst.

Erstelle dein eigenes Video!

Du hast die Chance, dein eigenes Video zu erstellen, in dem du deine Home Assistant-Projekte /oder Automatisierungen präsentierst. Diese Videos werden in zukünftigen Episoden von „Home Assistant meets Community“ gezeigt!


Wie kannst du mitmachen?

Auf meiner Blog-Seite findest du ein Formular, das dir Schritt für Schritt erklärt, wie du mitmachen kannst. Es ist ganz einfach! Teile deine kreativen Lösungen und Automatisierungen mit der Community und werde Teil dieses neuen Formats!


Jetzt bist du dran!

Lass uns deine Home Assistant-Automatisierungen sehen und inspirieren wir uns gegenseitig mit neuen Ideen!

Schau dir das Video an und werde Teil unserer wachsenden Community!

Wie schon im Video erwähnt, möchte ich euch die Automatisierungen aus den Videos zur Verfügung stellen. Die Beiträge werden noch auf dem Discord Server ergänzt werden.

Vielen Dank an dieser Stelle für die tollen Beiträge von Jonathan, Maikel und René.

Community Beitrag 1 – Jonathan

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Licht aus um Mitternacht
description: ""
trigger:
- platform: time
at: "00:00:00"
condition: []
action:
- target:
label_id: power_off_at_midnight
data: {}
action: homeassistant.turn_off
mode: single
alias: Licht aus um Mitternacht description: "" trigger: - platform: time at: "00:00:00" condition: [] action: - target: label_id: power_off_at_midnight data: {} action: homeassistant.turn_off mode: single
alias: Licht aus um Mitternacht
description: ""
trigger:
  - platform: time
    at: "00:00:00"
condition: []
action:
  - target:
      label_id: power_off_at_midnight
    data: {}
    action: homeassistant.turn_off
mode: single

Community Beitrag 2 – Jonathan

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Erkenne unsauberen Neustart
description: ""
trigger:
- platform: homeassistant
event: start
id: start
- platform: homeassistant
event: shutdown
id: stop
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- stop
sequence:
- action: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.clean_shutdown
- conditions:
- condition: trigger
id:
- start
sequence:
- if:
- condition: state
entity_id: input_boolean.clean_shutdown
state: "off"
then:
- action: notify.mobile_app_oneplus8
metadata: {}
data:
message: Unsauberer Neustart entdeckt
- action: input_boolean.turn_off
target:
entity_id:
- input_boolean.clean_shutdown
data: {}
mode: single
alias: Erkenne unsauberen Neustart description: "" trigger: - platform: homeassistant event: start id: start - platform: homeassistant event: shutdown id: stop condition: [] action: - choose: - conditions: - condition: trigger id: - stop sequence: - action: input_boolean.turn_on metadata: {} data: {} target: entity_id: input_boolean.clean_shutdown - conditions: - condition: trigger id: - start sequence: - if: - condition: state entity_id: input_boolean.clean_shutdown state: "off" then: - action: notify.mobile_app_oneplus8 metadata: {} data: message: Unsauberer Neustart entdeckt - action: input_boolean.turn_off target: entity_id: - input_boolean.clean_shutdown data: {} mode: single
alias: Erkenne unsauberen Neustart
description: ""
trigger:
  - platform: homeassistant
    event: start
    id: start
  - platform: homeassistant
    event: shutdown
    id: stop
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - stop
        sequence:
          - action: input_boolean.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: input_boolean.clean_shutdown
      - conditions:
          - condition: trigger
            id:
              - start
        sequence:
          - if:
              - condition: state
                entity_id: input_boolean.clean_shutdown
                state: "off"
            then:
              - action: notify.mobile_app_oneplus8
                metadata: {}
                data:
                  message: Unsauberer Neustart entdeckt
          - action: input_boolean.turn_off
            target:
              entity_id:
                - input_boolean.clean_shutdown
            data: {}
mode: single

Community Beitrag 3 – Jonathan

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Bewegungsmelder Keller
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.bewegungsmelder_keller_occupancy
to: "on"
condition: []
action:
- repeat:
count: 10
sequence:
- metadata: {}
data: {}
target:
entity_id: switch.jonathans_3_echo_dot_do_not_disturb_switch
action: switch.toggle
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
mode: single
alias: Bewegungsmelder Keller description: "" trigger: - platform: state entity_id: - binary_sensor.bewegungsmelder_keller_occupancy to: "on" condition: [] action: - repeat: count: 10 sequence: - metadata: {} data: {} target: entity_id: switch.jonathans_3_echo_dot_do_not_disturb_switch action: switch.toggle - delay: hours: 0 minutes: 0 seconds: 1 milliseconds: 0 mode: single
alias: Bewegungsmelder Keller
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.bewegungsmelder_keller_occupancy
    to: "on"
condition: []
action:
  - repeat:
      count: 10
      sequence:
        - metadata: {}
          data: {}
          target:
            entity_id: switch.jonathans_3_echo_dot_do_not_disturb_switch
          action: switch.toggle
        - delay:
            hours: 0
            minutes: 0
            seconds: 1
            milliseconds: 0
mode: single

Community Beitrag 4 – Maikel

Für die Automatisierung von Maikel werden drei Helfer benötigt.

  1. Helfer Taster Sommerzeit
  2. Helfer Taster Winterzeit
  3. Helfer Schalter : Sommerzeit/Winterzeit

Ebenfalls müssen zur Verwendung in der configuration.yaml zwei history_stats Sensoren angelegt werden, die beim jeweiligen Zeitpunkt der Betätigung dazu dienen , dass eine Zeit hochgezählt wird.

History Statistik Sensor 1:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
platform: history_stats
name: WG - Historysensor - Sommerzeit
entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
unique_id: 'wg_historysensor_sommerzeit'
state: "on"
type: time
start: >
{% set status= states('input_button.wg_helfer_taste_sommerzeit') %}
{% if status in ['unknown', 'unavailable'] %}
{{ now() }}
{% else %}
{{ status | as_datetime }}
{% endif %}
end: "{{ now() }}"
platform: history_stats name: WG - Historysensor - Sommerzeit entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit unique_id: 'wg_historysensor_sommerzeit' state: "on" type: time start: > {% set status= states('input_button.wg_helfer_taste_sommerzeit') %} {% if status in ['unknown', 'unavailable'] %} {{ now() }} {% else %} {{ status | as_datetime }} {% endif %} end: "{{ now() }}"
platform: history_stats
name: WG - Historysensor - Sommerzeit
entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
unique_id: 'wg_historysensor_sommerzeit'
state: "on"
type: time
start:  >
        {% set status= states('input_button.wg_helfer_taste_sommerzeit') %}
        {% if status in ['unknown', 'unavailable'] %}
        {{ now() }}
        {% else %}
        {{ status | as_datetime }}
        {% endif %}
end: "{{ now() }}"

History Statisik Sensor 2:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
platform: history_stats
name: WG - Historysensor - Winterzeit
entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
unique_id: 'wg_historysensor_winterzeit'
state: "off"
type: time
start: >
{% set status= states('input_button.wg_helfer_taste_winterzeit') %}
{% if status in ['unknown', 'unavailable'] %}
{{ now() }}
{% else %}
{{ status | as_datetime }}
{% endif %}
end: "{{ now() }}"
platform: history_stats name: WG - Historysensor - Winterzeit entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit unique_id: 'wg_historysensor_winterzeit' state: "off" type: time start: > {% set status= states('input_button.wg_helfer_taste_winterzeit') %} {% if status in ['unknown', 'unavailable'] %} {{ now() }} {% else %} {{ status | as_datetime }} {% endif %} end: "{{ now() }}"
platform: history_stats
name: WG - Historysensor - Winterzeit
entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
unique_id: 'wg_historysensor_winterzeit'
state: "off"
type: time
start:  >
        {% set status= states('input_button.wg_helfer_taste_winterzeit') %}
        {% if status in ['unknown', 'unavailable'] %}
        {{ now() }}
        {% else %}
        {{ status | as_datetime }}
        {% endif %}
end: "{{ now() }}"

Automatisierung:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: "[WG] Sommer- Wintermodus"
description: ""
trigger:
- platform: time_pattern
hours: /1
id: Jede Stunde
- platform: numeric_state
entity_id:
- sensor.bk_thermometer_temperature
below: 10
id: 10 °C -
- platform: numeric_state
entity_id:
- sensor.bk_thermometer_temperature
above: 10
id: 10 °C +
- platform: numeric_state
entity_id:
- sensor.wg_historysensor_winterzeit
above: 168
id: History Sensor Wintermodus
- platform: numeric_state
entity_id:
- sensor.wg_historysensor_sommerzeit
above: 168
id: History Sensor Sommerzeit
condition: []
action:
- alias: Sommermodus
if:
- condition: trigger
id:
- History Sensor Sommerzeit
- Jede Stunde
- 10 °C +
then:
- alias: Sommermodus an
if:
- condition: numeric_state
entity_id: sensor.bk_thermometer_temperature
above: 10
- condition: numeric_state
entity_id: sensor.wg_historysensor_winterzeit
above: 168
- condition: state
entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
state: "off"
then:
- metadata: {}
data: {}
target:
entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
action: input_boolean.turn_on
- metadata: {}
data: {}
target:
entity_id:
- input_button.wg_helfer_taste_sommerzeit
- input_button.wg_helfer_taste_winterzeit
action: input_button.press
- metadata: {}
data: {}
action: script.wg_automationen_an
- metadata: {}
data: {}
action: script.zs_wg_kalender_sonstiges_sommermodus
- data:
summary: Pfanzenzubehör wieder auf den Balkon räumen
start_date_time: |
{{ (now() + timedelta(days = 1)).strftime("%Y-%m-%d")}} 15:10:00
end_date_time: |
{{ (now() + timedelta(days = 1)).strftime("%Y-%m-%d")}} 15:11:00
target:
entity_id: calendar.garten
action: calendar.create_event
- alias: Sommermodus reset
if:
- condition: numeric_state
entity_id: sensor.bk_thermometer_temperature
above: 10
- condition: state
entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
state: "on"
then:
- metadata: {}
data: {}
target:
entity_id: input_button.wg_helfer_taste_sommerzeit
action: input_button.press
- alias: Wintermodus
if:
- condition: trigger
id:
- History Sensor Wintermodus
- 10 °C -
- Jede Stunde
then:
- alias: Wintermodus an
if:
- condition: numeric_state
entity_id: sensor.bk_thermometer_temperature
below: 10
- condition: numeric_state
entity_id: sensor.wg_historysensor_sommerzeit
above: 168
- condition: state
entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
state: "on"
then:
- target:
entity_id:
- input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
data: {}
action: input_boolean.turn_off
- metadata: {}
data: {}
target:
entity_id:
- input_button.wg_helfer_taste_winterzeit
- input_button.wg_helfer_taste_sommerzeit
action: input_button.press
- metadata: {}
data: {}
action: script.wg_automationen_an
- data: {}
action: script.zs_wg_kalender_sonstiges_wintermodus
- data:
summary: Pfanzenzubehör wieder vom Balkon räumen
start_date_time: |
{{ (now() + timedelta(days = 1)).strftime("%Y-%m-%d")}} 15:10:00
end_date_time: |
{{ (now() + timedelta(days = 1)).strftime("%Y-%m-%d")}} 15:11:00
target:
entity_id: calendar.garten
action: calendar.create_event
- alias: Wintermodus reset
if:
- condition: numeric_state
entity_id: sensor.bk_thermometer_temperature
below: 10
- condition: state
entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
state: "off"
then:
- metadata: {}
data: {}
target:
entity_id:
- input_button.wg_helfer_taste_winterzeit
action: input_button.press
mode: parallel
max: 30
alias: "[WG] Sommer- Wintermodus" description: "" trigger: - platform: time_pattern hours: /1 id: Jede Stunde - platform: numeric_state entity_id: - sensor.bk_thermometer_temperature below: 10 id: 10 °C - - platform: numeric_state entity_id: - sensor.bk_thermometer_temperature above: 10 id: 10 °C + - platform: numeric_state entity_id: - sensor.wg_historysensor_winterzeit above: 168 id: History Sensor Wintermodus - platform: numeric_state entity_id: - sensor.wg_historysensor_sommerzeit above: 168 id: History Sensor Sommerzeit condition: [] action: - alias: Sommermodus if: - condition: trigger id: - History Sensor Sommerzeit - Jede Stunde - 10 °C + then: - alias: Sommermodus an if: - condition: numeric_state entity_id: sensor.bk_thermometer_temperature above: 10 - condition: numeric_state entity_id: sensor.wg_historysensor_winterzeit above: 168 - condition: state entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit state: "off" then: - metadata: {} data: {} target: entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit action: input_boolean.turn_on - metadata: {} data: {} target: entity_id: - input_button.wg_helfer_taste_sommerzeit - input_button.wg_helfer_taste_winterzeit action: input_button.press - metadata: {} data: {} action: script.wg_automationen_an - metadata: {} data: {} action: script.zs_wg_kalender_sonstiges_sommermodus - data: summary: Pfanzenzubehör wieder auf den Balkon räumen start_date_time: | {{ (now() + timedelta(days = 1)).strftime("%Y-%m-%d")}} 15:10:00 end_date_time: | {{ (now() + timedelta(days = 1)).strftime("%Y-%m-%d")}} 15:11:00 target: entity_id: calendar.garten action: calendar.create_event - alias: Sommermodus reset if: - condition: numeric_state entity_id: sensor.bk_thermometer_temperature above: 10 - condition: state entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit state: "on" then: - metadata: {} data: {} target: entity_id: input_button.wg_helfer_taste_sommerzeit action: input_button.press - alias: Wintermodus if: - condition: trigger id: - History Sensor Wintermodus - 10 °C - - Jede Stunde then: - alias: Wintermodus an if: - condition: numeric_state entity_id: sensor.bk_thermometer_temperature below: 10 - condition: numeric_state entity_id: sensor.wg_historysensor_sommerzeit above: 168 - condition: state entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit state: "on" then: - target: entity_id: - input_boolean.wg_helfer_schalter_sommerzeit_winterzeit data: {} action: input_boolean.turn_off - metadata: {} data: {} target: entity_id: - input_button.wg_helfer_taste_winterzeit - input_button.wg_helfer_taste_sommerzeit action: input_button.press - metadata: {} data: {} action: script.wg_automationen_an - data: {} action: script.zs_wg_kalender_sonstiges_wintermodus - data: summary: Pfanzenzubehör wieder vom Balkon räumen start_date_time: | {{ (now() + timedelta(days = 1)).strftime("%Y-%m-%d")}} 15:10:00 end_date_time: | {{ (now() + timedelta(days = 1)).strftime("%Y-%m-%d")}} 15:11:00 target: entity_id: calendar.garten action: calendar.create_event - alias: Wintermodus reset if: - condition: numeric_state entity_id: sensor.bk_thermometer_temperature below: 10 - condition: state entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit state: "off" then: - metadata: {} data: {} target: entity_id: - input_button.wg_helfer_taste_winterzeit action: input_button.press mode: parallel max: 30
alias: "[WG] Sommer- Wintermodus"
description: ""
trigger:
  - platform: time_pattern
    hours: /1
    id: Jede Stunde
  - platform: numeric_state
    entity_id:
      - sensor.bk_thermometer_temperature
    below: 10
    id: 10 °C -
  - platform: numeric_state
    entity_id:
      - sensor.bk_thermometer_temperature
    above: 10
    id: 10 °C +
  - platform: numeric_state
    entity_id:
      - sensor.wg_historysensor_winterzeit
    above: 168
    id: History Sensor Wintermodus
  - platform: numeric_state
    entity_id:
      - sensor.wg_historysensor_sommerzeit
    above: 168
    id: History Sensor Sommerzeit
condition: []
action:
  - alias: Sommermodus
    if:
      - condition: trigger
        id:
          - History Sensor Sommerzeit
          - Jede Stunde
          - 10 °C +
    then:
      - alias: Sommermodus an
        if:
          - condition: numeric_state
            entity_id: sensor.bk_thermometer_temperature
            above: 10
          - condition: numeric_state
            entity_id: sensor.wg_historysensor_winterzeit
            above: 168
          - condition: state
            entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
            state: "off"
        then:
          - metadata: {}
            data: {}
            target:
              entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
            action: input_boolean.turn_on
          - metadata: {}
            data: {}
            target:
              entity_id:
                - input_button.wg_helfer_taste_sommerzeit
                - input_button.wg_helfer_taste_winterzeit
            action: input_button.press
          - metadata: {}
            data: {}
            action: script.wg_automationen_an
          - metadata: {}
            data: {}
            action: script.zs_wg_kalender_sonstiges_sommermodus
          - data:
              summary: Pfanzenzubehör wieder auf den Balkon räumen
              start_date_time: |
                {{ (now() + timedelta(days = 1)).strftime("%Y-%m-%d")}} 15:10:00
              end_date_time: |
                {{ (now() + timedelta(days = 1)).strftime("%Y-%m-%d")}} 15:11:00
            target:
              entity_id: calendar.garten
            action: calendar.create_event
      - alias: Sommermodus reset
        if:
          - condition: numeric_state
            entity_id: sensor.bk_thermometer_temperature
            above: 10
          - condition: state
            entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
            state: "on"
        then:
          - metadata: {}
            data: {}
            target:
              entity_id: input_button.wg_helfer_taste_sommerzeit
            action: input_button.press
  - alias: Wintermodus
    if:
      - condition: trigger
        id:
          - History Sensor Wintermodus
          - 10 °C -
          - Jede Stunde
    then:
      - alias: Wintermodus an
        if:
          - condition: numeric_state
            entity_id: sensor.bk_thermometer_temperature
            below: 10
          - condition: numeric_state
            entity_id: sensor.wg_historysensor_sommerzeit
            above: 168
          - condition: state
            entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
            state: "on"
        then:
          - target:
              entity_id:
                - input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
            data: {}
            action: input_boolean.turn_off
          - metadata: {}
            data: {}
            target:
              entity_id:
                - input_button.wg_helfer_taste_winterzeit
                - input_button.wg_helfer_taste_sommerzeit
            action: input_button.press
          - metadata: {}
            data: {}
            action: script.wg_automationen_an
          - data: {}
            action: script.zs_wg_kalender_sonstiges_wintermodus
          - data:
              summary: Pfanzenzubehör wieder vom Balkon räumen
              start_date_time: |
                {{ (now() + timedelta(days = 1)).strftime("%Y-%m-%d")}} 15:10:00
              end_date_time: |
                {{ (now() + timedelta(days = 1)).strftime("%Y-%m-%d")}} 15:11:00
            target:
              entity_id: calendar.garten
            action: calendar.create_event
      - alias: Wintermodus reset
        if:
          - condition: numeric_state
            entity_id: sensor.bk_thermometer_temperature
            below: 10
          - condition: state
            entity_id: input_boolean.wg_helfer_schalter_sommerzeit_winterzeit
            state: "off"
        then:
          - metadata: {}
            data: {}
            target:
              entity_id:
                - input_button.wg_helfer_taste_winterzeit
            action: input_button.press
mode: parallel
max: 30

Von Null ➡️ zur perfekten Lichtsteuerung 💡 – 3 smarte Automatisierungen für jedes Level! 🔥

💡 Licht an – aber smart! In diesem Video zeige ich dir drei coole Automatisierungen rund um deine Beleuchtung – von super einfach bis beeindruckend komplex! 🌟 Egal, ob du gerade mit deinem Smart Home startest oder bereits ein Profi bist – hier ist für jeden etwas dabei! 🚀

➡️ Stufe 1: Eine einfache, aber effektive Automatisierung, die deine Beleuchtung smart macht – perfekt für den Einstieg!

➡️ Stufe 2: Noch smarter wird es mit einer mittleren Automatisierung, die deine Lichter intelligent steuert!

➡️ Stufe 3: Für die Technik-Enthusiasten – eine komplexe Beleuchtungsautomatisierung, die dein Zuhause ins beste Licht rückt!

🔥 Mach dein Zuhause smarter und genieße mehr Komfort mit diesen cleveren Lichtsteuerungen. Perfekt für jeden, der mehr aus seiner Beleuchtung rausholen will! ✨

Ich möchte euch heute einen allgemeinen Amazon-Link teilen, über den ihr eine Vielzahl von Produkten entdecken könnt. Egal, ob ihr nach Smart Home-Geräten, Gadgets oder anderen nützlichen Artikeln sucht, Amazon hat für jeden etwas zu bieten.

Wenn ihr über diesen Link einkauft, unterstützt ihr meinen Kanal, ohne dass es für euch zusätzliche Kosten verursacht. Das hilft mir, weiterhin spannende Inhalte für euch zu erstellen!

Hier ist der Link zu Amazon: https://amzn.to/3KsGngK

Vielen Dank für eure Unterstützung!

Automatisierung 1 ( Level Einstieg )

Und hier noch die Details aus den jeweiligen Aktionen:

Diese Automatisierung schaltet das Licht im Büro (spezifisch die Lampen „Klavinova oben“ und „Klavinova unten“) ein, sobald der Bewegungsmelder im Büro (binary_sensor.bewegungsmelder_buro_bilderrahmen_occupancy) eine Bewegung erkennt. Das Licht wird auf 100 % Helligkeit und eine Farbtemperatur von 5514 Kelvin eingestellt. Nach einer Verzögerung von 10 Sekunden schaltet sich das Licht wieder aus. Die Automatisierung hat keine Bedingungen und wird im „Restart“-Modus ausgeführt, was bedeutet, dass sie neu gestartet wird, falls sie während ihrer Ausführung erneut ausgelöst wird.

Weitere Infos zu den Automatisierungsmodi findest du in diesem Video, das dir bestimmt dabei hilft die unterschiedlichen Automatisierungsmodi besser zu verstehen.

YouTube player

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Bewegungsmelder einfach Büro Klavinova
description: ""
triggers:
- trigger: state
entity_id:
- binary_sensor.bewegungsmelder_buro_bilderrahmen_occupancy
to: "on"
conditions: []
actions:
- action: light.turn_on
metadata: {}
data:
kelvin: 5514
brightness_pct: 100
target:
entity_id:
- light.buro_klavinova_oben
- light.buro_klavinova_unten
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- action: light.turn_off
target:
entity_id:
- light.buro_klavinova_oben
- light.buro_klavinova_unten
data: {}
mode: restart
alias: Bewegungsmelder einfach Büro Klavinova description: "" triggers: - trigger: state entity_id: - binary_sensor.bewegungsmelder_buro_bilderrahmen_occupancy to: "on" conditions: [] actions: - action: light.turn_on metadata: {} data: kelvin: 5514 brightness_pct: 100 target: entity_id: - light.buro_klavinova_oben - light.buro_klavinova_unten - delay: hours: 0 minutes: 0 seconds: 10 milliseconds: 0 - action: light.turn_off target: entity_id: - light.buro_klavinova_oben - light.buro_klavinova_unten data: {} mode: restart
alias: Bewegungsmelder einfach Büro Klavinova
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.bewegungsmelder_buro_bilderrahmen_occupancy
    to: "on"
conditions: []
actions:
  - action: light.turn_on
    metadata: {}
    data:
      kelvin: 5514
      brightness_pct: 100
    target:
      entity_id:
        - light.buro_klavinova_oben
        - light.buro_klavinova_unten
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - action: light.turn_off
    target:
      entity_id:
        - light.buro_klavinova_oben
        - light.buro_klavinova_unten
    data: {}
mode: restart

Automatisierung 2 ( Level Mittel )

Diese Automatisierung sorgt dafür, dass das Licht im Flur des Erdgeschosses basierend auf Bewegung und Tageszeit automatisch gesteuert wird.

  1. Auslöser (Trigger): Die Automatisierung startet, wenn entweder einer der beiden Bewegungsmelder im Flur oder an der Haustür eine Bewegung erkennt oder die Haustür geöffnet wird.
  2. Aktionen tagsüber (zwischen 6:00 und 19:00 Uhr):
    • Wenn es draußen dunkler als 150 Lux ist und der Nachtmodus nicht aktiviert ist, schalten sich die Lampen im Flur und an der Treppe mit 50 % Helligkeit und einer kühlen Lichtfarbe (6500 Kelvin) an.
    • Nach 2 Minuten wird die Helligkeit der Lampen auf 1 % heruntergedimmt.
    • Weitere 2 Minuten später werden die Lampen komplett ausgeschaltet.
  3. Aktionen nachts (zwischen 19:00 und 6:00 Uhr):
    • Das Licht schaltet sich ebenfalls ein, aber mit einer wärmeren Lichtfarbe (2000 Kelvin) und auch hier mit 50 % Helligkeit.
    • Nach 2 Minuten dimmt das Licht auf 1 % Helligkeit herunter.
    • Weitere 2 Minuten später geht das Licht aus.

Der Modus „Restart“ bedeutet, dass die Automatisierung neu gestartet wird, wenn sie erneut ausgelöst wird, während sie noch aktiv ist.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Bewegungsmelder Flur EG Video
description: ""
triggers:
- trigger: state
entity_id:
- binary_sensor.bewegungsmelder_flur_treppenhaus_eg_occupancy
- binary_sensor.bewegungsmelder_flur_haustur_eg_occupancy
- binary_sensor.haustur_eg_contact
to: "on"
conditions: []
actions:
- choose:
- conditions:
- condition: and
conditions:
- condition: time
after: "06:00:00"
before: "19:00:00"
- condition: not
conditions:
- condition: state
entity_id: input_boolean.notify_night
state: "on"
alias: Nachtmodus ist nicht aktiv
- condition: numeric_state
entity_id: sensor.bewegungsmelder_flur_treppenhaus_eg_illuminance_lux
below: 150
sequence:
- action: light.turn_on
metadata: {}
data:
kelvin: 6500
brightness_pct: 50
transition: 2
target:
entity_id:
- light.flur_eg_haustur_deckenlampe
- light.flur_eg_treppe_deckenlampe
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- action: light.turn_on
metadata: {}
data:
kelvin: 6500
brightness_pct: 1
transition: 2
target:
entity_id:
- light.flur_eg_haustur_deckenlampe
- light.flur_eg_treppe_deckenlampe
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- action: light.turn_off
target:
entity_id:
- light.flur_eg_haustur_deckenlampe
- light.flur_eg_treppe_deckenlampe
data:
transition: 2
- conditions:
- condition: and
conditions:
- condition: time
after: "19:00:00"
before: "06:00:00"
- condition: not
conditions:
- condition: state
entity_id: input_boolean.notify_night
state: "on"
alias: Nachtmodus nicht aktiv
sequence:
- action: light.turn_on
metadata: {}
data:
kelvin: 2000
brightness_pct: 50
transition: 2
target:
entity_id:
- light.flur_eg_haustur_deckenlampe
- light.flur_eg_treppe_deckenlampe
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- action: light.turn_on
metadata: {}
data:
kelvin: 2000
brightness_pct: 1
transition: 2
target:
entity_id:
- light.flur_eg_haustur_deckenlampe
- light.flur_eg_treppe_deckenlampe
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- action: light.turn_off
target:
entity_id:
- light.flur_eg_haustur_deckenlampe
- light.flur_eg_treppe_deckenlampe
data:
transition: 2
mode: restart
alias: Bewegungsmelder Flur EG Video description: "" triggers: - trigger: state entity_id: - binary_sensor.bewegungsmelder_flur_treppenhaus_eg_occupancy - binary_sensor.bewegungsmelder_flur_haustur_eg_occupancy - binary_sensor.haustur_eg_contact to: "on" conditions: [] actions: - choose: - conditions: - condition: and conditions: - condition: time after: "06:00:00" before: "19:00:00" - condition: not conditions: - condition: state entity_id: input_boolean.notify_night state: "on" alias: Nachtmodus ist nicht aktiv - condition: numeric_state entity_id: sensor.bewegungsmelder_flur_treppenhaus_eg_illuminance_lux below: 150 sequence: - action: light.turn_on metadata: {} data: kelvin: 6500 brightness_pct: 50 transition: 2 target: entity_id: - light.flur_eg_haustur_deckenlampe - light.flur_eg_treppe_deckenlampe - delay: hours: 0 minutes: 2 seconds: 0 milliseconds: 0 - action: light.turn_on metadata: {} data: kelvin: 6500 brightness_pct: 1 transition: 2 target: entity_id: - light.flur_eg_haustur_deckenlampe - light.flur_eg_treppe_deckenlampe - delay: hours: 0 minutes: 2 seconds: 0 milliseconds: 0 - action: light.turn_off target: entity_id: - light.flur_eg_haustur_deckenlampe - light.flur_eg_treppe_deckenlampe data: transition: 2 - conditions: - condition: and conditions: - condition: time after: "19:00:00" before: "06:00:00" - condition: not conditions: - condition: state entity_id: input_boolean.notify_night state: "on" alias: Nachtmodus nicht aktiv sequence: - action: light.turn_on metadata: {} data: kelvin: 2000 brightness_pct: 50 transition: 2 target: entity_id: - light.flur_eg_haustur_deckenlampe - light.flur_eg_treppe_deckenlampe - delay: hours: 0 minutes: 2 seconds: 0 milliseconds: 0 - action: light.turn_on metadata: {} data: kelvin: 2000 brightness_pct: 1 transition: 2 target: entity_id: - light.flur_eg_haustur_deckenlampe - light.flur_eg_treppe_deckenlampe - delay: hours: 0 minutes: 2 seconds: 0 milliseconds: 0 - action: light.turn_off target: entity_id: - light.flur_eg_haustur_deckenlampe - light.flur_eg_treppe_deckenlampe data: transition: 2 mode: restart
alias: Bewegungsmelder Flur EG Video
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.bewegungsmelder_flur_treppenhaus_eg_occupancy
      - binary_sensor.bewegungsmelder_flur_haustur_eg_occupancy
      - binary_sensor.haustur_eg_contact
    to: "on"
conditions: []
actions:
  - choose:
      - conditions:
          - condition: and
            conditions:
              - condition: time
                after: "06:00:00"
                before: "19:00:00"
              - condition: not
                conditions:
                  - condition: state
                    entity_id: input_boolean.notify_night
                    state: "on"
                alias: Nachtmodus ist nicht aktiv
              - condition: numeric_state
                entity_id: sensor.bewegungsmelder_flur_treppenhaus_eg_illuminance_lux
                below: 150
        sequence:
          - action: light.turn_on
            metadata: {}
            data:
              kelvin: 6500
              brightness_pct: 50
              transition: 2
            target:
              entity_id:
                - light.flur_eg_haustur_deckenlampe
                - light.flur_eg_treppe_deckenlampe
          - delay:
              hours: 0
              minutes: 2
              seconds: 0
              milliseconds: 0
          - action: light.turn_on
            metadata: {}
            data:
              kelvin: 6500
              brightness_pct: 1
              transition: 2
            target:
              entity_id:
                - light.flur_eg_haustur_deckenlampe
                - light.flur_eg_treppe_deckenlampe
          - delay:
              hours: 0
              minutes: 2
              seconds: 0
              milliseconds: 0
          - action: light.turn_off
            target:
              entity_id:
                - light.flur_eg_haustur_deckenlampe
                - light.flur_eg_treppe_deckenlampe
            data:
              transition: 2
      - conditions:
          - condition: and
            conditions:
              - condition: time
                after: "19:00:00"
                before: "06:00:00"
              - condition: not
                conditions:
                  - condition: state
                    entity_id: input_boolean.notify_night
                    state: "on"
                alias: Nachtmodus nicht aktiv
        sequence:
          - action: light.turn_on
            metadata: {}
            data:
              kelvin: 2000
              brightness_pct: 50
              transition: 2
            target:
              entity_id:
                - light.flur_eg_haustur_deckenlampe
                - light.flur_eg_treppe_deckenlampe
          - delay:
              hours: 0
              minutes: 2
              seconds: 0
              milliseconds: 0
          - action: light.turn_on
            metadata: {}
            data:
              kelvin: 2000
              brightness_pct: 1
              transition: 2
            target:
              entity_id:
                - light.flur_eg_haustur_deckenlampe
                - light.flur_eg_treppe_deckenlampe
          - delay:
              hours: 0
              minutes: 2
              seconds: 0
              milliseconds: 0
          - action: light.turn_off
            target:
              entity_id:
                - light.flur_eg_haustur_deckenlampe
                - light.flur_eg_treppe_deckenlampe
            data:
              transition: 2
mode: restart

Automatisierung 3 ( Level Komplexer)

Diese Automatisierung steuert die Außenbeleuchtung und sorgt für einen ständigen Farbwechsel, schaltet aber bei erkannter Bewegung auf helles weißes Licht und schaltet es nach 2 Minuten wieder aus. Hier ist eine einfache Erklärung:

  1. Farbwechsel: Jede Minute (oder wenn ein spezieller „Helfer“ aktiviert ist) wechselt das Licht nach Sonnenuntergang die Farben. Es leuchtet mit 20 % Helligkeit und wechselt zufällig die Farben.
  2. Bewegung erkannt: Wenn eine Bewegung vor der Haustür erkannt wird (durch einen der Bewegungsmelder), schaltet sich das Licht auf 100 % Helligkeit und leuchtet in Weiß. Nach 2 Minuten wird das Licht wieder ausgeschaltet, und der Farbwechsel startet erneut.
  3. Sonnenaufgang: Bei Sonnenaufgang wird die Außenbeleuchtung komplett ausgeschaltet.

Die Automatisierung sorgt also für eine dynamische, farbenfrohe Beleuchtung in der Nacht und schaltet bei Bewegung auf weißes Licht, um besser sehen zu können.

Diese Automatisierung verwendet ein Template um einen Random Wert für die Beleuchtung zu finden:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
rgb_color:
- "{{ (range(0, 256) | random) }}"
- "{{ (range(0, 256) | random) }}"
- "{{ (range(0, 256) | random) }}"
rgb_color: - "{{ (range(0, 256) | random) }}" - "{{ (range(0, 256) | random) }}" - "{{ (range(0, 256) | random) }}"
              rgb_color:
                - "{{ (range(0, 256) | random) }}"
                - "{{ (range(0, 256) | random) }}"
                - "{{ (range(0, 256) | random) }}"
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Farbwechsel Aussen
description: >-
Automatisierung für ständigen Farbwechsel, schaltet bei Bewegung auf Weiß und
nach 2 Minuten wieder aus
triggers:
- id: Jede Minute
trigger: time_pattern
minutes: /1
- entity_id:
- binary_sensor.bewegungsmelder_haustur_aussen_occupancy
- binary_sensor.haustuer_bewegung
id: Bewegung erkannt
to: "on"
trigger: state
- event: sunrise
id: Sonnenaufgang
trigger: sun
- trigger: state
entity_id:
- input_boolean.helfer_jedeminute
to: "on"
id: HelferJedeMinute
conditions: []
actions:
- choose:
- conditions:
- condition: and
conditions:
- condition: sun
after: sunset
enabled: true
before: sunrise
- condition: or
conditions:
- condition: trigger
id:
- Jede Minute
- condition: trigger
id:
- HelferJedeMinute
alias: Auslöser Jeder Minute oder Helfer Jede Minute
- condition: not
conditions:
- condition: state
entity_id: binary_sensor.bewegungsmelder_haustur_aussen_occupancy
state: "on"
alias: Bewegungsmelder erkennt gerade nichts
sequence:
- action: input_boolean.turn_off
target:
entity_id:
- input_boolean.helfer_jedeminute
data: {}
- target:
entity_id: light.aussenbeleuchtung
data:
brightness_pct: 20
transition: 5
rgb_color:
- "{{ (range(0, 256) | random) }}"
- "{{ (range(0, 256) | random) }}"
- "{{ (range(0, 256) | random) }}"
action: light.turn_on
alias: Farbwechsel ohne Bewegungsmelder
- conditions:
- condition: and
conditions:
- alias: Nach Sonnenuntergang oder Lux Wert unter 800
condition: or
conditions:
- condition: sun
after: sunset
enabled: true
before: sunrise
- condition: numeric_state
entity_id: sensor.bewegungsmelder_haustur_aussen_illuminance_lux
below: 800
- condition: trigger
id: Bewegung erkannt
sequence:
- target:
entity_id: light.aussenbeleuchtung
data:
brightness_pct: 100
transition: 3
color_name: white
action: light.turn_on
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- target:
entity_id: light.aussenbeleuchtung
action: light.turn_off
data: {}
- action: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.helfer_jedeminute
alias: Bei Bewegung soll hell leuchten
- conditions:
- condition: trigger
id: Sonnenaufgang
sequence:
- target:
entity_id: light.aussenbeleuchtung
action: light.turn_off
data: {}
alias: Wenn Sonnenaufgang, dann alle Lichter aus
mode: parallel
max: 10
alias: Farbwechsel Aussen description: >- Automatisierung für ständigen Farbwechsel, schaltet bei Bewegung auf Weiß und nach 2 Minuten wieder aus triggers: - id: Jede Minute trigger: time_pattern minutes: /1 - entity_id: - binary_sensor.bewegungsmelder_haustur_aussen_occupancy - binary_sensor.haustuer_bewegung id: Bewegung erkannt to: "on" trigger: state - event: sunrise id: Sonnenaufgang trigger: sun - trigger: state entity_id: - input_boolean.helfer_jedeminute to: "on" id: HelferJedeMinute conditions: [] actions: - choose: - conditions: - condition: and conditions: - condition: sun after: sunset enabled: true before: sunrise - condition: or conditions: - condition: trigger id: - Jede Minute - condition: trigger id: - HelferJedeMinute alias: Auslöser Jeder Minute oder Helfer Jede Minute - condition: not conditions: - condition: state entity_id: binary_sensor.bewegungsmelder_haustur_aussen_occupancy state: "on" alias: Bewegungsmelder erkennt gerade nichts sequence: - action: input_boolean.turn_off target: entity_id: - input_boolean.helfer_jedeminute data: {} - target: entity_id: light.aussenbeleuchtung data: brightness_pct: 20 transition: 5 rgb_color: - "{{ (range(0, 256) | random) }}" - "{{ (range(0, 256) | random) }}" - "{{ (range(0, 256) | random) }}" action: light.turn_on alias: Farbwechsel ohne Bewegungsmelder - conditions: - condition: and conditions: - alias: Nach Sonnenuntergang oder Lux Wert unter 800 condition: or conditions: - condition: sun after: sunset enabled: true before: sunrise - condition: numeric_state entity_id: sensor.bewegungsmelder_haustur_aussen_illuminance_lux below: 800 - condition: trigger id: Bewegung erkannt sequence: - target: entity_id: light.aussenbeleuchtung data: brightness_pct: 100 transition: 3 color_name: white action: light.turn_on - delay: hours: 0 minutes: 2 seconds: 0 milliseconds: 0 - target: entity_id: light.aussenbeleuchtung action: light.turn_off data: {} - action: input_boolean.turn_on metadata: {} data: {} target: entity_id: input_boolean.helfer_jedeminute alias: Bei Bewegung soll hell leuchten - conditions: - condition: trigger id: Sonnenaufgang sequence: - target: entity_id: light.aussenbeleuchtung action: light.turn_off data: {} alias: Wenn Sonnenaufgang, dann alle Lichter aus mode: parallel max: 10
alias: Farbwechsel Aussen
description: >-
  Automatisierung für ständigen Farbwechsel, schaltet bei Bewegung auf Weiß und
  nach 2 Minuten wieder aus
triggers:
  - id: Jede Minute
    trigger: time_pattern
    minutes: /1
  - entity_id:
      - binary_sensor.bewegungsmelder_haustur_aussen_occupancy
      - binary_sensor.haustuer_bewegung
    id: Bewegung erkannt
    to: "on"
    trigger: state
  - event: sunrise
    id: Sonnenaufgang
    trigger: sun
  - trigger: state
    entity_id:
      - input_boolean.helfer_jedeminute
    to: "on"
    id: HelferJedeMinute
conditions: []
actions:
  - choose:
      - conditions:
          - condition: and
            conditions:
              - condition: sun
                after: sunset
                enabled: true
                before: sunrise
              - condition: or
                conditions:
                  - condition: trigger
                    id:
                      - Jede Minute
                  - condition: trigger
                    id:
                      - HelferJedeMinute
                alias: Auslöser Jeder Minute oder Helfer Jede Minute
              - condition: not
                conditions:
                  - condition: state
                    entity_id: binary_sensor.bewegungsmelder_haustur_aussen_occupancy
                    state: "on"
                alias: Bewegungsmelder erkennt gerade nichts
        sequence:
          - action: input_boolean.turn_off
            target:
              entity_id:
                - input_boolean.helfer_jedeminute
            data: {}
          - target:
              entity_id: light.aussenbeleuchtung
            data:
              brightness_pct: 20
              transition: 5
              rgb_color:
                - "{{ (range(0, 256) | random) }}"
                - "{{ (range(0, 256) | random) }}"
                - "{{ (range(0, 256) | random) }}"
            action: light.turn_on
        alias: Farbwechsel ohne Bewegungsmelder
      - conditions:
          - condition: and
            conditions:
              - alias: Nach Sonnenuntergang oder Lux Wert unter 800
                condition: or
                conditions:
                  - condition: sun
                    after: sunset
                    enabled: true
                    before: sunrise
                  - condition: numeric_state
                    entity_id: sensor.bewegungsmelder_haustur_aussen_illuminance_lux
                    below: 800
              - condition: trigger
                id: Bewegung erkannt
        sequence:
          - target:
              entity_id: light.aussenbeleuchtung
            data:
              brightness_pct: 100
              transition: 3
              color_name: white
            action: light.turn_on
          - delay:
              hours: 0
              minutes: 2
              seconds: 0
              milliseconds: 0
          - target:
              entity_id: light.aussenbeleuchtung
            action: light.turn_off
            data: {}
          - action: input_boolean.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: input_boolean.helfer_jedeminute
        alias: Bei Bewegung soll hell leuchten
      - conditions:
          - condition: trigger
            id: Sonnenaufgang
        sequence:
          - target:
              entity_id: light.aussenbeleuchtung
            action: light.turn_off
            data: {}
        alias: Wenn Sonnenaufgang, dann alle Lichter aus
mode: parallel
max: 10

Was machen eigentliche diese Automatisierungs Modi ?

Ich möchte euch heute einen allgemeinen Amazon-Link teilen, über den ihr eine Vielzahl von Produkten entdecken könnt. Egal, ob ihr nach Smart Home-Geräten, Gadgets oder anderen nützlichen Artikeln sucht, Amazon hat für jeden etwas zu bieten.

Wenn ihr über diesen Link einkauft, unterstützt ihr meinen Kanal, ohne dass es für euch zusätzliche Kosten verursacht. Das hilft mir, weiterhin spannende Inhalte für euch zu erstellen!

Hier ist der Link zu Amazon: https://amzn.to/3KsGngK

Vielen Dank für eure Unterstützung!

Habt ihr euch auch schon die Frage gestellt, wozu diese Modi eigentlich gut sind ? Wie wende ich diese an ?

Auf diese Fragen bekommt ihr in diesem Video eine Antwort.

Modus – Einzeln

Eine Automatisierung wird von Anfang bis zum Ende ausgeführt. Kommt während des Durchlaufs ein weiterer Auslöser, so wird dieser ignoriert.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Single Mode - Haustür
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.haustur_klingeln
to: "on"
condition: []
action:
- action: light.turn_on
metadata: {}
data:
rgb_color:
- 255
- 0
- 0
brightness_pct: 100
target:
entity_id: light.buro_klavinova_oben
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- action: light.turn_off
target:
entity_id: light.buro_klavinova_oben
data: {}
mode: single
alias: Single Mode - Haustür description: "" trigger: - platform: state entity_id: - binary_sensor.haustur_klingeln to: "on" condition: [] action: - action: light.turn_on metadata: {} data: rgb_color: - 255 - 0 - 0 brightness_pct: 100 target: entity_id: light.buro_klavinova_oben - delay: hours: 0 minutes: 0 seconds: 10 milliseconds: 0 - action: light.turn_off target: entity_id: light.buro_klavinova_oben data: {} mode: single
alias: Single Mode - Haustür
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.haustur_klingeln
    to: "on"
condition: []
action:
  - action: light.turn_on
    metadata: {}
    data:
      rgb_color:
        - 255
        - 0
        - 0
      brightness_pct: 100
    target:
      entity_id: light.buro_klavinova_oben
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - action: light.turn_off
    target:
      entity_id: light.buro_klavinova_oben
    data: {}
mode: single

Modus – Restart

Eine Automatisierung wird so lange ausgeführt, bis ein neuer Auslöser kommt. Ist das der Fall, so wird die Automatisierung neu gestartet und der Ablauf erfolgt erneut von Anfang bis zum Ende, oder so lange, bis wieder ein neuer Auslöser kommt.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Restart - Mode Licht
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.bewegungsmelder_haustur_aussen_occupancy
to: "on"
condition: []
action:
- action: light.turn_on
metadata: {}
data:
rgb_color:
- 236
- 9
- 9
brightness_pct: 100
target:
entity_id:
- light.buro_klavinova_oben
- light.buro_klavinova_unten
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id:
- light.buro_klavinova_oben
- light.buro_klavinova_unten
mode: restart
alias: Restart - Mode Licht description: "" trigger: - platform: state entity_id: - binary_sensor.bewegungsmelder_haustur_aussen_occupancy to: "on" condition: [] action: - action: light.turn_on metadata: {} data: rgb_color: - 236 - 9 - 9 brightness_pct: 100 target: entity_id: - light.buro_klavinova_oben - light.buro_klavinova_unten - delay: hours: 0 minutes: 1 seconds: 0 milliseconds: 0 - action: light.turn_off metadata: {} data: {} target: entity_id: - light.buro_klavinova_oben - light.buro_klavinova_unten mode: restart
alias: Restart - Mode Licht
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.bewegungsmelder_haustur_aussen_occupancy
    to: "on"
condition: []
action:
  - action: light.turn_on
    metadata: {}
    data:
      rgb_color:
        - 236
        - 9
        - 9
      brightness_pct: 100
    target:
      entity_id:
        - light.buro_klavinova_oben
        - light.buro_klavinova_unten
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - action: light.turn_off
    metadata: {}
    data: {}
    target:
      entity_id:
        - light.buro_klavinova_oben
        - light.buro_klavinova_unten
mode: restart

Modus – In Warteschlange

Dieser Modus behandelt jeden Trigger bei der Bearbeitung, wie man es von einen FIFO ( First in First Out ) kennt. D.h. jeder Auslöser wird verwendet und für jeden Auslöser wird die Automatisierung komplett durchlaufen.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: In Warteschlange
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.bewegungsmelder_haustur_aussen_occupancy
to: "on"
condition: []
action:
- action: light.turn_on
metadata: {}
data:
rgb_color:
- 236
- 9
- 9
brightness_pct: 100
target:
entity_id:
- light.buro_klavinova_oben
- light.buro_klavinova_unten
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id:
- light.buro_klavinova_oben
- light.buro_klavinova_unten
mode: queued
max: 10
alias: In Warteschlange description: "" trigger: - platform: state entity_id: - binary_sensor.bewegungsmelder_haustur_aussen_occupancy to: "on" condition: [] action: - action: light.turn_on metadata: {} data: rgb_color: - 236 - 9 - 9 brightness_pct: 100 target: entity_id: - light.buro_klavinova_oben - light.buro_klavinova_unten - delay: hours: 0 minutes: 0 seconds: 10 milliseconds: 0 - action: light.turn_off metadata: {} data: {} target: entity_id: - light.buro_klavinova_oben - light.buro_klavinova_unten mode: queued max: 10
alias: In Warteschlange
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.bewegungsmelder_haustur_aussen_occupancy
    to: "on"
condition: []
action:
  - action: light.turn_on
    metadata: {}
    data:
      rgb_color:
        - 236
        - 9
        - 9
      brightness_pct: 100
    target:
      entity_id:
        - light.buro_klavinova_oben
        - light.buro_klavinova_unten
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - action: light.turn_off
    metadata: {}
    data: {}
    target:
      entity_id:
        - light.buro_klavinova_oben
        - light.buro_klavinova_unten
mode: queued
max: 10

Modus – Parallel

Der parallele Modus unterscheidet sich komplett von den bisherigen Modi. Haben wir z.B. zwei verschiedene Auslöser , die durch eine Auslöse ID miteinander verknüpft sind, so werden damit verknüpfte Aktionen immer ausgeführt. Auch in diesem Modus kann man über den Max Parameter angeben, wie viele gleichzeitige Bearbeitungen erfolgen sollen. Default sind 10 parallele Vorgänge.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Räume beleuchten nach Person - Parallel Mode
description: Demonstriert den Parallel Modus von Home Assistant
trigger:
- platform: state
entity_id:
- input_boolean.helfer_person_sabrina
to: "on"
id: Sabrina home
- platform: state
entity_id:
- input_boolean.helfer_person_tobias
to: "on"
id: Tobias home
condition: []
action:
- if:
- condition: trigger
id:
- Sabrina home
then:
- target:
entity_id: light.buro_klavinova_oben
data:
rgb_color:
- 110
- 245
- 0
brightness_pct: 20
action: light.turn_on
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- action: light.turn_off
target:
entity_id:
- light.buro_klavinova_oben
data: {}
- if:
- condition: trigger
id:
- Tobias home
then:
- target:
entity_id: light.buro_klavinova_unten
data:
rgb_color:
- 0
- 16
- 245
brightness_pct: 40
action: light.turn_on
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- action: light.turn_off
target:
entity_id:
- light.buro_klavinova_unten
data: {}
mode: parallel
max: 10
alias: Räume beleuchten nach Person - Parallel Mode description: Demonstriert den Parallel Modus von Home Assistant trigger: - platform: state entity_id: - input_boolean.helfer_person_sabrina to: "on" id: Sabrina home - platform: state entity_id: - input_boolean.helfer_person_tobias to: "on" id: Tobias home condition: [] action: - if: - condition: trigger id: - Sabrina home then: - target: entity_id: light.buro_klavinova_oben data: rgb_color: - 110 - 245 - 0 brightness_pct: 20 action: light.turn_on - delay: hours: 0 minutes: 0 seconds: 10 milliseconds: 0 - action: light.turn_off target: entity_id: - light.buro_klavinova_oben data: {} - if: - condition: trigger id: - Tobias home then: - target: entity_id: light.buro_klavinova_unten data: rgb_color: - 0 - 16 - 245 brightness_pct: 40 action: light.turn_on - delay: hours: 0 minutes: 0 seconds: 10 milliseconds: 0 - action: light.turn_off target: entity_id: - light.buro_klavinova_unten data: {} mode: parallel max: 10
alias: Räume beleuchten nach Person - Parallel Mode
description: Demonstriert den Parallel Modus von Home Assistant
trigger:
  - platform: state
    entity_id:
      - input_boolean.helfer_person_sabrina
    to: "on"
    id: Sabrina home
  - platform: state
    entity_id:
      - input_boolean.helfer_person_tobias
    to: "on"
    id: Tobias home
condition: []
action:
  - if:
      - condition: trigger
        id:
          - Sabrina home
    then:
      - target:
          entity_id: light.buro_klavinova_oben
        data:
          rgb_color:
            - 110
            - 245
            - 0
          brightness_pct: 20
        action: light.turn_on
      - delay:
          hours: 0
          minutes: 0
          seconds: 10
          milliseconds: 0
      - action: light.turn_off
        target:
          entity_id:
            - light.buro_klavinova_oben
        data: {}
  - if:
      - condition: trigger
        id:
          - Tobias home
    then:
      - target:
          entity_id: light.buro_klavinova_unten
        data:
          rgb_color:
            - 0
            - 16
            - 245
          brightness_pct: 40
        action: light.turn_on
      - delay:
          hours: 0
          minutes: 0
          seconds: 10
          milliseconds: 0
      - action: light.turn_off
        target:
          entity_id:
            - light.buro_klavinova_unten
        data: {}
mode: parallel
max: 10

Home Assistant Dein Einstieg in ESPHome und DIY🛠️ – Auch für Anfänger! 🚀

Home Assistant mit ESPHome und Ultraschallsensor: Automatisierung leicht gemacht! In diesem Projekt nutzt du ESPHome und einen Ultraschallsensor, um eine spannende Automatisierung zu erstellen. Wenn du mehr über ESPHome erfahren möchtest, findest du in diesem Video spannende Informationen.

Viel Erfolg bei deinem Projekt! 😊🛠️

Ich möchte euch heute einen allgemeinen Amazon-Link teilen, über den ihr eine Vielzahl von Produkten entdecken könnt. Egal, ob ihr nach Smart Home-Geräten, Gadgets oder anderen nützlichen Artikeln sucht, Amazon hat für jeden etwas zu bieten.

Wenn ihr über diesen Link einkauft, unterstützt ihr meinen Kanal, ohne dass es für euch zusätzliche Kosten verursacht. Das hilft mir, weiterhin spannende Inhalte für euch zu erstellen!

Hier ist der Link zu Amazon: https://amzn.to/3KsGngK

Vielen Dank für eure Unterstützung!

Wenn du weitere Anpassungen oder Ideen hast, lass es mich wissen! 😊👍

Links in diesem Video:

Web-Flash ESPhome : https://web.esphome.io

Doku ESPhome : https://esphome.io

Stückliste* :

StückzahlArtikelAmazon LinkBeschreibung
1M5 Stack Atom Litehttps://amzn.to/4cfTOg0ESP Controller
1Wemos D1 Minihttps://amzn.to/3VqmxI5ESP8266 Controller
1HC-SR04https://amzn.to/4ekOVUNUltraschall Sensor
15V Netzteil Micro USBhttps://amzn.to/4er9D5eMicro USB Netzteil 5V ( für Wemos D1 Mini )
15 V Netzteil USB Chttps://amzn.to/3VL2K7qUSB C Netzteil 5 V ( für Atom Lite)
1
Jumper Kabel Set

https://amzn.to/3VLHYos

Jumper Kabel für die Verbindung
zwischen ESP und HC-SR04
1

Hinweis: Den M5 Stack Atom Lite kann man bei anderen Quellen günstiger bekommen. Sucht danach im Internet , falls ihr meinen Kanal unterstützen wollt, freue ich mich natürlich aber auch über einen Einkauf über den Amazon Link.

Verkabelung Wemos D1 Mini mit HC-SR04

Verkabelung M5Stack ATom Lite mit HC-SR04

ESPHome Code ( hier sind für Euch die Stellen ab sensor: -> Enable logger interessant):

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
substitutions:
name: esphome-web-684d66
friendly_name: Wemos_D1Mini_Ultraschall_V1
esphome:
name: ${name}
friendly_name: ${friendly_name}
name_add_mac_suffix: false
project:
name: esphome.web
version: '1.0'
esp8266:
board: esp01_1m
# Example configuration entry
sensor:
- platform: ultrasonic
trigger_pin: GPIO2
echo_pin: GPIO0
name: "Ultraschall für Video"
id: ultraschall_video
update_interval: 1s
# Example filters:
filters:
- filter_out: nan
- median:
window_size: 5
send_every: 5
send_first_at: 1
- platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
name: "WiFi Signal dB"
id: wifi_signal_db
update_interval: 60s
entity_category: "diagnostic"
- platform: copy # Reports the WiFi signal strength in %
source_id: wifi_signal_db
name: "WiFi Signal Percent"
filters:
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
unit_of_measurement: "Signal %"
entity_category: "diagnostic"
device_class: ""
binary_sensor:
- platform: template
name: "PKW unter Carport"
lambda: |-
if ((id(ultraschall_video).state >= 0.5) ) {
// Pkw ist nicht unter Carport
return false;
} else {
// PKW ist unter Carport
return true;
}
# Enable logging
logger:
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
platform: esphome
password: xxxxxxxxxxxxxxxxxxxxx
# Allow provisioning Wi-Fi via serial
improv_serial:
wifi:
# Set up a wifi access point
ap: {}
# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:
dashboard_import:
package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main
import_full_config: true
# To have a "next url" for improv serial
web_server:
substitutions: name: esphome-web-684d66 friendly_name: Wemos_D1Mini_Ultraschall_V1 esphome: name: ${name} friendly_name: ${friendly_name} name_add_mac_suffix: false project: name: esphome.web version: '1.0' esp8266: board: esp01_1m # Example configuration entry sensor: - platform: ultrasonic trigger_pin: GPIO2 echo_pin: GPIO0 name: "Ultraschall für Video" id: ultraschall_video update_interval: 1s # Example filters: filters: - filter_out: nan - median: window_size: 5 send_every: 5 send_first_at: 1 - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB name: "WiFi Signal dB" id: wifi_signal_db update_interval: 60s entity_category: "diagnostic" - platform: copy # Reports the WiFi signal strength in % source_id: wifi_signal_db name: "WiFi Signal Percent" filters: - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0); unit_of_measurement: "Signal %" entity_category: "diagnostic" device_class: "" binary_sensor: - platform: template name: "PKW unter Carport" lambda: |- if ((id(ultraschall_video).state >= 0.5) ) { // Pkw ist nicht unter Carport return false; } else { // PKW ist unter Carport return true; } # Enable logging logger: # Enable Home Assistant API api: # Allow Over-The-Air updates ota: platform: esphome password: xxxxxxxxxxxxxxxxxxxxx # Allow provisioning Wi-Fi via serial improv_serial: wifi: # Set up a wifi access point ap: {} # In combination with the `ap` this allows the user # to provision wifi credentials to the device via WiFi AP. captive_portal: dashboard_import: package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main import_full_config: true # To have a "next url" for improv serial web_server:
substitutions:
  name: esphome-web-684d66
  friendly_name: Wemos_D1Mini_Ultraschall_V1

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: '1.0'

esp8266:
  board: esp01_1m

# Example configuration entry
sensor:
  - platform: ultrasonic
    trigger_pin: GPIO2
    echo_pin: GPIO0
    name: "Ultraschall für Video"
    id: ultraschall_video
    update_interval: 1s
    # Example filters:
    filters:
      - filter_out: nan
      - median:
          window_size: 5
          send_every: 5
          send_first_at: 1


  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"

  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: "WiFi Signal Percent"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "Signal %"
    entity_category: "diagnostic"
    device_class: ""


binary_sensor:
  - platform: template
    name: "PKW unter Carport"
    lambda: |-
      if ((id(ultraschall_video).state >= 0.5) ) {
        // Pkw ist nicht unter Carport
        return false;
      } else {
        // PKW ist unter Carport
        return true;
      }

# Enable logging
logger:

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:
  platform: esphome
  password: xxxxxxxxxxxxxxxxxxxxx


# Allow provisioning Wi-Fi via serial
improv_serial:

wifi:
  # Set up a wifi access point
  ap: {}

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:

dashboard_import:
  package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main
  import_full_config: true

# To have a "next url" for improv serial
web_server:

Visualisierung auf dem Dashboard

Falls ihr nicht den binären Sensor aus dem ESP nutzen wollt, könnt ihr euch auch einen binären Template Helfer anlegen und die Schwellen für „PKW vorhanden“ und „PKW nicht vorhanden“ darüber definieren.

Template Helfer binärer Sensor:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
{% if float(states.sensor.esphome_web_684d66_ultraschall_f_r_video.state) >= 0.5 %}
false
{% else %}
true
{% endif %}
{% if float(states.sensor.esphome_web_684d66_ultraschall_f_r_video.state) >= 0.5 %} false {% else %} true {% endif %}
{% if float(states.sensor.esphome_web_684d66_ultraschall_f_r_video.state) >= 0.5 %}
false
{% else %}
true
{% endif %}

YAML Code Bildelement Karte:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
show_state: true
show_name: false
type: picture-entity
entity: binary_sensor.esphome_web_684d66_pkw_unter_carport
state_image:
'on': /local/image/on_Carport.png
'off': /local/image/off_Carport.png
show_state: true show_name: false type: picture-entity entity: binary_sensor.esphome_web_684d66_pkw_unter_carport state_image: 'on': /local/image/on_Carport.png 'off': /local/image/off_Carport.png
show_state: true
show_name: false
type: picture-entity
entity: binary_sensor.esphome_web_684d66_pkw_unter_carport
state_image:
  'on': /local/image/on_Carport.png
  'off': /local/image/off_Carport.png

Flussdiagramm der Automatisierung

In dieser Playlist findet ihr noch weitere Informationen zu EVCC , PV – Überschussladen und auch MQTT Sensoren wie z.B. den Charge Mode:

YouTube player

PV-Modus Prognose Template Helfer:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
{% set value_prognose = (float(states.sensor.solcast_pv_forecast_prognose_nachste_stunde.state) / 1000.0) %}
{% if value_prognose > 1.5 %}
pv
{% elif value_prognose > 0 %}
minpv
{% else %}
now
{%endif%}
{% set value_prognose = (float(states.sensor.solcast_pv_forecast_prognose_nachste_stunde.state) / 1000.0) %} {% if value_prognose > 1.5 %} pv {% elif value_prognose > 0 %} minpv {% else %} now {%endif%}
{% set value_prognose = (float(states.sensor.solcast_pv_forecast_prognose_nachste_stunde.state) / 1000.0) %}
{% if  value_prognose > 1.5 %}
pv
{% elif value_prognose > 0 %}
minpv
{% else %}
now
{%endif%}

Update 20.06.2024: Um beim Neustart von Home Assistant keine fehlerhaften Ergebnisse zu erhalten, ist es besser den Status mit state(’sensor.entity‘) abzufragen. In diesem Beispiel wäre es:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
{% set value_prognose = (float(states('sensor.solcast_pv_forecast_prognose_nachste_stunde')) / 1000.0) %}
{% if value_prognose > 1.5 %}
pv
{% elif value_prognose > 0 %}
minpv
{% else %}
now
{%endif%}
{% set value_prognose = (float(states('sensor.solcast_pv_forecast_prognose_nachste_stunde')) / 1000.0) %} {% if value_prognose > 1.5 %} pv {% elif value_prognose > 0 %} minpv {% else %} now {%endif%}
{% set value_prognose = (float(states('sensor.solcast_pv_forecast_prognose_nachste_stunde')) / 1000.0) %}
{% if  value_prognose > 1.5 %}
pv
{% elif value_prognose > 0 %}
minpv
{% else %}
now
{%endif%}

Ultraschall Sensor Automatisierung YAML :

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
alias: Carport_Ultraschallsensor
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.esphome_web_684d66_pkw_unter_carport
to: "on"
id: PKW Trigger On
- platform: state
entity_id:
- binary_sensor.esphome_web_684d66_pkw_unter_carport
to: "off"
- platform: time_pattern
minutes: /30
- platform: sun
event: sunrise
offset: 0
- platform: sun
event: sunset
offset: 0
condition: []
action:
- if:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.esphome_web_684d66_pkw_unter_carport
state: "on"
- condition: or
conditions:
- condition: state
entity_id: device_tracker.tlerch
state: home
- condition: state
entity_id: device_tracker.slerch
state: home
alias: Eine Person ist zu Hause & Auto steht unter Carport
then:
- service: select.select_option
metadata: {}
data:
option: "{{ states.sensor.helfer_pv_prognose_lademodus.state }}"
target:
entity_id: select.charge_mode
- condition: trigger
id:
- PKW Trigger On
- service: media_player.volume_set
metadata: {}
data:
volume_level: 0.33
target:
entity_id: media_player.kuche
- service: notify.alexa_media_kuche
metadata: {}
data:
message: >-
PKW unter Carport angekommen. Lademodus {{
states.sensor.helfer_pv_prognose_lademodus.state }} selektiert
- service: media_player.volume_set
metadata: {}
data:
volume_level: 0.1
target:
entity_id: media_player.kuche
- service: notify.mobile_app_tlerch
metadata: {}
data:
message: >-
Fahrzeug unter Carport angekommen. Lademodus {{
states.sensor.helfer_pv_prognose_lademodus.state }} eingeschaltet
- if:
- condition: and
conditions:
- condition: sun
before: sunrise
after: sunrise
enabled: false
- condition: trigger
id:
- PKW Trigger On
then:
- service: light.turn_on
metadata: {}
data:
brightness_pct: 100
target:
entity_id: light.aussenbeleuchtung
- delay:
hours: 0
minutes: 3
seconds: 0
milliseconds: 0
- service: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.aussenbeleuchtung
else:
- condition: trigger
id:
- PKW Trigger On
- service: select.select_option
metadata: {}
data:
option: "off"
target:
entity_id: select.charge_mode
- service: notify.mobile_app_tlerch
metadata: {}
data:
message: Unbekanntes Fahrzeug unter Carport erkannt!
title: 🚨🚨 CARPORT 🚨🚨
data:
notification_icon: mdi:alert
channel: Notfall
priority: high
ttl: 0
color: red
push:
sound:
name: default
critical: 1
volume: 1
mode: single
alias: Carport_Ultraschallsensor description: "" trigger: - platform: state entity_id: - binary_sensor.esphome_web_684d66_pkw_unter_carport to: "on" id: PKW Trigger On - platform: state entity_id: - binary_sensor.esphome_web_684d66_pkw_unter_carport to: "off" - platform: time_pattern minutes: /30 - platform: sun event: sunrise offset: 0 - platform: sun event: sunset offset: 0 condition: [] action: - if: - condition: and conditions: - condition: state entity_id: binary_sensor.esphome_web_684d66_pkw_unter_carport state: "on" - condition: or conditions: - condition: state entity_id: device_tracker.tlerch state: home - condition: state entity_id: device_tracker.slerch state: home alias: Eine Person ist zu Hause & Auto steht unter Carport then: - service: select.select_option metadata: {} data: option: "{{ states.sensor.helfer_pv_prognose_lademodus.state }}" target: entity_id: select.charge_mode - condition: trigger id: - PKW Trigger On - service: media_player.volume_set metadata: {} data: volume_level: 0.33 target: entity_id: media_player.kuche - service: notify.alexa_media_kuche metadata: {} data: message: >- PKW unter Carport angekommen. Lademodus {{ states.sensor.helfer_pv_prognose_lademodus.state }} selektiert - service: media_player.volume_set metadata: {} data: volume_level: 0.1 target: entity_id: media_player.kuche - service: notify.mobile_app_tlerch metadata: {} data: message: >- Fahrzeug unter Carport angekommen. Lademodus {{ states.sensor.helfer_pv_prognose_lademodus.state }} eingeschaltet - if: - condition: and conditions: - condition: sun before: sunrise after: sunrise enabled: false - condition: trigger id: - PKW Trigger On then: - service: light.turn_on metadata: {} data: brightness_pct: 100 target: entity_id: light.aussenbeleuchtung - delay: hours: 0 minutes: 3 seconds: 0 milliseconds: 0 - service: light.turn_off metadata: {} data: {} target: entity_id: light.aussenbeleuchtung else: - condition: trigger id: - PKW Trigger On - service: select.select_option metadata: {} data: option: "off" target: entity_id: select.charge_mode - service: notify.mobile_app_tlerch metadata: {} data: message: Unbekanntes Fahrzeug unter Carport erkannt! title: 🚨🚨 CARPORT 🚨🚨 data: notification_icon: mdi:alert channel: Notfall priority: high ttl: 0 color: red push: sound: name: default critical: 1 volume: 1 mode: single
alias: Carport_Ultraschallsensor
description: ""
trigger:
  - platform: state
    entity_id:
      -  binary_sensor.esphome_web_684d66_pkw_unter_carport
    to: "on"
    id: PKW Trigger On
  - platform: state
    entity_id:
      -  binary_sensor.esphome_web_684d66_pkw_unter_carport
    to: "off"
  - platform: time_pattern
    minutes: /30
  - platform: sun
    event: sunrise
    offset: 0
  - platform: sun
    event: sunset
    offset: 0
condition: []
action:
  - if:
      - condition: and
        conditions:
          - condition: state
            entity_id:  binary_sensor.esphome_web_684d66_pkw_unter_carport
            state: "on"
          - condition: or
            conditions:
              - condition: state
                entity_id: device_tracker.tlerch
                state: home
              - condition: state
                entity_id: device_tracker.slerch
                state: home
            alias: Eine Person ist zu Hause & Auto steht unter Carport
    then:
      - service: select.select_option
        metadata: {}
        data:
          option: "{{ states.sensor.helfer_pv_prognose_lademodus.state }}"
        target:
          entity_id: select.charge_mode
      - condition: trigger
        id:
          - PKW Trigger On
      - service: media_player.volume_set
        metadata: {}
        data:
          volume_level: 0.33
        target:
          entity_id: media_player.kuche
      - service: notify.alexa_media_kuche
        metadata: {}
        data:
          message: >-
            PKW unter Carport angekommen. Lademodus {{
            states.sensor.helfer_pv_prognose_lademodus.state }} selektiert
      - service: media_player.volume_set
        metadata: {}
        data:
          volume_level: 0.1
        target:
          entity_id: media_player.kuche
      - service: notify.mobile_app_tlerch
        metadata: {}
        data:
          message: >-
            Fahrzeug unter Carport angekommen. Lademodus {{
            states.sensor.helfer_pv_prognose_lademodus.state }} eingeschaltet
      - if:
          - condition: and
            conditions:
              - condition: sun
                before: sunrise
                after: sunrise
                enabled: false
              - condition: trigger
                id:
                  - PKW Trigger On
        then:
          - service: light.turn_on
            metadata: {}
            data:
              brightness_pct: 100
            target:
              entity_id: light.aussenbeleuchtung
          - delay:
              hours: 0
              minutes: 3
              seconds: 0
              milliseconds: 0
          - service: light.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: light.aussenbeleuchtung
    else:
      - condition: trigger
        id:
          - PKW Trigger On
      - service: select.select_option
        metadata: {}
        data:
          option: "off"
        target:
          entity_id: select.charge_mode
      - service: notify.mobile_app_tlerch
        metadata: {}
        data:
          message: Unbekanntes Fahrzeug unter Carport erkannt!
          title: 🚨🚨 CARPORT 🚨🚨
          data:
            notification_icon: mdi:alert
            channel: Notfall
            priority: high
            ttl: 0
            color: red
            push:
              sound:
                name: default
                critical: 1
                volume: 1
mode: single

Update der ESPHome funktioniert nicht (mehr) 20.06.2024:

Solltet ihr das Problem haben, dass ihr beim Update der ESPHome Revision bei eurem Device eine Fehlermeldung bekommt, dass das Update nicht durchgeführt werden kann, dann muss eine Zeile im YAML Code ergänzt werden ( ich habe das im veröffentlichten Code korrigiert ! )

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# Allow Over-The-Air updates
ota:
platform: esphome
password: xxxxxxxxxxxxxxxxx
# Allow Over-The-Air updates ota: platform: esphome password: xxxxxxxxxxxxxxxxx
# Allow Over-The-Air updates
ota:
  platform: esphome
  password: xxxxxxxxxxxxxxxxx

Infos zu dem Thema findet ihr in den Release Notes der ESPHome Version:

ESPHome 2024.6.0 – 19th June 2024 — ESPHome