Hi, i got it running (and learning thanx to your help!):
In configuration.yaml:
timer:
partyraum_timer:
duration: '00:00:15'
In Automation.yaml:
- id: '1638036241709'
alias: Partyraum Licht voll
description: ''
trigger:
- platform: state
entity_id: binary_sensor.partyraum_lichtschalter_full
from: 'off'
to: 'on'
condition: []
action:
- service: script.partyraumbeleuchtung_voll
data: {}
mode: single
- id: '1638036310682'
alias: Partyraum Licht voll aus
description: ''
trigger:
- platform: state
entity_id: binary_sensor.partyraum_lichtschalter_full
from: 'on'
to: 'off'
condition: []
action:
- service: script.partyraumbeleuchtung_default
data: {}
mode: single
alias: Partyraum Licht an aus
description: ''
trigger:
- platform: state
entity_id: binary_sensor.partyraum_lichtschalter
from:
- 'off'
- 'on'
to:
- 'on'
- 'off'
condition: []
action:
- service: '{{ ''script.partyraumbeleuchtung_default'' if trigger.to_state.state
== ''on'' else ''script.partyraumbeleuchtung_standby''}}'
data: {}
mode: single
alias: Partyraum_timer
trigger:
- platform: state
entity_id: binary_sensor.partyraum_pir
from: 'off'
to: 'on'
action:
- service: timer.start
target:
entity_id: timer.partyraum_timer
data:
duration: 00:00:30
alias: Partyraum_Timer_End
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.partyraum_timer
action:
- service: script.partyraumbeleuchtung_standby
alias: Partyraum_Timer_Start
trigger:
- platform: event
event_type: timer.started
event_data:
entity_id: timer.partyraum_timer
action:
- service: script.partyraumbeleuchtung_motion
One thing about this motion detection must be combined with the Licht an aus:
The (alias) Partyraum_timer must be only allowed if the binary_sensor.partyraum_lichtschalter is off!
EDIT: I could manage to get also this to work:
- id: '1638123705921'
alias: Partyraum_timer
trigger:
- platform: state
entity_id: binary_sensor.partyraum_pir
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: binary_sensor.partyraum_lichtschalter
state: 'off'
action:
- service: timer.start
target:
entity_id: timer.partyraum_timer
data:
duration: 00:05:00
mode: single
i am wondering why can i not define brightness values in % in the sript?
sequence:
- service: light.turn_on
target:
entity_id: light.partyraum_lampe1
data:
brightness: 30
i can only use values from 0 to 255 but not von 0% to 100%. it gives me an error if i replace values with %!
Now only the very last step is to do:
If person Wolfram and person Sabine are away, turn off the light completely(call a script.partyraumbeleuchtung_aus).