forked from TD22057/insteon-mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yaml
895 lines (812 loc) · 35 KB
/
config.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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
#==========================================================================
#
# Insteon <-> MQTT bridge configuration file.
#
# NOTE: the loader supports using a !include tag to load other as a
# item entry so you can do things like this:
#
# insteon:
# devices: !include devices.yaml
#
#==========================================================================
#==========================================================================
#
# Optional logging configuration (can also be set via the command line)
#
#==========================================================================
logging:
# 10=DEBUG, 20=INFO, 30=WARNING, 40=ERROR
level: 10
# Print messages to the screen.
#screen: False
# Print messages to a file.
#file: /var/log/insteon_mqtt.log
#==========================================================================
#
# Insteon configuration
#
#==========================================================================
insteon:
# Serial device:
# USB PLM modem
port: '/dev/insteon'
#baudrate: 19200
# Network socket:
# Insteon HUB PLM network
#port: 'socket://192.168.1.5:9761'
# PLM modem Insteon hex address
address: 44.85.11
# Device database file storage location.
#storage: '/var/lib/insteon-mqtt'
storage: 'data'
# Automatically refresh device states and databases (if needed) at
# startup. This may be slow depending on the number of devices.
startup_refresh: False
#------------------------------------------------------------------------
# Devices require the Insteon hex address and an optional name. Note
# that MQTT address topics are always the lower case hex address or
# the input name depending on how they are configured below.
devices:
# On/off switch devices (outlets, wall switches, appliance modules, etc).
switch:
- 3a.29.84: 'xmas tree'
- 26.48.ff: 'xmas stairs'
- 37.2d.20: 'xmas deck'
# Dimming devices (outlets, wall switches, lamp modules, etc).
dimmer:
- 3a.29.84: 'lamp2'
- 48.3d.46
- 48.b0.ad: 'dim1'
# Battery powered sensors (door, hidden door, window).
battery_sensor:
- 94.a9.12
# Battery powered motion sensors.
motion:
- 21.d6.d9: 'door'
# Battery powered mini remotes.
mini_remote4:
mini_remote8:
- 3f.07.d4: 'remote1'
# Smoke bridge module.
smoke_bridge:
- 44.a3.79: 'smoke alarm'
# FanLinc fan controller (dimmer+fan).
#fan_linc:
# - 9a.a1.b3
# KeypadLinc dimmers (dimmer+scene controller).
keypad_linc:
- 46.7b.bc: 'porch'
# KeypadLinc switches (on/off+scene controller).
keypad_linc_sw:
- 3c.42.9b: 'kp2'
# Leak sensors.
#leak:
# - 21.d6.d9: 'bathroom'
# IOLinc relay controllers
io_linc:
- 45.33.d4: 'garage'
# On/off ouetlets
#outlet:
# - aa.bb.cc: 'outlet'
# Thermostatus
thermostat:
# - aa.bb.cc: 'downstairs'
#------------------------------------------------------------------------
# FUTURE: Insteon scene definitions.
#scenes:
# - scene_01:
#==========================================================================
#
# MQTT configuration
#
#==========================================================================
mqtt:
broker: 127.0.0.1
port: 1883
# Optional broker login data.
#username:
#password:
# Keep alive time in seconds. This should be smaller than the
# server setting (which is usually ~60 seconds) to insure that
# connections aren't dropped.
keep_alive: 30
# Outbound messages configuration. Retain should generally be 1
# so that the current state is available when someone subscribes.
qos: 1
retain: 1
# Input commands topic to allow changes to a device. See the device
# documentation for details. NOTE: This is usually not needed for
# home automation - it's used by the command line tool to modify the
# Insteon devices, network, and scenes. The address or name of the
# device will follow the command topic (insteon/command/aa.bb.cc) to
# send these low level commands.
cmd_topic: 'insteon/command'
# Trigger modem virtual scenes. Modem scenes are where the modem is a
# controller and emits a scene broadcast with the specified group number.
# There is no state topic since the scene doesn't have an on/off state.
#
# In Home Assistant use MQTT switch with a configuration like this to trigger
# modem scene 10:
# switch:
# - platform: mqtt
# name: "scene #10"
# command_topic: "insteon/modem/scene"
# payload_on: { "cmd" : "on", "group" : 10 }
# payload_off: { "cmd" : "off", "group" : 10 }
modem:
# The output of passing the payload through the template must match the
# following where group is in the range 1-255.
# { "cmd" : 'on'/'off', "group" : GROUP }
# Available variables for templating are:
# value = the input payload
# json = the input payload converted to json. Use json.VAR to extract
# a variable from a json payload.
scene_topic: 'insteon/modem/scene'
scene_payload: '{{value}}'
# IMPORTANT: all devices must have the pair() command run one time to make
# sure that the all the necessary controller/responder links are defined
# between the device and the modem. If these links are there, the commands
# and outputs below will not work properly.
#------------------------------------------------------------------------
# On/off switches
#------------------------------------------------------------------------
# On/Off switch. Non-dimming lamp modules and wall switches.
# In Home Assistant use MQTT switch with a configuration like:
# switch:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/state'
# command_topic: 'insteon/aa.bb.cc/set'
switch:
# Output state change topic and template. This message is sent
# whenever the device state changes for any reason. Available
# variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# on = 0/1
# on_str = 'off'/'on'
# mode = 'normal'/'fast'/'instant'
# fast = 0/1
# instant = 0/1
state_topic: 'insteon/{{address}}/state'
state_payload: '{{on_str.upper()}}'
# Manual mode (holding down a button) is triggered once when the button
# is held and once when it's released. Available variables for
# templating are address (see above), name (see above), and:
# manual_str = 'up'/'off'/'down'
# manual = 1/0/-1
# manual_openhab = 2/1/0
#manual_state_topic: 'insteon/{{address}}/manual_state'
#manual_state_payload: '{{manual_str.upper()}}'
# Input on/off command. Similar functionality to the cmd_topic
# but only for turning the device on and off. The output of
# passing the payload through the template must match the following:
# { "cmd" : 'on'/'off', ["mode" : 'normal'/'fast'/'instant'],
# ["fast" : 1/0], ["instant" : 1/0] }
# Available variables for templating are:
# value = the input payload
# json = the input payload converted to json. Use json.VAR to extract
# a variable from a json payload.
on_off_topic: 'insteon/{{address}}/set'
on_off_payload: '{ "cmd" : "{{value.lower()}}" }'
# Scene on/off command. This triggers the scene broadcast on the switch
# in the same way clicking the button would. The inputs are the same as
# those for the on_off topic and payload.
scene_topic: 'insteon/{{address}}/scene'
scene_payload: '{ "cmd" : "{{value.lower()}}" }'
#------------------------------------------------------------------------
# Dimmers
#------------------------------------------------------------------------
# Dimmer switch. Dimming lamp modules and wall switches. In Home
# Assistant use MQTT light with a configuration like the following -
# this gets HA to send the brightness value as the payload for all
# control of the light.
# light:
# - platform: mqtt
# schema: json
# name: "insteon 1"
# state_topic: "insteon/48.b0.ad/state"
# command_topic: "insteon/48.b0.ad/level"
# brightness: true
#
dimmer:
# Output state change topic and payload. This message is sent
# whenever the device state changes for any reason. Available
# variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# on = 0/1
# on_str = 'off'/'on'
# level_255 = 0-255
# level_100 = 0-100
# mode = 'normal'/'fast'/'instant'
# fast = 0/1
# instant = 0/1
state_topic: 'insteon/{{address}}/state'
state_payload: >
{ "state" : "{{on_str.upper()}}", "brightness" : {{level_255}} }
# Manual mode (holding down a button) is triggered once when the button
# is held and once when it's released. Available variables for
# templating are address (see above), name (see above), and:
# manual_str = 'up'/'off'/'down'
# manual = 1/0/-1
# manual_openhab = 2/1/0
#manual_state_topic: 'insteon/{{address}}/manual_state'
#manual_state_payload: '{{manual_str.upper()}}'
# Input on/off command. Similar functionality to the cmd_topic
# but only for turning the device on and off. The output of
# passing the payload through the template must match the following:
# { "cmd" : "on"/"off", ["mode" : 'normal'/'fast'/'instant'],
# ["fast" : 1/0], ["instant" : 1/0] }
# Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# value = the input payload
# json = the input payload converted to json. Use json.VAR to extract
# a variable from a json payload.
# NOTE: this isn't used by the HA example above - it's only useful when
# treating the dimmer as an on/off switch and sending ON/OFF payloads
on_off_topic: 'insteon/{{address}}/set'
on_off_payload: '{ "cmd" : "{{value.lower()}}" }'
# Input dimming on/off command. Similar functionality to the cmd_topic
# but only for turning the device on and off and setting the level.
# The output of passing the payload through the template must match the
# following:
# { "cmd" : "on"/"off", "level" : LEVEL,
# ["mode" : 'normal'/'fast'/'instant'],
# ["fast" : 1/0], ["instant" : 1/0] }
# where:
# LEVEL = 0->255 dimmer level
# Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# value = the input payload
# json = the input payload converted to json. Use json.VAR to extract
# a variable from a json payload.
level_topic: 'insteon/{{address}}/level'
# NOTE: HASS JSON switch doesn't send brightness in some cases
# when actuated so handle that here in the template code. The
# other HASS MQTT options also have this problem.
level_payload: >
{ "cmd" : "{{json.state.lower()}}",
"level" : {% if json.brightness is defined %}
{{json.brightness}}
{% else %}
255
{% endif %} }
# Scene on/off command. This triggers the scene broadcast on the switch
# in the same way clicking the button would. The inputs are the same as
# those for the on_off topic and payload.
scene_topic: 'insteon/{{address}}/scene'
scene_payload: '{ "cmd" : "{{value.lower()}}" }'
#------------------------------------------------------------------------
# Battery powered sensors
# door sensors, hidden door sensors, window sensors
#------------------------------------------------------------------------
# In Home Assistant use MQTT binary sensor with a configuration like:
# binary_sensor:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/state'
# device_class: 'motion'
#
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/low_battery'
# device_class: 'battery'
battery_sensor:
# Output state change topic and payload. This message is sent
# whenever the device state changes for any reason. Available
# variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# on = 0/1
# on_str = 'off'/'on'
state_topic: 'insteon/{{address}}/state'
state_payload: '{{on_str.upper()}}'
# Output low battery topic and payload. This message is sent
# whenever the device detects a low battery. Available variables
# for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# is_low = 0/1
# is_low_str = 'off'/'on'
low_battery_topic: 'insteon/{{address}}/battery'
low_battery_payload: '{{is_low_str.upper()}}'
#------------------------------------------------------------------------
# Motion sensors
#------------------------------------------------------------------------
# Motion sensors will use the state and low battery configuration
# inputs from battery_sensor and some sensors add an addition
# dawn/dusk notification which is configured here.
#
# To register the dawn/dusk signa in Home Assistant use MQTT binary
# sensor with a configuration like:
# binary_sensor:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/dawn'
# device_class: 'light'
motion:
# Output dawn/dusk change topic and payload. This message is sent
# whenever the device light sensor detects dawn or dusk changes.
# Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# is_dawn = 0/1
# is_dawn_str = 'off'/'on'
# is_dusk = 0/1
# is_dusk_str = 'off'/'on'
# state = 'dawn'/'dusk'
dawn_dusk_topic: 'insteon/{{address}}/dawn'
dawn_dusk_payload: '{{is_dawn_str.upper()}}'
#------------------------------------------------------------------------
# Leak sensors
#------------------------------------------------------------------------
# Leak sensors will report the dry/wet status and a heartbeat every 24
# hours. The leak sensors does not support low battery signal like other
# battery operated devices.
#
# In Home Assistant use a combination of MQTT binary sensor and template
# sensor with a configuration like:
# binary_sensor:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/wet'
# device_class: 'moisture'
#
# sensors:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/heartbeat'
leak:
# Output wet/dry change topic and payload. This message is sent
# whenever the device changes state to wet or dry.
# Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# is_wet = 0/1
# is_wet_str = 'off'/'on'
# is_dry = 0/1
# is_dry_str = 'off'/'on'
# state = 'wet'/'dry'
wet_dry_topic: 'insteon/{{address}}/wet'
wet_dry_payload: '{{is_wet_str.upper()}}'
# Output heartbeat topic and payload. This message is sent
# every 24 hours. Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# is_heartbeat = 0/1
# heartbeat_time = UNIX time float of the last heartbeat
heartbeat_topic: 'insteon/{{address}}/heartbeat'
heartbeat_payload: '{{heartbeat_time}}'
#------------------------------------------------------------------------
# Smoke Bridge
#------------------------------------------------------------------------
# The smoke bridge will broadcast on a variety of groups for various error
# conditions.
#
# In Home Assistant use MQTT binary sensor with a configuration like:
# binary_sensor:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/smoke'
# device_class: 'smoke'
#
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/battery'
# device_class: 'battery'
#
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/co'
# device_class: 'gas'
#
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/error'
smoke_bridge:
# Output state change topic and payload. This message is sent
# whenever the device state changes for any reason. Available
# variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# on = 0/1
# on_str = 'off'/'on'
# type = 'smoke'/'co'/'low_battery'/'error'/'clear'
smoke_topic: 'insteon/{{address}}/smoke'
smoke_payload: '{{on_str.upper()}}'
co_topic: 'insteon/{{address}}/co'
co_payload: '{{on_str.upper()}}'
battery_topic: 'insteon/{{address}}/battery'
battery_payload: '{{on_str.upper()}}'
error_topic: 'insteon/{{address}}/error'
error_payload: '{{on_str.upper()}}'
#------------------------------------------------------------------------
# Thermostat
#------------------------------------------------------------------------
# The thermostat has a lot of available states and commands
#
#
# In Home Assistant use MQTT climate sensor with a configuration like:
# climate:
# - platform: mqtt
# name: Study
# mode_state_topic: "insteon/aa.bb.cc/mode_state"
# modes: ["OFF", "AUTO", "HEAT", "COOL", "PROGRAM"]
# current_temperature_topic: "insteon/aa.bb.cc/ambient_temp"
# fan_mode_state_topic: "insteon/aa.bb.cc/fan_state"
# fan_modes: ["AUTO", "ON"]
#
# The current Home Assistant mqtt hvac component is not great. It lacks
# a lot of functionality offered by the thermostat. At some point I will
# submit a PR to Home Assistant to try and fix this.
# Major issues:
# - no concept of separate heat and cool set points
# - no humidity state
# - no status state
thermostat:
# Output state change topic and payload. Available variables for
# templating in all cases are:
# address = 'aa.bb.cc'
# name = 'device name'
# The following specific variables only apply to the topics listed
# directly below
# temp_c = temperature in celsius
# temp_f = temperature in farenheit
ambient_temp_topic: 'insteon/{{address}}/ambient_temp'
ambient_temp_payload: '{"temp_f" : {{temp_f}}, "temp_c" : {{temp_c}}}'
cool_sp_state_topic: 'insteon/{{address}}/cool_sp_state'
cool_sp_state_payload: '{"temp_f" : {{temp_f}}, "temp_c" : {{temp_c}}}'
heat_sp_state_topic: 'insteon/{{address}}/heat_sp_state'
heat_sp_state_payload: '{"temp_f" : {{temp_f}}, "temp_c" : {{temp_c}}}'
# fan_mode = "on", "off"
# is_fan_on = 0/1
fan_state_topic: 'insteon/{{address}}/fan_state'
fan_state_payload: '{{fan_mode.upper()}}'
# mode = 'off', 'auto', 'heat', 'cool', 'program'
mode_state_topic: 'insteon/{{address}}/mode_state'
mode_state_payload: '{{mode.upper()}}'
# humid = humidity percentage
humid_state_topic: 'insteon/{{address}}/humid_state'
humid_state_payload: '{{humid}}'
# status = "off", "heating", "cooling"
# is_heating = 0/1
# is_cooling = 0/1
status_state_topic: 'insteon/{{address}}/status_state'
status_state_payload: '{{status.upper()}}'
# Caution, there is no push update for the hold or energy state. ie, if
# you press hold on the physical device, you will not get any notice of
# this unless you run get_status(). There is also no way to programatically
# change the hold state or energy state
# hold_str = 'off', 'temp'
# is_hold = 0/1
hold_state_topic: 'insteon/{{address}}/hold_state'
hold_state_payload: '{{hold_str.upper()}}'
# See caution in hold state above
# energy_str = 'off', 'on'
# is_energy = 0/1
energy_state_topic: 'insteon/{{address}}/energ_state'
energy_state_payload: '{{energy_str.upper()}}'
# Command Topics
# Available variables for templating all of these commands are:
# address = 'aa.bb.cc'
# name = 'device name'
# value = the input payload
# json = the input payload converted to json. Use json.VAR to extract
# a variable from a json payload.
#
# Mode state command. The output of passing the payload through the
# template must match the following:
# { "cmd" : "auto"/"off"/"heat"/"cool","program" }
mode_command_topic: 'insteon/{{address}}/mode_command'
mode_command_payload: '{ "cmd" : "{{value.lower()}}" }'
# Fan state command. The output of passing the payload through the
# template must match the following:
# { "cmd" : "auto"/"on" }
fan_command_topic: 'insteon/{{address}}/fan_command'
fan_command_payload: '{ "cmd" : "{{value.lower()}}" }'
# Temp setpoint commands. The payloads should be in the form of {temp_c:
# float, temp_f: float} Only one unit needs to be present. If temp_c is
# present it will be used regardless
heat_sp_command_topic: 'insteon/{{address}}/heat_sp_command'
heat_sp_payload: '{ "temp_f" : {{value}} }'
cool_sp_command_topic: 'insteon/{{address}}/cool_sp_command'
cool_sp_payload: '{ "temp_f" : {{value}} }'
#------------------------------------------------------------------------
# Mini remotes
#------------------------------------------------------------------------
# Battery powered remotes (usually 4 or 8 buttons). A message is
# sent whenever one of the buttons is pressed.
remote:
# Output state change topic and template. This message is sent
# whenever a button is pressed. Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# button = 1...n (button number 1-4 or 1-8)
# on = 0/1
# on_str = 'off'/'on'
# mode = 'normal'/'fast'/'instant'
# fast = 0/1
# instant = 0/1
state_topic: 'insteon/{{address}}/state/{{button}}'
state_payload: '{{on_str.upper()}}'
# Manual mode (holding down a button) is triggered once when the button
# is held and once when it's released. Available variables for
# templating are address (see above), name (see above), button (see
# above), and:
# manual_str = 'up'/'off'/'down'
# manual = 1/0/-1
# manual_openhab = 2/1/0
#manual_state_topic: 'insteon/{{address}}/manual_state'
#manual_state_payload: '{{manual_str.upper()}}'
#------------------------------------------------------------------------
# Fan Linc
#------------------------------------------------------------------------
# A FanLinc is a dimmer switch (Insteon group 1) plus a fan control
# (group 2). The dimmer MQTT messages use the dimmer settings
# above. The settings here are just for the fan input and output.
# The settings can be used to turn the fan on and off (and report
# on/off state changes).
#
# NOTE: Both the fan state and fan speed state topics will be
# published on ANY fan change. So if you only need one of them, you
# can put both payloads in a single message and set the other inputs
# to blank (which will turn off the output).
#
# In Home Assistant, use the dimmer example above for the light and
# use MQTT fan with a configuration like this for the fan:
# fan:
# - platform: mqtt
# command_topic: 'insteon/aa.bb.cc/fan/set'
# state_topic: 'insteon/aa.bb.cc/fan/state'
# speed_command_topic: 'insteon/aa.bb.cc/fan/speed/set'
# speed_state_topic: 'insteon/aa.bb.cc/fan/state'
fan_linc:
# Output fan state change topic and payload. This message is sent
# whenever the fan state changes for any reason. Available
# variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# on = 0/1
# on_str = 'off'/'on'
# level = 0/1/2/3
# level_str = 'off'/'low'/'medium'/'high'
fan_state_topic: 'insteon/{{address}}/fan/state'
fan_state_payload: '{{on_str.upper()}}'
# Fan on/off command. Similar functionality to the cmd_topic
# but only for turning the device on and off. The output of
# passing the payload through the template must match the following:
# { "cmd" : "on"/"off" }
# Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# value = the input payload
# json = the input payload converted to json. Use json.VAR to extract
# a variable from a json payload.
fan_on_off_topic: 'insteon/{{address}}/fan/set'
fan_on_off_payload: '{ "cmd" : "{{value.lower()}}" }'
# Output fan speed state change topic and payload. Set to empty
# to turn off. The same templating variables are available as
# fan_state_topic agove.
fan_speed_topic: 'insteon/{{address}}/fan/speed/state'
fan_speed_payload: '{{level_str}}'
# Fan speed change command. Similar functionality to the cmd_topic
# but only for turning the device on and off. The output of
# passing the payload through the template must match the following:
# { "cmd" : SPEED }
# where
# SPEED = 0/1/2/3 (for off, low, medium, high)
# or = "off"/"low"/"medium"/"high"
# Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# value = the input payload
# json = the input payload converted to json. Use json.VAR to extract
# a variable from a json payload.
fan_speed_set_topic: 'insteon/{{address}}/fan/speed/set'
fan_speed_set_payload: '{ "cmd" : "{{value.lower}}" }'
#------------------------------------------------------------------------
# Keypad Linc
#------------------------------------------------------------------------
# A KeypadLinc is an on/off or dimmer switch (Insteon group 1) plus a
# series of scene control buttons which operate on other groups. The group
# 1 behavior will depend on whether the device is an on/off or dimmer. The
# 4 or 6 other buttons are controlled like switches - but the only affect
# is turning on and off the LED on the button since they have no directly
# attached load.
#
# 6 button and 8 button keypads have use the following button numbers:
# 1 on 1 2
# 3 4 3 4
# 5 6 5 6
# 1 off 7 8
#
# In Home Assistant, use MQTT switches to represent the on/off switches and
# the MQTT json component for a dimmer. The non-group 1 buttons are switches.
# # dimmers:
# light:
# - platform: mqtt
# schema: json
# state_topic: "insteon/aa.bb.cc/state/1"
# command_topic: "insteon/aa.bb.cc/set/1"
# brightness: true
#
# # switches:
# switch:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/state/1'
# command_topic: 'insteon/aa.bb.cc/set/1'
#
# # other buttons:
# switch:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/state/2'
# command_topic: 'insteon/aa.bb.cc/set/2'
keypad_linc:
# On/off switch state change topic and template. This message is sent
# whenever one of the on/off buttons is pressed. It will not be sent for
# button 1 if it's a dimmer. Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# button = 1-8
# on = 0/1
# on_str = 'off'/'on'
# mode = 'normal'/'fast'/'instant'
# fast = 0/1
# instant = 0/1
btn_state_topic: 'insteon/{{address}}/state/{{button}}'
btn_state_payload: '{{on_str.upper()}}'
# Dimmer output state change topic and payload for button 1. This
# message is sent whenever the device dimmer state changes for any
# reason. Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# on = 0/1
# on_str = 'off'/'on'
# level_255 = 0-255
# level_100 = 0-100
# mode = 'normal'/'fast'/'instant'
# fast = 0/1
# instant = 0/1
dimmer_state_topic: 'insteon/{{address}}/state/1'
dimmer_state_payload: >
{ "state" : "{{on_str.upper()}}", "brightness" : {{level_255}} }
# Manual mode (holding down a button) is triggered once when the button
# is held and once when it's released. Available variables for
# templating are address (see above), name (see above), and:
# manual_str = 'up'/'off'/'down'
# manual = 1/0/-1
# manual_openhab = 2/1/0
#manual_state_topic: 'insteon/{{address}}/manual_state'
#manual_state_payload: '{{manual_str.upper()}}'
# Input on/off command. For button 1, this will set the load. For other
# buttons, it just set the button LED. The output of passing the payload
# through the template must match the following:
# { "cmd" : 'on'/'off', "button": button,
# ["mode" : 'normal'/'fast'/'instant'],
# ["fast" : 1/0], ["instant" : 1/0] }
# Available variables for templating are:
# value = the input payload
# json = the input payload converted to json. Use json.VAR to extract
# a variable from a json payload.
btn_on_off_topic: 'insteon/{{address}}/set/{{button}}'
btn_on_off_payload: '{ "cmd" : "{{value.lower()}}" }'
# Input dimming on/off command for button 1. Similar functionality to
# the cmd_topic but only for turning the group 1 on and off and setting
# the level. This topic can be the same as the btn_on_off_topic in which
# case either command format is valid. The output of passing the
# payload through the template must match the following:
# { "cmd" : "on"/"off", "level" : LEVEL,
# ["mode" : 'normal'/'fast'/'instant'],
# ["fast" : 1/0], ["instant" : 1/0] }
# where:
# LEVEL = 0->255 dimmer level
# Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# value = the input payload
# json = the input payload converted to json. Use json.VAR to extract
# a variable from a json payload.
dimmer_level_topic: 'insteon/{{address}}/set/1'
# NOTE: HASS JSON switch doesn't send brightness in some cases
# when actuated so handle that here in the template code. The
# other HASS MQTT options also have this problem.
dimmer_level_payload: >
{ "cmd" : "{{json.state.lower()}}",
"level" : {% if json.brightness is defined %}
{{json.brightness}}
{% else %}
255
{% endif %} }
# Scene on/off command. This triggers the scene broadcast on the switch
# in the same way clicking the button would. The inputs are the same as
# those for the btn_on_off topic and payload.
btn_scene_topic: 'insteon/{{address}}/scene/{{button}}'
btn_scene_payload: '{ "cmd" : "{{value.lower()}}" }'
#------------------------------------------------------------------------
# IO Linc relay controllers
#------------------------------------------------------------------------
# The IOLinc is both a switch (momentary or latching on/off) and a sensor
# that can be on or off. If you configure the IOLinc to be momentary, then
# the on command will trigger it for the duration that is configured and
# the off command is ignored. If it's configured as a latching switch,
# then the on and off commands work like a normal switch. The set-flags
# command line command can be used to change the settings.
#
# NOTE: the on/off payload forces the relay to on or off so it's most
# likely NOT the way you want to use this. The scene payload is the same
# trigger the IOLinc as a responder which respects the sensors settings in
# momentary-C mode and is most likely the way you do want to use this.
#
# In Home Assistant use MQTT switch with a configuration like:
# switch:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/state'
# command_topic: 'insteon/aa.bb.cc/scene'
io_linc:
# Output state change topic and template. This message is sent whenever
# the device sensor state changes. Available variables for templating
# are:
# address = 'aa.bb.cc'
# name = 'device name'
# on = 0/1
# on_str = 'off'/'on'
state_topic: 'insteon/{{address}}/state'
state_payload: '{{on_str.upper()}}'
# Input on/off command. This forces the relay on/off and ignores the
# momentary-C sensor setting. Use this to force the relay to respond.
# If momentary mode is active, it will turn off after the delay. The
# output of passing the payload through the template must match the
# following:
# { "cmd" : 'on'/'off' }
# Available variables for templating are:
# value = the input payload
# json = the input payload converted to json. Use json.VAR to extract
# a variable from a json payload.
on_off_topic: 'insteon/{{address}}/set'
on_off_payload: '{ "cmd" : "{{value.lower()}}" }'
# Scene on/off command. This triggers the IOLinc as if it were a
# responder to a scene command and is the "correct" way to trigger the
# IOLinc relay in that it respects the momentary settings. The inputs
# are the same as those for the on_off topic and payload.
scene_topic: 'insteon/{{address}}/scene'
scene_payload: '{ "cmd" : "{{value.lower()}}" }'
#------------------------------------------------------------------------
# On/off outlets
#------------------------------------------------------------------------
# On/Off outlets. Non-dimming in wall outlet modules is two independent
# switchs (top and bottom outlet. The top outlet is button 1, the bottom
# outlet is button 2. In Home Assistant use MQTT switch with a
# configuration like:
# switch:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/state/1'
# command_topic: 'insteon/aa.bb.cc/set/1'
# switch:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/state/2'
# command_topic: 'insteon/aa.bb.cc/set/2'
outlet:
# Output state change topic and template. This message is sent
# whenever the device state changes for any reason. Available
# variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# button = 1 (top outlet) or 2 (bottom outlet)
# on = 0/1
# on_str = 'off'/'on'
# mode = 'normal'/'fast'/'instant'
# fast = 0/1
# instant = 0/1
state_topic: 'insteon/{{address}}/state/{{button}}'
state_payload: '{{on_str.upper()}}'
# Input on/off command. Similar functionality to the cmd_topic
# but only for turning the device on and off. The output of
# passing the payload through the template must match the following:
# { "cmd" : 'on'/'off', "button": button,
# ["mode" : 'normal'/'fast'/'instant'],
# ["fast" : 1/0], ["instant" : 1/0] }
# Available variables for templating are:
# value = the input payload
# json = the input payload converted to json. Use json.VAR to extract
# a variable from a json payload.
on_off_topic: 'insteon/{{address}}/set/{{button}}'
on_off_payload: '{ "cmd" : "{{value.lower()}}" }'
# Scene on/off command. This triggers the scene broadcast on the outlet
# in the same way clicking the button would. The inputs are the same as
# those for the on_off topic and payload.
scene_topic: 'insteon/{{address}}/scene/{{button}}'
scene_payload: '{ "cmd" : "{{value.lower()}}" }'
#----------------------------------------------------------------