Hi, ich bin gerade dabei ein Skript zu erstellen das meine Jalousien steuert. Da sie zu 99% schon automatisch laufen, möchte ich nun an meiner aktuellen Automation erweitern und habe mich dazu nun entschlossen das ich eine Hauptfunktion als Skript erstellen möchte.
der Inhalt vom Skript hat verschiedene Eingänge(Zeitpläne, Sensoren, usw) und als Ausgang ein oder mehrere Cover’s.
ich füge mal mein aktuellen code ein, da ich das Skript nicht zum laufen bekomme und aktuell mein Fehler nicht sehe
alias: Jalousie_Skript_v2
sequence:
- choose:
- conditions:
- condition: or
conditions:
- condition: and
conditions:
- condition: template
value_template: >
{% set item = states[zeitplan_auf] %} {{ item.state ==
'on' }}
- condition: template
value_template: >
{% set item = states[turkontakt] %} {{ item.state == 'on'
}}
- condition: template
value_template: |
{% set item = states[sperre] %} {{ item.state == 'on' }}
- condition: template
value_template: >
{% set item = states[hand_mode] %} {{ item.state == 'on'
}}
- condition: and
conditions:
- condition: template
value_template: |
{{ states('[temperatur_sensor]') | float <= 33 }}
- condition: template
value_template: >
{% set item = states[hand_mode] %} {{ item.state == 'off'
}}
- condition: template
value_template: >
{% set item = states[sperre] %} {{ item.state == 'off'
}}
sequence:
- action: cover.open_cover
metadata: {}
data: {}
target:
device_id: " {{ jalousie }} "
alias: Jalousie Auf
- conditions:
- condition: and
conditions:
- condition: template
value_template: >
{% set item = states[zeitplan_halb] %} {{ item.state == 'on'
}}
- condition: template
value_template: >
{% set item = states[turkontakt] %} {{ item.state == 'on'
}}
- alias: Jahreszeiten
condition: or
conditions:
- condition: template
value_template: >
{% set item = states[zeitplan_halb] %} {{ item.state ==
'on' }}
- condition: template
value_template: >
{% set item = states[jahreszeit] %} {{ item.state ==
'winter' }}
- condition: template
value_template: >
{% set item = states[jahreszeit] %} {{ item.state ==
'autumn' }}
- condition: template
value_template: >
{% set item = states[jahreszeit] %} {{ item.state ==
'spring' }}
- condition: template
value_template: |
{{ states('[temperatur_sensor]') | float <= 33 }}
- condition: template
value_template: |
{% set item = states[hand_mode] %} {{ item.state == 'off' }}
- condition: template
value_template: |
{% set item = states[sperre] %} {{ item.state == 'off' }}
sequence:
- action: cover.set_cover_position
metadata: {}
data:
position: 50
target:
device_id: " {{ jalousie }} "
alias: Halb zu
- conditions:
- condition: or
conditions:
- condition: and
conditions:
- condition: template
value_template: >
{% set item = states[zeitplan_zu] %} {{ item.state ==
'on' }}
- condition: template
value_template: >
{% set item = states[turkontakt] %} {{ item.state == 'on'
}}
- condition: template
value_template: >
{% set item = states[hand_mode] %} {{ item.state == 'off'
}}
- condition: template
value_template: >
{% set item = states[sperre] %} {{ item.state == 'off'
}}
- condition: and
conditions:
- condition: template
value_template: |
{{ states('[temperatur_sensor]') | float <= 33 }}
- condition: template
value_template: >
{% set item = states[hand_mode] %} {{ item.state == 'off'
}}
- condition: template
value_template: >
{% set item = states[sperre] %} {{ item.state == 'off'
}}
sequence:
- action: cover.close_cover
metadata: {}
data: {}
target:
device_id: " {{ jalousie }} "
alias: Jalousie Zu
fields:
jalousie:
selector:
entity:
domain: cover
multiple: true
name: Jalousie
description: Welche jalousie soll gesteuer werden?
required: true
temperatur_sensor:
selector:
entity:
domain: sensor
name: Temperatur Sensor
zeitplan_zu:
selector:
entity: {}
name: ZeitPlan Zu
default: schedule.abendsplan
zeitplan_auf:
selector:
entity: {}
name: ZeitPlan Auf
default: schedule.morgensplan
zeitplan_halb:
selector:
entity: {}
name: ZeitPlan Halb
default: schedule.halbfahrtplan
jahreszeit:
selector:
entity: {}
name: Jahreszeit
default: sensor.season
turkontakt:
selector:
entity: {}
name: Türkontakt
description: Überprüft ob Tür/Fenster offen ist
default: input_boolean.turkontakt_dummy_jalousie
sperre:
selector:
entity: {}
name: Sperre
description: Diese Sperre dient als schutz( z.B. eine lampe)
hand_mode:
selector:
entity: {}
name: Hand mode
description: wenn man ausserhalb der automatik bedienen möchte
description: ""