-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path_devices.example.yml
132 lines (125 loc) · 4.38 KB
/
_devices.example.yml
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
---
# Look for actual scenarios at the end without comments
# Complete example of complex device setup with multiple subscriptions and commands
Living Room Light:
# device name - make sure it is exactly the same as in smartthings
subscribe:
# topic details to which smartthings will be subscribed
# (topic, payload) from MQTT will be transformed to (device, attribute, payload*) to smartthings
switch:
# REQUIRED: mapped to an actual attribute of device [e.g. switch, contact or any custom attribute
# this attribute is specified in the capability map section of the mbs-smartapp
# an attribute is required for each topic subbscription
smartthings/stat/sonoff-1/POWER:
# OPTIONAL: subscribe to this topic, for tasmota you really need it to get status updates for third party on/off
command:
# OPTIONAL: Translate payload coming from MQTT to this new payload* send to smartthings
# For e.g. here OFF command published from MQTT will be sent as off (lowercase) to smartthings
# if not set payload from MQTT is sent as is
'OFF': 'off'
'ON': 'on'
smartthings/stat/sonoff-1/STATUS:
# You can subscribe to as many topics
smartthings/stat/sonoff-1/STATUS2:
smartthings/stat/sonoff-1/STATUS5:
smartthings/stat/sonoff-1/STATUS11:
publish:
# OPTIONAL: commands (device, attribute, payload) from smartthings is send to MQTT as (topic, payload*)
switch:
#REQUIRED: attribute specified in the capability map section of the mbs-smartapp
smartthings/cmnd/sonoff-1/POWER:
# REQUIRED: topic to be published to MQTT
command:
# REQUIRED: transforming payload from smartthings to the one sent to MQTT and physical device
'off': 'OFF'
'on': 'ON'
update:
smartthings/cmnd/sonoff-1/Backlog:
command:
# tasmota specific example of using Backlog to send multiple simultaneous commands to physical device
refresh: Status; Status 2; Status 5; Status 11
retain: 'false'
# false set as default and here
#
#most simple tasmota switch using Smartthings Virtual Switch device Type
Living Room Light:
subscribe:
switch:
smartthings/stat/sonoff1/POWER:
command:
'OFF': 'off'
'ON': 'on'
publish:
switch:
smartthings/cmnd/sonoff1/POWER:
retain: 'false'
#
# example of RF Switch handled by Tasmota RF Bridge using Smartthings Virtual Switch device Type
# run this rule on the RFBridge to get command 'rfsensor' for any RFReceived event
#rule1 on rfreceived#data do publish rfbridge/%value% rfsensor endon
Living Room Light:
subscribe:
switch:
rfbridge/555ABC:
command:
'rfsensor': 'on'
rfbridge/555ADC:
command:
'rfsensor': 'off'
publish:
switch:
cmnd/rfbridge/Backlog:
command:
'on': 'RfSync 2390; RfLow 410; RfHigh 780; RfCode #555ABC'
'off': 'RfSync 2390; RfLow 2410; RfHigh 780; RfCode #555ADC'
retain: 'false'
#
# RF Contact Sensor handled by Tasmota RF Bridge using Smartthings Simulated Contact Sensor device Type
Mailbox:
subscribe:
contact:
rfbridge/53620A:
command:
'rfsensor': 'open'
rfbridge/53620E:
command:
'rfsensor': 'closed'
#
#Complete example of Sonoff module running Tasmota using my custom Tasmota SwitchSensor Device Type
Living Room Light:
subscribe:
switch:
smartthings/stat/sonoff-1/POWER:
command:
'OFF': 'off'
'ON': 'on'
update:
smartthings/tele/sonoff-1/LWT:
smartthings/stat/sonoff-1/STATUS:
smartthings/stat/sonoff-1/STATUS2:
smartthings/stat/sonoff-1/STATUS5:
smartthings/stat/sonoff-1/STATUS11:
publish:
switch:
smartthings/cmnd/sonoff-1/POWER:
command:
'off': 'OFF'
'on': 'ON'
update:
smartthings/cmnd/sonoff-1/Backlog:
command:
refresh: Status; Status 2; Status 5; Status 11
retain: 'false'
#
# Completely custom device using MQTT and custom device type
#Electricity Meter
Electricity Meter:
subscribe:
mqttmsg:
smartthings/emu2/mqttmsg:
demand:
smartthings/emu2/demand:
publish:
mqttmsg:
smartthings/emu2/msghandler:
retain: 'true'