Ich habe eine Automatisierung die, wenn ich eingeschlafen bin, den Fernseher, Lichter und noch paar Sachen ausschaltet. Das ganze löse ich über die sleep_confidence vom Handy.
Manchmal jedoch springt sie an, obwohl ich noch wach bin.
Jetzt hatte ich die Idee mit einer Abfrage “Schläfst Du schon?”
Drücke ich “Nein” soll die Automatisierung stoppen. Reagiere ich nicht innerhalb von 5 Minuten, soll sie weiter laufen und die Geräte ausschalten.
Leider läuft die Automation weiter obwohl ich auf “Nein” gedrückt habe.
Stehe grad etwas auf dem Schlauch, oder ich denk einfach zu kompliziert.
Kann mir mal bitte jemand helfen??
YAML s.u.
alias: SleepTimer Automatik
description: ""
triggers:
- trigger: numeric_state
entity_id:
- sensor.pixel_8_pro_sleep_confidence
for:
hours: 0
minutes: 10
seconds: 0
above: 93
conditions: []
actions:
- variables:
action_yes: "{{ 'YES_' ~ context.id }}"
action_no: "{{ 'NO_' ~ context.id }}"
- action: notify.mobile_app_pixel_8_pro
metadata: {}
data:
message: Schläfst Du schon?
data:
actions:
- action: "{{ action_yes }}"
title: Ja
- action: "{{ action_no }}"
title: Nein
- wait_for_trigger:
- trigger: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_yes }}"
context:
user_id:
- xxxxxxxxxxxxxxxxxxxxxxxxxx
timeout:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
continue_on_timeout: false
- parallel:
- type: turn_off
device_id: 49b71b9fd5d854cfbc9e0b878d0aa52e
entity_id: 49b2c5ed4c91e16c1124d67ed85d54df
domain: switch
- action: light.turn_off
metadata: {}
data:
transition: 30
target:
area_id:
- abstellraum
- bad
- buro
- esszimmer
- kuche
- schlafzimmer
- wohnzimmer
- if:
- condition: device
device_id: 8e32043f58dbd813ee55bd7b66dd0314
domain: climate
entity_id: fc5041efb6eb65469852356ebd02d068
type: is_hvac_mode
hvac_mode: auto
then:
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.heizung_17
- type: turn_off
device_id: 65b672fdb3ad9c8a9778573f05b9829d
entity_id: 11a12e1580f3e216425e30b7d0e90b34
domain: remote
- action: button.press
metadata: {}
data: {}
target:
entity_id: button.mdserver_shutdown
- delay:
hours: 0
minutes: 0
seconds: 15
milliseconds: 0
- parallel:
- type: turn_off
device_id: 7d22e6c5b45ecb27d11165b34e1fd24d
entity_id: 06e18715c7b71fa1531f2c1ee2136e2b
domain: switch
- type: turn_off
device_id: abae222931d0221f53979a4283353537
entity_id: 930279af5826b537319e0ab40325dd26
domain: switch
mode: restart
Ich wäre so Happy wenn das irgendwie gehen würde.
Danke - Markus