-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapfile-examples.json
131 lines (131 loc) · 3.94 KB
/
mapfile-examples.json
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
{
"discover_prefix": "iotempower",
"connection": {
"keep_alive": 60,
"client_id": "Client",
"clean_session": true,
"will_topic": "will/topic",
"will_message": "Last Will",
"will_qos": 0,
"will_retain": false,
"username": "Username",
"password": "Password"
},
"mappings": {
"topic_level": [
{
"name": "test01",
"topic_level": [
{
"name": "button1",
"type": "binary_sensor",
"subscription": {
"qos": 0
},
"mapping": {
"value": {
"mapped_topic": "test02/onboard/set",
"retain_message": false,
"mapping_template": "{% if value == \"pressed\" %}on{% else if value == \"released\" %}off{% endif %}"
}
}
}
]
},
{
"name": "test03",
"topic_level": [
{
"name": "button1",
"type": "binary_sensor",
"subscription": {
"qos": 2
},
"mapping": {
"value": {
"mapped_topic": "test02/onboard/set",
"retain_message": false,
"mapping_template": "{% if value == \"pressed\" %}on{% else if value == \"released\" %}off{% endif %}"
}
},
"topic_level": [
{
"name": "SomeOtherTopicLevel",
"type": "binary_sensor",
"mapping": {
"static,value,json": "Mappings",
"value": {
"mapped_topic": "test02/onboard/set",
"retain_message": false,
"mapping_template": "{% if value == \"pressed\" %}on{% else if value == \"released\" %}off{% endif %}"
}
}
}
]
},
{
"name": "button2",
"type": "binary_sensor",
"subscription": {
"qos": 2
},
"mapping": {
"static": {
"mapped_topic": "test02/onboard/set",
"retain_message": false,
"message_mappings": [
{
"message": "pressed",
"mapped_message": "on"
},
{
"message": "released",
"mapped_message": "off"
}
]
},
"value | comment: An array of \"value\" objects is also allowed for multi-mapping. E.g.:": [
{
"mapped_topic": "aCommandTopic",
"retain_message": false,
"mapping_template": "aStateTemplate"
},
{
"mapped_topic": "anOtherCommandTopic",
"retain_message": false,
"mapping_template": "anOtherStateTemplate"
}
],
"json | comment: An array of \"json\" objects is also allowed for multi-mapping. E.g.:": [
{
"mapped_topic": "aCommandTopic",
"retain_message": false,
"mapping_template": "aStateTemplate"
},
{
"mapped_topic": "anOtherCommandTopic",
"retain_message": false,
"mapping_template": "anOtherStateThemplate"
}
]
}
},
{
"name": "button3",
"type": "binary_sensor",
"subscription": {
"qos": 2
},
"mapping": {
"json": {
"mapped_topic": "test02/onboard/set",
"retain_message": false,
"mapping_template": "{{ json.time.start }} to {{ json.time.end + 1 }}pm"
}
}
}
]
}
]
}
}