forked from aderusha/HASwitchPlate
-
Notifications
You must be signed in to change notification settings - Fork 2
/
hasp_plate01_p1_scenes.yaml
executable file
·85 lines (80 loc) · 2.36 KB
/
hasp_plate01_p1_scenes.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
##############################################################################
# Automations for handling Scene select buttons on page 1
automation:
# Set font and text labels for scene buttons on device connection
- alias: hasp_plate01_p1_ScenesInit
trigger:
- platform: state
entity_id: 'binary_sensor.plate01_connected'
to: 'on'
- platform: homeassistant
event: start
action:
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[1].b[4].font'
payload: '2'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[1].b[4].txt'
payload: '"Lights On"'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[1].b[5].font'
payload: '2'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[1].b[5].txt'
payload: '"Daylight"'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[1].b[6].font'
payload: '2'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[1].b[6].txt'
payload: '"Night"'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[1].b[7].font'
payload: '2'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[1].b[7].txt'
payload: '"Lights Off"'
# Trigger scene.lights_on when p[1].b[4] pressed
- alias: hasp_plate01_p1_SceneButton4
trigger:
- platform: mqtt
topic: 'hasp/plate01/state/p[1].b[4]'
payload: 'ON'
action:
- service: scene.turn_on
entity_id: scene.lights_on
# Trigger scene.daylight when p[1].b[5] pressed
- alias: hasp_plate01_p1_SceneButton5
trigger:
- platform: mqtt
topic: 'hasp/plate01/state/p[1].b[5]'
payload: 'ON'
action:
- service: scene.turn_on
entity_id: scene.daylight
# Trigger scene.night when p[1].b[6] pressed
- alias: hasp_plate01_p1_SceneButton6
trigger:
- platform: mqtt
topic: 'hasp/plate01/state/p[1].b[6]'
payload: 'ON'
action:
- service: scene.turn_on
entity_id: scene.night
# Trigger lights_off.night when p[1].b[7] pressed
- alias: hasp_plate01_p1_SceneButton7
trigger:
- platform: mqtt
topic: 'hasp/plate01/state/p[1].b[7]'
payload: 'ON'
action:
- service: scene.turn_on
entity_id: scene.lights_off