forked from myGithub-Markus/home-assistant_blueprints
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanually_aware_entities.yaml
60 lines (55 loc) · 1.89 KB
/
manually_aware_entities.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
blueprint:
name: Manually aware entities
description: >
Overrides motion aware entities. This is usefull for take over light control via switch. Means switch off and on take over the motion aware light control
domain: automation
input:
target_entity_blocker:
name: Entity blocker
description: "Input Boolean that decides if entities blocked manually."
selector:
target:
entity:
domain: input_boolean
target_motion_activated:
name: Motion activated
description: "Motion activated to keep in sync."
selector:
target:
entity:
domain: input_boolean
motion_activated:
name: Motion activated
description: "Input Boolean that shows if the entities turned on via motion"
selector:
entity:
domain: input_boolean
target_entity:
name: Entity
description: "This entity will be synchronized with the Input Boolean's."
selector:
entity:
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input target_entity
variables:
motion_activated: !input motion_activated
target_entity: !input target_entity
entity_domain: "{{ states[target_entity].domain }}"
condition: []
action:
- choose:
- conditions:
- "{{ ((entity_domain == 'scene') or states[target_entity].state == 'on') and is_state(motion_activated, 'off') }}"
sequence:
- service: input_boolean.turn_on
target: !input target_entity_blocker
- conditions:
- "{{ (entity_domain == 'scene') or states[target_entity].state == 'off' }}"
sequence:
- service: input_boolean.turn_off
target: !input target_entity_blocker
- service: input_boolean.turn_off
target: !input target_motion_activated