forked from segalion/securitasdirect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecuritas_example.yaml
107 lines (100 loc) · 3.03 KB
/
securitas_example.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
sensor:
- platform: command_line
name: Securitas
command: "/home/homeassistant/bin/securitas"
command_timeout: 30
json_attributes:
- last_triggered
- changed_by
value_template: '{{ value_json.state }}'
alarm_control_panel:
- platform: manual
name: Securitas
pending_time: 0
shell_command:
securitas: /home/homeassistant/bin/ha_securitas {{command}}
automation:
- alias: Securitas_Set
id: '1538744231426'
trigger:
- entity_id: alarm_control_panel.securitas
platform: state
condition: []
action:
- service: xiaomi_aqara.play_ringtone
data:
gw_mac: 34:CE:00:88:A3:DC
ringtone_id: '10016'
- service: python_script.set_state
data_template:
entity_id: sensor.securitas
state: 'pending'
- service: shell_command.securitas
data_template:
command: '{{trigger.to_state.state}}'
- alias: Securitas_Refresh
id: '1538560913835'
trigger:
- entity_id: sensor.securitas
platform: state
- event: start
platform: homeassistant
condition: []
action:
- service: automation.turn_off
entity_id: automation.securitas_set
- service: python_script.set_state
data_template:
entity_id: alarm_control_panel.securitas
state: '{{states.sensor.securitas.state}}'
- service: automation.turn_on
entity_id: automation.securitas_set
- condition: template
value_template: '{{ trigger.from_state.state=="pending" }}'
- service: xiaomi_aqara.play_ringtone
data_template:
gw_mac: 34:CE:00:88:A3:DC
ringtone_id: '{% if trigger.to_state.state=="disarmed" %}10001{% elif trigger.to_state.state=="armed_home" %}10002{% elif trigger.to_state.state=="armed_
away" %}10003{% else %}10026{% endif%}'
- alias: Securitas_Button_Hold
id: '1539013569728'
trigger:
- event_data:
click_type: hold
entity_id: binary_sensor.switch_158d0001e0ee12
event_type: click
platform: event
condition: []
action:
- service: python_script.set_state
data_template:
entity_id: alarm_control_panel.securitas
state: '{% if states.alarm_control_panel.securitas.state=="armed_away" %}disarmed{% else %}armed_away{% endif %}'
- alias: Securitas_Button_2Clic
id: '1539013569729'
trigger:
- event_data:
click_type: double
entity_id: binary_sensor.switch_158d0001e0ee12
event_type: click
platform: event
condition: []
action:
- service: python_script.set_state
data_template:
entity_id: alarm_control_panel.securitas
state: '{% if states.alarm_control_panel.securitas.state=="armed_home" %}disarmed{% else %}armed_home{% endif %}'
- alias: Securitas_Llave1B_Hold
id: '1539013569730'
trigger:
- event_data:
click_type: simple
entity_id: binary_sensor.wall_switch_both_158d00027c3117
event_type: click
platform: event
condition: []
action:
- service: python_script.set_state
data_template:
entity_id: alarm_control_panel.securitas
state: '{% if states.alarm_control_panel.securitas.state=="armed_away" %}disarmed{% else %}armed_away{% endif %}'