I can edit other automations and create new ones, but this one can’t be edited:
alias: Fernseher xxx
description: ""
trigger:
- platform: state
entity_id:
- sensor.time_remaining
to: "0.0"
id: ZeitWeg
- platform: numeric_state
entity_id:
- sensor.time_remaining
above: 0
id: ZeitDa
- platform: time
at: "06:00:00"
id: ZeitDaUhr
- alias: Gute-Nacht-Alarm ist jetzt
platform: template
value_template: >-
{{ states('time.bedtime_alarm') < now().timestamp() |
timestamp_custom('%H:%M:%S') }}
id: ZeitWeg
- alias: Fernseher Laufzeit größer als Spielzeit
platform: template
value_template: >-
{{states.sensor.fernseher_xxx_laufzeit.state|float>states.input_number.ursprungszeit.state|float+9/60}}
id: ZeitWeg
- platform: state
entity_id:
- time.bedtime_alarm
id: ZeitDa
- platform: state
entity_id:
- switch.alarms_enabled_today
to: "on"
id: ZeitWeg
- platform: state
entity_id:
- switch.alarms_enabled_today
to: "off"
id: ZeitDa
- platform: time
at: "14:30:00"
id: ZeitDaUhr
- platform: state
entity_id:
- person.xxx
to: not_home
id: Abwesend
- platform: state
entity_id:
- device_tracker.gast
to: not_home
id: Abwesend
- platform: state
entity_id:
- person.xxx
to: home
id: ZeitDaUhr
- platform: state
entity_id:
- device_tracker.gast
to: home
id: ZeitDaUhr
- platform: state
entity_id:
- time.bedtime_alarm
id: ZeitberechnungAn
- platform: numeric_state
entity_id:
- number.xxxs_switch_play_time_limit
above: 0
id: ZeitberechnungAn
condition:
- condition: or
conditions:
- condition: and
conditions:
- condition: trigger
id:
- ZeitWeg
- condition: state
entity_id: switch.alarms_enabled_today
state: "on"
- condition: or
conditions:
- condition: template
value_template: >-
{{ states('time.bedtime_alarm') < now().timestamp() |
timestamp_custom('%H:%M:%S') }}
alias: Gute Nacht Alarm überschritten
- alias: Weder Schulfrei noch Wochenende
condition: and
conditions:
- condition: state
entity_id: binary_sensor.arbeitstag_heute_sensor
state: "on"
- condition: state
entity_id: binary_sensor.schulfrei_xxx_heute
state: "off"
- condition: or
conditions:
- condition: state
entity_id: sensor.time_remaining
state: "0.0"
- condition: template
value_template: >-
{{states.sensor.fernseher_xxx_laufzeit.state|float>states.input_number.ursprungszeit.state|float+9/60}}
alias: Fernseher Laufzeit größer als Spielzeit
- condition: and
conditions:
- condition: trigger
id:
- ZeitDa
- ZeitDaUhr
- condition: or
conditions:
- condition: and
conditions:
- condition: template
value_template: >-
{{ states('time.bedtime_alarm') > now().timestamp() |
timestamp_custom('%H:%M:%S') }}
alias: Gute Nacht Alarm ist noch nicht
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.time_remaining
above: 0
- condition: state
entity_id: binary_sensor.arbeitstag_heute_sensor
state: "off"
- condition: state
entity_id: binary_sensor.schulfrei_xxx_heute
state: "on"
- condition: and
conditions:
- condition: trigger
id:
- ZeitDaUhr
- condition: or
conditions:
- condition: and
conditions:
- condition: time
after: "06:00:00"
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.arbeitstag_heute_sensor
state: "off"
- condition: state
entity_id: binary_sensor.schulfrei_xxx_heute
state: "on"
- condition: time
after: "14:30:00"
- condition: time
after: "06:00:00"
- condition: state
entity_id: switch.alarms_enabled_today
state: "off"
- condition: and
conditions:
- condition: trigger
id:
- Abwesend
- condition: state
entity_id: person.xxx
state: not_home
- condition: state
entity_id: device_tracker.gast
state: not_home
- alias: Zeitberechnung
condition: and
conditions:
- condition: trigger
id:
- ZeitberechnungAn
- condition: time
after: "06:00:00"
- condition: numeric_state
entity_id: number.xxxs_switch_play_time_limit
above: 0
- condition: state
entity_id: binary_sensor.arbeitstag_heute_sensor
state: "on"
- condition: state
entity_id: binary_sensor.schulfrei_xxx_heute
state: "off"
- condition: state
entity_id: binary_sensor.arbeitstag_morgen_sensor
state: "on"
- condition: state
entity_id: binary_sensor.schulfrei_xxx_morgen
state: "off"
action:
- if:
- condition: trigger
id:
- ZeitWeg
- Abwesend
then:
- if:
- alias: Fernseher Laufzeit größer als Spielzeit
condition: template
value_template: >-
{{states.sensor.fernseher_xxx_laufzeit.state|float>states.number.xxxs_switch_play_time_limit.state|int/60}}
- condition: not
conditions:
- condition: state
entity_id: number.xxxs_switch_play_time_limit
state: "0.0"
- condition: trigger
id:
- Abwesend
- condition: template
value_template: >-
{{ states('time.bedtime_alarm') > now().timestamp() |
timestamp_custom('%H:%M:%S') }}
then:
- service: notify.matrix_xxx_mit
data:
message: Deine heutige Fernseh- und Spielzeit ist abgelaufen.
- if:
- condition: numeric_state
entity_id: sensor.fernseher_xxx_gesamt_power
above: 25
then:
- service: tts.google_translate_say
metadata: {}
data:
cache: false
language: de
entity_id: media_player.xxx_panasonic_viera_tv
message: Deine Heutige Medienzeit ist aufgebraucht
- service: notify.matrix_xxx_log
data:
message: >-
Fernseher lief länger als die heutige erlaubte Spielzeit, daher
Fernseher ausgeschaltet und Spielzeit auf 0 gesetzt
- service: number.set_value
metadata: {}
data:
value: "0"
target:
entity_id: number.xxxs_switch_play_time_limit
else:
- if:
- condition: template
value_template: >-
{{ states('time.bedtime_alarm') < now().timestamp() |
timestamp_custom('%H:%M:%S') }}
- condition: numeric_state
entity_id: sensor.fernseher_xxx_gesamt_power
above: 25
- condition: trigger
id:
- ZeitWeg
then:
- service: tts.google_translate_say
metadata: {}
data:
cache: false
language: de
entity_id: media_player.xxx_panasonic_viera_tv
message: Gute Nacht xxx
- if:
- condition: numeric_state
entity_id: sensor.fernseher_xxx_gesamt_power
above: 25
then:
- type: turn_off
device_id: aa23d3d4ee95cd8099c46692a0cb93fb
entity_id: 3d3663f22a67dcde2dfdc807515a9c06
domain: remote
- parallel:
- wait_for_trigger:
- platform: state
entity_id:
- binary_sensor.fernseher_xxx
to: "off"
continue_on_timeout: true
timeout:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- repeat:
sequence:
- type: turn_off
device_id: aa23d3d4ee95cd8099c46692a0cb93fb
entity_id: 3d3663f22a67dcde2dfdc807515a9c06
domain: remote
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
until:
- condition: state
entity_id: binary_sensor.fernseher_xxx
state: "off"
- type: turn_off
device_id: 7bf17e809693585372f655e2056c2995
entity_id: 22a45935c24a2e087713ba1306c0d062
domain: switch
- if:
- condition: trigger
id:
- ZeitWeg
then:
- service: automation.turn_off
metadata: {}
data:
stop_actions: true
target:
entity_id: automation.xxx_zeitberechnung
else:
- if:
- condition: trigger
id:
- ZeitDa
- ZeitDaUhr
then:
- if:
- condition: state
entity_id: person.xxx
state: home
then:
- type: turn_on
device_id: 7bf17e809693585372f655e2056c2995
entity_id: 22a45935c24a2e087713ba1306c0d062
domain: switch
- if:
- condition: trigger
id:
- ZeitDaUhr
then:
- alias: Spielzeit einstellen
if:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.arbeitstag_heute_sensor
state: "off"
- condition: state
entity_id: binary_sensor.schulfrei_xxx_heute
state: "on"
- condition: state
entity_id: binary_sensor.arbeitstag_morgen_sensor
state: "off"
- condition: state
entity_id: binary_sensor.schulfrei_xxx_morgen
state: "on"
- condition: not
conditions:
- condition: and
conditions:
- condition: time
before: "14:30:00"
- condition: state
entity_id: binary_sensor.schulfrei_xxx_heute
state: "off"
- condition: state
entity_id: binary_sensor.arbeitstag_heute_sensor
state: "on"
then:
- service: number.set_value
metadata: {}
data:
value: "-1"
target:
entity_id: number.xxxs_switch_play_time_limit
- service: input_number.set_value
metadata: {}
data:
value: 18
target:
entity_id: input_number.ursprungszeit
- if:
- condition: time
before: "10:00:00"
then:
- service: notify.matrix_xxx_log
data:
message: >-
xxxs heutige Spiel- und Fernsehzeit ist auf
unbegrenzt bis {{states("time.bedtime_alarm")}} Uhr
eingestellt.
- wait_for_trigger:
- platform: time
at: "10:00:00"
continue_on_timeout: true
timeout:
hours: 4
minutes: 0
seconds: 0
milliseconds: 0
- service: notify.matrix_xxx_mit
data:
message: >-
Deine heutige Spiel- und Fernsehzeit ist unbegrenzt bis
{{states("time.bedtime_alarm")}} Uhr.
else:
- if:
- condition: time
after: "14:30:00"
then:
- service: number.set_value
metadata: {}
data:
value: "180"
target:
entity_id: number.xxxs_switch_play_time_limit
- service: input_number.set_value
metadata: {}
data:
value: 3
target:
entity_id: input_number.ursprungszeit
- service: notify.matrix_xxx_mit
data:
message: >-
Deine heutige Spiel- und Fernsehzeit ist
{{states("input_number.ursprungszeit")}} Stunden bis
{{states("time.bedtime_alarm")}} Uhr.
- service: automation.turn_on
metadata: {}
data: {}
target:
entity_id: automation.xxx_zeitberechnung
enabled: true
enabled: true
- wait_for_trigger:
- platform: numeric_state
entity_id:
- sensor.fernseher_xxx_gesamt_power
above: 30
continue_on_timeout: true
timeout:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- repeat:
sequence:
- type: turn_off
device_id: aa23d3d4ee95cd8099c46692a0cb93fb
entity_id: 3d3663f22a67dcde2dfdc807515a9c06
domain: remote
until:
- condition: numeric_state
entity_id: sensor.fernseher_xxx_gesamt_power
below: 25
else:
- if:
- condition: trigger
id:
- ZeitberechnungAn
then:
- service: automation.turn_on
metadata: {}
data:
stop_actions: true
target:
entity_id: automation.xxx_zeitberechnung
- service: notify.matrix_xxx_log
data:
message: >-
Gute Nacht Alarm verändert, daher Zeitberechnung wieder
eingeschaltet.
mode: single
6 posts - 4 participants