forked from sblantipodi/glow_worm_luciferin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome_assistant_luciferin_package.yaml
241 lines (235 loc) · 7.08 KB
/
home_assistant_luciferin_package.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
mqtt:
light:
- name: "GlowWorm"
schema: json
state_topic: "lights/glowwormluciferin"
command_topic: "lights/glowwormluciferin/set"
effect: true
effect_list:
- GlowWorm
- GlowWormWifi
- bpm
- fire
- twinkle
- rainbow
- chase rainbow
- solid rainbow
- mixed rainbow
- solid
brightness: true
rgb: true
optimistic: true
#transition: 1000
sensor:
- name: 'Firefly Luciferin Producing'
state_topic: 'lights/firelyluciferin/framerate'
unit_of_measurement: 'FPS'
value_template: '{{ value_json.producing }}'
- name: 'Firefly Luciferin Consuming'
state_topic: 'lights/firelyluciferin/framerate'
unit_of_measurement: 'FPS'
value_template: '{{ value_json.consuming }}'
- name: 'GlowWorm Version'
state_topic: 'lights/glowwormluciferin'
unit_of_measurement: ' '
value_template: '{{ value_json.ver }}'
force_update: true
- name: 'Glow Worm Luciferin FPS idle'
state_topic: 'lights/glowwormluciferin'
unit_of_measurement: 'FPS'
value_template: '{{ value_json.framerate }}'
force_update: true
- name: 'Glow Worm Luciferin FPS running'
state_topic: 'lights/glowwormluciferin/fps'
unit_of_measurement: 'FPS'
value_template: '{{ value_json.framerate }}'
force_update: true
- name: '# of LEDs'
state_topic: 'lights/glowwormluciferin'
unit_of_measurement: ''
value_template: '{{ value_json.lednum }}'
- name: 'Last Update GlowWorm'
state_topic: 'lights/glowwormluciferin'
value_template: '{{ as_timestamp(now()) | timestamp_custom("%Y-%m-%d ~ %H:%M:%S") }}'
- name: 'Aspect Ratio'
state_topic: 'lights/firelyluciferin/aspectratio'
switch:
- name: "rebootglowworm"
command_topic: "cmnd/glowwormluciferin/reboot"
state_topic: "stat/glowwormluciferin/reboot"
qos: 1
retain: false
payload_on: "ON"
payload_off: "OFF"
input_select:
gamma_select:
name: "Gamma"
options:
- 1.0
- 1.8
- 2.0
- 2.2
- 2.4
- 4.0
- 5.0
- 6.0
- 8.0
- 10.0
initial: 2.2
icon: mdi:gamma
input_number:
white_temp_slider:
name: White temp
icon: mdi:temperature-kelvin
initial: 6500
min: 2000
max: 11000
step: 100
input_boolean:
solideffect:
name: Solid Effect
initial: true
solideffectautomation:
name: Solid Effect Automation
initial: false
sensor:
- platform: template
sensors:
gw_fps:
friendly_name: "Glow Worm Luciferin"
value_template: >-
{% if as_timestamp(states.sensor.glow_worm_luciferin_fps_idle.last_updated) > as_timestamp(states.sensor.glow_worm_luciferin_fps_running.last_updated) %}
{{ states.sensor.glow_worm_luciferin_fps_idle.state }}
{% else %}
{{ states.sensor.glow_worm_luciferin_fps_running.state }}
{% endif %}
unit_of_measurement: 'FPS'
automation:
- id: '1547896325521'
alias: White Temp Auto
trigger:
- platform: state
entity_id: input_number.white_temp_slider
condition: []
action:
- service: mqtt.publish
data_template:
topic: "lights/glowwormluciferin/set"
qos: 0
retain: false
payload: '{"state":"ON","effect":"solid","whitetemp":"{{ ((states.input_number.white_temp_slider.state | int) / 100) }}","allInstances":"1"}}'
- id: '1548456985521'
alias: Solid Effect ON
trigger:
- entity_id: input_boolean.solideffect
from: 'off'
platform: state
to: 'on'
condition:
- condition: state
entity_id: input_boolean.solideffectautomation
state: 'off'
action:
- data:
payload: '{"state":"ON","startStopInstances":"STOP"}'
topic: lights/glowwormluciferin
service: mqtt.publish
- id: '1548456985522'
alias: Solid effect OFF
trigger:
- entity_id: input_boolean.solideffect
from: 'on'
platform: state
to: 'off'
condition:
- condition: state
entity_id: input_boolean.solideffectautomation
state: 'off'
action:
- data:
payload: '{"state":"ON","startStopInstances":"PLAY"}'
topic: lights/glowwormluciferin
service: mqtt.publish
- id: '3810295685522'
alias: Solid Effect Auto
trigger:
- platform: time_pattern
seconds: '/10'
action:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.solideffectautomation
- choose:
- conditions:
- condition: template
value_template: >-
{{ float(states.sensor.gw_fps.state) == 0 }}
sequence:
- service: input_boolean.turn_on
entity_id: input_boolean.solideffect
- service: mqtt.publish
data_template:
topic: lights/firelyluciferin/framerate
payload: '{"producing":0,"consuming":0}'
- conditions:
- condition: template
value_template: >-
{{ float(states.sensor.gw_fps.state) > 0 }}
sequence:
- service: input_boolean.turn_off
entity_id: input_boolean.solideffect
- service: input_boolean.turn_off
data:
entity_id: input_boolean.solideffectautomation
- id: '4321674486'
alias: PC Animation Speed
initial_state: true
trigger:
- platform: state
entity_id: input_number.pc_animation_speed
action:
- service: mqtt.publish
data_template:
topic: lights/glowwormluciferin/set
payload: '{"transition":{{ trigger.to_state.state | int }}}'
- id: '1598969517535'
alias: Glowworm Alive
trigger:
platform: time_pattern
minutes: '/5'
condition:
condition: template
value_template: "{{ (not (as_timestamp(now()) < (as_timestamp(states.sensor.glowworm_version.last_updated) + 300))) and (states.input_boolean.solideffect.state == 'on') }}"
action:
- data:
message: "Glowworm stopped responding!"
service: notify.telegram_notifier
- alias: Set Luciferin Gamma
trigger:
- entity_id: input_select.gamma_select
platform: state
action:
- service: mqtt.publish
data_template:
topic: "lights/firelyluciferin/gamma"
retain: "false"
payload: '{"gamma":"{{states.input_select.gamma_select.state}}"}'
- alias: Set HA Gamma
trigger:
platform: mqtt
topic: "lights/firelyluciferin/gamma"
action:
service: input_select.select_option
data:
entity_id: input_select.gamma_select
option: "{{ trigger.payload_json.gamma }}"
homeassistant:
customize:
input_number.pc_animation_speed:
icon: mdi:speedometer
input_boolean.solideffect:
icon: mdi:television-ambient-light
sensor.aspect_ratio:
icon: mdi:monitor-screenshot
light.glowworm:
icon: mdi:google-circles-communities