mqtt2matter 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/README.md +8 -0
- package/dist/config/schema.d.ts +6 -6
- package/dist/engine/payload.d.ts +6 -0
- package/dist/engine/payload.js +8 -3
- package/dist/engine/payload.js.map +1 -1
- package/dist/engine/runtime.js +6 -1
- package/dist/engine/runtime.js.map +1 -1
- package/dist/engine/template.js +22 -5
- package/dist/engine/template.js.map +1 -1
- package/dist/families/fan.js +3 -1
- package/dist/families/fan.js.map +1 -1
- package/dist/families/index.d.ts +1 -0
- package/dist/families/index.js +4 -0
- package/dist/families/index.js.map +1 -1
- package/dist/families/power-source.js +5 -0
- package/dist/families/power-source.js.map +1 -1
- package/dist/families/rvc.d.ts +40 -0
- package/dist/families/rvc.js +83 -0
- package/dist/families/rvc.js.map +1 -0
- package/dist/importers/ha/generate.js +3 -0
- package/dist/importers/ha/generate.js.map +1 -1
- package/dist/importers/z2m/generate.js +7 -0
- package/dist/importers/z2m/generate.js.map +1 -1
- package/dist/model/catalog.js +6 -3
- package/dist/model/catalog.js.map +1 -1
- package/dist/model/schema.d.ts +32 -32
- package/dist/model/schema.js +7 -4
- package/dist/model/schema.js.map +1 -1
- package/dist/model/validate.js +6 -0
- package/dist/model/validate.js.map +1 -1
- package/docs/config.md +149 -20
- package/docs/importers.md +2 -2
- package/package.json +1 -1
- package/presets/mqtt-smarthome/button.json +47 -0
- package/presets/mqtt-smarthome/contact.json +37 -0
- package/presets/mqtt-smarthome/cover.json +50 -0
- package/presets/mqtt-smarthome/dimmer.json +57 -0
- package/presets/mqtt-smarthome/humidity.json +38 -0
- package/presets/mqtt-smarthome/light.json +47 -0
- package/presets/mqtt-smarthome/occupancy.json +46 -0
- package/presets/mqtt-smarthome/switch.json +47 -0
- package/presets/mqtt-smarthome/temperature.json +38 -0
- package/presets/openbeken/color-light.json +64 -0
- package/presets/openbeken/ct-light.json +51 -0
- package/presets/openbeken/dimmer.json +47 -0
- package/presets/openbeken/humidity.json +37 -0
- package/presets/openbeken/relay.json +40 -0
- package/presets/openbeken/temperature.json +41 -0
- package/presets/shelly-gen1/dimmer.json +48 -0
- package/presets/shelly-gen1/door-window.json +43 -0
- package/presets/shelly-gen1/ht.json +43 -0
- package/presets/shelly-gen1/relay-pm.json +60 -0
- package/presets/shelly-gen1/relay.json +36 -0
- package/presets/shelly-gen1/roller.json +52 -0
- package/presets/shelly-gen2/cover.json +68 -0
- package/presets/shelly-gen2/dimmer.json +61 -0
- package/presets/shelly-gen2/ht.json +47 -0
- package/presets/shelly-gen2/i4.json +82 -0
- package/presets/shelly-gen2/switch-pm.json +101 -0
- package/presets/shelly-gen2/switch.json +47 -0
- package/presets/tasmota/climate.json +52 -0
- package/presets/tasmota/color-light.json +63 -0
- package/presets/tasmota/ct-light.json +50 -0
- package/presets/tasmota/dimmer.json +45 -0
- package/presets/tasmota/relay.json +14 -3
- package/presets/tasmota/shutter.json +46 -0
- package/presets/tasmota/temperature-humidity.json +42 -0
- package/presets/tasmota/temperature.json +32 -0
- package/presets/valetudo/vacuum.json +103 -0
- package/presets/wled/dimmer.json +46 -0
- package/presets/wled/light.json +59 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "shelly-gen1/relay-pm",
|
|
3
|
+
"name": "Shelly Gen1 relay with power",
|
|
4
|
+
"description": "A metering relay (1PM, 2.5, Plug S) as a plug-in unit with an electrical sensor: the active power from shellies/<id>/relay/<channel>/power.",
|
|
5
|
+
"vendor": "Shelly",
|
|
6
|
+
"format": 1,
|
|
7
|
+
"variables": {
|
|
8
|
+
"device": {
|
|
9
|
+
"label": "Device id",
|
|
10
|
+
"description": "The device's MQTT id: <model>-<deviceid>, as in its topics shellies/<id>/… (shelly1pm-B929CC)"
|
|
11
|
+
},
|
|
12
|
+
"channel": {"label": "Channel", "description": "The relay: 0, or 1 for a Shelly 2.5's second", "default": "0"},
|
|
13
|
+
"name": {"label": "Name", "default": "Shelly relay"}
|
|
14
|
+
},
|
|
15
|
+
"device": {
|
|
16
|
+
"name": "%name%",
|
|
17
|
+
"vendor": "Shelly",
|
|
18
|
+
"availability": {"topic": "shellies/%device%/online", "online": "true", "offline": "false"},
|
|
19
|
+
"endpoints": [
|
|
20
|
+
{
|
|
21
|
+
"deviceTypes": ["OnOffPlugInUnit", "ElectricalSensor"],
|
|
22
|
+
"features": {"ElectricalPowerMeasurement": ["AlternatingCurrent"], "PowerTopology": ["NodeTopology"]},
|
|
23
|
+
"attributes": {
|
|
24
|
+
"ElectricalPowerMeasurement": {
|
|
25
|
+
"powerMode": 2,
|
|
26
|
+
"numberOfMeasurementTypes": 1,
|
|
27
|
+
"accuracy": [
|
|
28
|
+
{
|
|
29
|
+
"measurementType": 5,
|
|
30
|
+
"measured": true,
|
|
31
|
+
"minMeasuredValue": 0,
|
|
32
|
+
"maxMeasuredValue": 4000000,
|
|
33
|
+
"accuracyRanges": [{"rangeMin": 0, "rangeMax": 4000000, "fixedMax": 1000}]
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"mappings": [
|
|
39
|
+
{
|
|
40
|
+
"attribute": "OnOff.onOff",
|
|
41
|
+
"status": {
|
|
42
|
+
"topic": "shellies/%device%/relay/%channel%",
|
|
43
|
+
"map": {"on": true, "off": false, "overpower": false},
|
|
44
|
+
"get": {"topic": "shellies/%device%/command", "payload": "update"}
|
|
45
|
+
},
|
|
46
|
+
"command": {"topic": "shellies/%device%/relay/%channel%/command", "format": {"true": "on", "false": "off"}}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"attribute": "ElectricalPowerMeasurement.activePower",
|
|
50
|
+
"status": {
|
|
51
|
+
"topic": "shellies/%device%/relay/%channel%/power",
|
|
52
|
+
"type": "number",
|
|
53
|
+
"scale": {"from": [0, 1], "to": [0, 1000], "clamp": false}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "shelly-gen1/relay",
|
|
3
|
+
"name": "Shelly Gen1 relay",
|
|
4
|
+
"description": "A relay of a first-generation Shelly (1, 1PM, 2.5, Plug S, …) as a plug-in unit: shellies/<id>/relay/<channel> and …/command; availability from shellies/<id>/online.",
|
|
5
|
+
"vendor": "Shelly",
|
|
6
|
+
"format": 1,
|
|
7
|
+
"variables": {
|
|
8
|
+
"device": {
|
|
9
|
+
"label": "Device id",
|
|
10
|
+
"description": "The device's MQTT id: <model>-<deviceid>, as in its topics shellies/<id>/… (shelly1-B929CC)"
|
|
11
|
+
},
|
|
12
|
+
"channel": {"label": "Channel", "description": "The relay: 0, or 1 for a Shelly 2.5's second", "default": "0"},
|
|
13
|
+
"name": {"label": "Name", "default": "Shelly relay"}
|
|
14
|
+
},
|
|
15
|
+
"device": {
|
|
16
|
+
"name": "%name%",
|
|
17
|
+
"vendor": "Shelly",
|
|
18
|
+
"availability": {"topic": "shellies/%device%/online", "online": "true", "offline": "false"},
|
|
19
|
+
"endpoints": [
|
|
20
|
+
{
|
|
21
|
+
"deviceTypes": ["OnOffPlugInUnit"],
|
|
22
|
+
"mappings": [
|
|
23
|
+
{
|
|
24
|
+
"attribute": "OnOff.onOff",
|
|
25
|
+
"status": {
|
|
26
|
+
"topic": "shellies/%device%/relay/%channel%",
|
|
27
|
+
"map": {"on": true, "off": false, "overpower": false},
|
|
28
|
+
"get": {"topic": "shellies/%device%/command", "payload": "update"}
|
|
29
|
+
},
|
|
30
|
+
"command": {"topic": "shellies/%device%/relay/%channel%/command", "format": {"true": "on", "false": "off"}}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "shelly-gen1/roller",
|
|
3
|
+
"name": "Shelly Gen1 roller",
|
|
4
|
+
"description": "A Shelly 2.5 in roller mode as a position-aware window covering: roller/0/pos (100 = open; -1 until calibrated), roller/0/command/pos, open/close/stop on roller/0/command.",
|
|
5
|
+
"vendor": "Shelly",
|
|
6
|
+
"format": 1,
|
|
7
|
+
"variables": {
|
|
8
|
+
"device": {
|
|
9
|
+
"label": "Device id",
|
|
10
|
+
"description": "The device's MQTT id: <model>-<deviceid>, as in its topics shellies/<id>/… (shellyswitch25-B929CC)"
|
|
11
|
+
},
|
|
12
|
+
"name": {"label": "Name", "default": "Shelly roller"}
|
|
13
|
+
},
|
|
14
|
+
"device": {
|
|
15
|
+
"name": "%name%",
|
|
16
|
+
"vendor": "Shelly",
|
|
17
|
+
"availability": {"topic": "shellies/%device%/online", "online": "true", "offline": "false"},
|
|
18
|
+
"endpoints": [
|
|
19
|
+
{
|
|
20
|
+
"deviceTypes": ["WindowCovering"],
|
|
21
|
+
"mappings": [
|
|
22
|
+
{
|
|
23
|
+
"attribute": "WindowCovering.currentPositionLiftPercent100ths",
|
|
24
|
+
"status": {
|
|
25
|
+
"topic": "shellies/%device%/roller/0/pos",
|
|
26
|
+
"template": "{{ value if value | int >= 0 else '' }}",
|
|
27
|
+
"type": "number",
|
|
28
|
+
"scale": {"from": [0, 100], "to": [10000, 0]},
|
|
29
|
+
"get": {"topic": "shellies/%device%/command", "payload": "update"}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"attribute": "WindowCovering.targetPositionLiftPercent100ths",
|
|
34
|
+
"command": {"topic": "shellies/%device%/roller/0/command/pos", "template": "{{ open }}"}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"invoke": "WindowCovering.upOrOpen",
|
|
38
|
+
"command": {"topic": "shellies/%device%/roller/0/command", "payload": "open"}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"invoke": "WindowCovering.downOrClose",
|
|
42
|
+
"command": {"topic": "shellies/%device%/roller/0/command", "payload": "close"}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"invoke": "WindowCovering.stopMotion",
|
|
46
|
+
"command": {"topic": "shellies/%device%/roller/0/command", "payload": "stop"}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "shelly-gen2/cover",
|
|
3
|
+
"name": "Shelly Gen2 cover",
|
|
4
|
+
"description": "A cover (2PM in cover mode, Pro Dual Cover: cover:<channel>) as a position-aware window covering; needs a calibrated cover and Settings → MQTT → Generic status update. Commands as RPC: Cover.GoToPosition, Open, Close, Stop.",
|
|
5
|
+
"vendor": "Shelly",
|
|
6
|
+
"format": 1,
|
|
7
|
+
"variables": {
|
|
8
|
+
"prefix": {
|
|
9
|
+
"label": "MQTT prefix",
|
|
10
|
+
"description": "Settings → MQTT → MQTT prefix; by default the device id (shellyplus1pm-a8032abe54dc)"
|
|
11
|
+
},
|
|
12
|
+
"channel": {
|
|
13
|
+
"label": "Channel",
|
|
14
|
+
"description": "The cover component's id: 0, or 1 for a Pro Dual Cover's second",
|
|
15
|
+
"default": "0"
|
|
16
|
+
},
|
|
17
|
+
"name": {"label": "Name", "default": "Shelly cover"}
|
|
18
|
+
},
|
|
19
|
+
"device": {
|
|
20
|
+
"name": "%name%",
|
|
21
|
+
"vendor": "Shelly",
|
|
22
|
+
"availability": {"topic": "%prefix%/online", "online": "true", "offline": "false"},
|
|
23
|
+
"endpoints": [
|
|
24
|
+
{
|
|
25
|
+
"deviceTypes": ["WindowCovering"],
|
|
26
|
+
"mappings": [
|
|
27
|
+
{
|
|
28
|
+
"attribute": "WindowCovering.currentPositionLiftPercent100ths",
|
|
29
|
+
"status": {
|
|
30
|
+
"topic": "%prefix%/status/cover:%channel%",
|
|
31
|
+
"extract": "current_pos",
|
|
32
|
+
"scale": {"from": [0, 100], "to": [10000, 0]},
|
|
33
|
+
"get": {"topic": "%prefix%/command/cover:%channel%", "payload": "status_update"}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"attribute": "WindowCovering.targetPositionLiftPercent100ths",
|
|
38
|
+
"command": {
|
|
39
|
+
"topic": "%prefix%/rpc",
|
|
40
|
+
"template": "{\"id\":1,\"src\":\"mqtt2matter\",\"method\":\"Cover.GoToPosition\",\"params\":{\"id\":%channel%,\"pos\":{{ open }}}}"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"invoke": "WindowCovering.upOrOpen",
|
|
45
|
+
"command": {
|
|
46
|
+
"topic": "%prefix%/rpc",
|
|
47
|
+
"payload": "{\"id\":1,\"src\":\"mqtt2matter\",\"method\":\"Cover.Open\",\"params\":{\"id\":%channel%}}"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"invoke": "WindowCovering.downOrClose",
|
|
52
|
+
"command": {
|
|
53
|
+
"topic": "%prefix%/rpc",
|
|
54
|
+
"payload": "{\"id\":1,\"src\":\"mqtt2matter\",\"method\":\"Cover.Close\",\"params\":{\"id\":%channel%}}"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"invoke": "WindowCovering.stopMotion",
|
|
59
|
+
"command": {
|
|
60
|
+
"topic": "%prefix%/rpc",
|
|
61
|
+
"payload": "{\"id\":1,\"src\":\"mqtt2matter\",\"method\":\"Cover.Stop\",\"params\":{\"id\":%channel%}}"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "shelly-gen2/dimmer",
|
|
3
|
+
"name": "Shelly Gen2 dimmer",
|
|
4
|
+
"description": "A dimmer (Plus/Pro Dimmer, Dimmer Gen3: light:<channel>) as a dimmable light; needs Settings → MQTT → Generic status update. Commands as RPC (Light.Set); a level switches on.",
|
|
5
|
+
"vendor": "Shelly",
|
|
6
|
+
"format": 1,
|
|
7
|
+
"variables": {
|
|
8
|
+
"prefix": {
|
|
9
|
+
"label": "MQTT prefix",
|
|
10
|
+
"description": "Settings → MQTT → MQTT prefix; by default the device id (shellyplus1pm-a8032abe54dc)"
|
|
11
|
+
},
|
|
12
|
+
"channel": {
|
|
13
|
+
"label": "Channel",
|
|
14
|
+
"description": "The light component's id: 0, or 1 for a Pro Dimmer 2PM's second",
|
|
15
|
+
"default": "0"
|
|
16
|
+
},
|
|
17
|
+
"name": {"label": "Name", "default": "Shelly dimmer"}
|
|
18
|
+
},
|
|
19
|
+
"device": {
|
|
20
|
+
"name": "%name%",
|
|
21
|
+
"vendor": "Shelly",
|
|
22
|
+
"availability": {"topic": "%prefix%/online", "online": "true", "offline": "false"},
|
|
23
|
+
"endpoints": [
|
|
24
|
+
{
|
|
25
|
+
"deviceTypes": ["DimmableLight"],
|
|
26
|
+
"options": {"light": {"onCommandType": "brightness"}},
|
|
27
|
+
"mappings": [
|
|
28
|
+
{
|
|
29
|
+
"attribute": "OnOff.onOff",
|
|
30
|
+
"status": {
|
|
31
|
+
"topic": "%prefix%/status/light:%channel%",
|
|
32
|
+
"extract": "output",
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"get": {"topic": "%prefix%/command/light:%channel%", "payload": "status_update"}
|
|
35
|
+
},
|
|
36
|
+
"command": {
|
|
37
|
+
"topic": "%prefix%/rpc",
|
|
38
|
+
"format": {
|
|
39
|
+
"true": "{\"id\":1,\"src\":\"mqtt2matter\",\"method\":\"Light.Set\",\"params\":{\"id\":%channel%,\"on\":true}}",
|
|
40
|
+
"false": "{\"id\":1,\"src\":\"mqtt2matter\",\"method\":\"Light.Set\",\"params\":{\"id\":%channel%,\"on\":false}}"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"attribute": "LevelControl.currentLevel",
|
|
46
|
+
"status": {
|
|
47
|
+
"topic": "%prefix%/status/light:%channel%",
|
|
48
|
+
"template": "{{ value_json.brightness if value_json.brightness > 0 else '' }}",
|
|
49
|
+
"type": "number",
|
|
50
|
+
"unit": "percentLevel"
|
|
51
|
+
},
|
|
52
|
+
"command": {
|
|
53
|
+
"topic": "%prefix%/rpc",
|
|
54
|
+
"template": "{\"id\":1,\"src\":\"mqtt2matter\",\"method\":\"Light.Set\",\"params\":{\"id\":%channel%,\"on\":{{ 'true' if percent > 0 else 'false' }},\"brightness\":{{ [percent, 1] | max }}}}"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "shelly-gen2/ht",
|
|
3
|
+
"name": "Shelly Plus H&T",
|
|
4
|
+
"description": "Shelly Plus H&T / H&T Gen3: temperature with the battery, humidity as a child endpoint. Needs Settings → MQTT → Generic status update. Battery-powered: it reports when it wakes up and has no availability topic worth following (it is offline while asleep).",
|
|
5
|
+
"vendor": "Shelly",
|
|
6
|
+
"format": 1,
|
|
7
|
+
"variables": {
|
|
8
|
+
"prefix": {
|
|
9
|
+
"label": "MQTT prefix",
|
|
10
|
+
"description": "Settings → MQTT → MQTT prefix; by default the device id (shellyplus1pm-a8032abe54dc)"
|
|
11
|
+
},
|
|
12
|
+
"name": {"label": "Name", "default": "Shelly H&T"}
|
|
13
|
+
},
|
|
14
|
+
"device": {
|
|
15
|
+
"name": "%name%",
|
|
16
|
+
"vendor": "Shelly",
|
|
17
|
+
"endpoints": [
|
|
18
|
+
{
|
|
19
|
+
"deviceTypes": ["TemperatureSensor", "PowerSource"],
|
|
20
|
+
"mappings": [
|
|
21
|
+
{
|
|
22
|
+
"attribute": "TemperatureMeasurement.measuredValue",
|
|
23
|
+
"status": {"topic": "%prefix%/status/temperature:0", "extract": "tC", "unit": "celsius"}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"attribute": "PowerSource.batPercentRemaining",
|
|
27
|
+
"status": {"topic": "%prefix%/status/devicepower:0", "extract": "battery.percent", "unit": "halfPercent"}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"attribute": "PowerSource.batVoltage",
|
|
31
|
+
"status": {"topic": "%prefix%/status/devicepower:0", "extract": "battery.V", "unit": "volt"}
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "humidity",
|
|
37
|
+
"deviceTypes": ["HumiditySensor"],
|
|
38
|
+
"mappings": [
|
|
39
|
+
{
|
|
40
|
+
"attribute": "RelativeHumidityMeasurement.measuredValue",
|
|
41
|
+
"status": {"topic": "%prefix%/status/humidity:0", "extract": "rh", "unit": "percent100ths"}
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "shelly-gen2/i4",
|
|
3
|
+
"name": "Shelly Plus i4",
|
|
4
|
+
"description": "Shelly Plus i4 / i4 Gen3: the four inputs as buttons (input:0 on the device, input:1…3 as child endpoints) from the NotifyEvent notifications on <prefix>/events/rpc — single, double, triple and long push. The inputs must be of type Button; RPC notifications are on by default.",
|
|
5
|
+
"vendor": "Shelly",
|
|
6
|
+
"format": 1,
|
|
7
|
+
"variables": {
|
|
8
|
+
"prefix": {
|
|
9
|
+
"label": "MQTT prefix",
|
|
10
|
+
"description": "Settings → MQTT → MQTT prefix; by default the device id (shellyplus1pm-a8032abe54dc)"
|
|
11
|
+
},
|
|
12
|
+
"name": {"label": "Name", "default": "Shelly i4"}
|
|
13
|
+
},
|
|
14
|
+
"device": {
|
|
15
|
+
"name": "%name%",
|
|
16
|
+
"vendor": "Shelly",
|
|
17
|
+
"availability": {"topic": "%prefix%/online", "online": "true", "offline": "false"},
|
|
18
|
+
"endpoints": [
|
|
19
|
+
{
|
|
20
|
+
"deviceTypes": ["GenericSwitch"],
|
|
21
|
+
"mappings": [
|
|
22
|
+
{
|
|
23
|
+
"event": "Switch",
|
|
24
|
+
"status": {
|
|
25
|
+
"topic": "%prefix%/events/rpc",
|
|
26
|
+
"template": "{% for e in value_json.params.events | default([]) if e.component == 'input:0' %}{{ e.event }}{% endfor %}",
|
|
27
|
+
"map": {"single_push": "single", "double_push": "double", "triple_push": "triple", "long_push": "long"}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "input1",
|
|
34
|
+
"deviceTypes": ["GenericSwitch"],
|
|
35
|
+
"features": {"Descriptor": ["TagList"]},
|
|
36
|
+
"attributes": {"Descriptor": {"tagList": [{"mfgCode": null, "namespaceId": 7, "tag": 1, "label": "Input 2"}]}},
|
|
37
|
+
"mappings": [
|
|
38
|
+
{
|
|
39
|
+
"event": "Switch",
|
|
40
|
+
"status": {
|
|
41
|
+
"topic": "%prefix%/events/rpc",
|
|
42
|
+
"template": "{% for e in value_json.params.events | default([]) if e.component == 'input:1' %}{{ e.event }}{% endfor %}",
|
|
43
|
+
"map": {"single_push": "single", "double_push": "double", "triple_push": "triple", "long_push": "long"}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "input2",
|
|
50
|
+
"deviceTypes": ["GenericSwitch"],
|
|
51
|
+
"features": {"Descriptor": ["TagList"]},
|
|
52
|
+
"attributes": {"Descriptor": {"tagList": [{"mfgCode": null, "namespaceId": 7, "tag": 2, "label": "Input 3"}]}},
|
|
53
|
+
"mappings": [
|
|
54
|
+
{
|
|
55
|
+
"event": "Switch",
|
|
56
|
+
"status": {
|
|
57
|
+
"topic": "%prefix%/events/rpc",
|
|
58
|
+
"template": "{% for e in value_json.params.events | default([]) if e.component == 'input:2' %}{{ e.event }}{% endfor %}",
|
|
59
|
+
"map": {"single_push": "single", "double_push": "double", "triple_push": "triple", "long_push": "long"}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "input3",
|
|
66
|
+
"deviceTypes": ["GenericSwitch"],
|
|
67
|
+
"features": {"Descriptor": ["TagList"]},
|
|
68
|
+
"attributes": {"Descriptor": {"tagList": [{"mfgCode": null, "namespaceId": 7, "tag": 3, "label": "Input 4"}]}},
|
|
69
|
+
"mappings": [
|
|
70
|
+
{
|
|
71
|
+
"event": "Switch",
|
|
72
|
+
"status": {
|
|
73
|
+
"topic": "%prefix%/events/rpc",
|
|
74
|
+
"template": "{% for e in value_json.params.events | default([]) if e.component == 'input:3' %}{{ e.event }}{% endfor %}",
|
|
75
|
+
"map": {"single_push": "single", "double_push": "double", "triple_push": "triple", "long_push": "long"}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "shelly-gen2/switch-pm",
|
|
3
|
+
"name": "Shelly Gen2 switch with power",
|
|
4
|
+
"description": "A relay with power metering (1PM, 2PM, Plug S, Pro xPM: switch:<channel>) as a plug-in unit with an electrical sensor: active power, voltage, current. Needs Settings → MQTT → Generic status update.",
|
|
5
|
+
"vendor": "Shelly",
|
|
6
|
+
"format": 1,
|
|
7
|
+
"variables": {
|
|
8
|
+
"prefix": {
|
|
9
|
+
"label": "MQTT prefix",
|
|
10
|
+
"description": "Settings → MQTT → MQTT prefix; by default the device id (shellyplus1pm-a8032abe54dc)"
|
|
11
|
+
},
|
|
12
|
+
"channel": {
|
|
13
|
+
"label": "Channel",
|
|
14
|
+
"description": "The switch component's id: 0, or 1 for a 2PM's second relay",
|
|
15
|
+
"default": "0"
|
|
16
|
+
},
|
|
17
|
+
"name": {"label": "Name", "default": "Shelly switch"}
|
|
18
|
+
},
|
|
19
|
+
"device": {
|
|
20
|
+
"name": "%name%",
|
|
21
|
+
"vendor": "Shelly",
|
|
22
|
+
"availability": {"topic": "%prefix%/online", "online": "true", "offline": "false"},
|
|
23
|
+
"endpoints": [
|
|
24
|
+
{
|
|
25
|
+
"deviceTypes": ["OnOffPlugInUnit", "ElectricalSensor"],
|
|
26
|
+
"features": {"ElectricalPowerMeasurement": ["AlternatingCurrent"], "PowerTopology": ["NodeTopology"]},
|
|
27
|
+
"attributes": {
|
|
28
|
+
"ElectricalPowerMeasurement": {
|
|
29
|
+
"powerMode": 2,
|
|
30
|
+
"numberOfMeasurementTypes": 3,
|
|
31
|
+
"accuracy": [
|
|
32
|
+
{
|
|
33
|
+
"measurementType": 5,
|
|
34
|
+
"measured": true,
|
|
35
|
+
"minMeasuredValue": 0,
|
|
36
|
+
"maxMeasuredValue": 4000000,
|
|
37
|
+
"accuracyRanges": [{"rangeMin": 0, "rangeMax": 4000000, "fixedMax": 1000}]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"measurementType": 1,
|
|
41
|
+
"measured": true,
|
|
42
|
+
"minMeasuredValue": 0,
|
|
43
|
+
"maxMeasuredValue": 300000,
|
|
44
|
+
"accuracyRanges": [{"rangeMin": 0, "rangeMax": 300000, "fixedMax": 1000}]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"measurementType": 2,
|
|
48
|
+
"measured": true,
|
|
49
|
+
"minMeasuredValue": 0,
|
|
50
|
+
"maxMeasuredValue": 20000,
|
|
51
|
+
"accuracyRanges": [{"rangeMin": 0, "rangeMax": 20000, "fixedMax": 100}]
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"mappings": [
|
|
57
|
+
{
|
|
58
|
+
"attribute": "OnOff.onOff",
|
|
59
|
+
"status": {
|
|
60
|
+
"topic": "%prefix%/status/switch:%channel%",
|
|
61
|
+
"extract": "output",
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"get": {"topic": "%prefix%/command/switch:%channel%", "payload": "status_update"}
|
|
64
|
+
},
|
|
65
|
+
"command": {
|
|
66
|
+
"topic": "%prefix%/rpc",
|
|
67
|
+
"format": {
|
|
68
|
+
"true": "{\"id\":1,\"src\":\"mqtt2matter\",\"method\":\"Switch.Set\",\"params\":{\"id\":%channel%,\"on\":true}}",
|
|
69
|
+
"false": "{\"id\":1,\"src\":\"mqtt2matter\",\"method\":\"Switch.Set\",\"params\":{\"id\":%channel%,\"on\":false}}"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"attribute": "ElectricalPowerMeasurement.activePower",
|
|
75
|
+
"status": {
|
|
76
|
+
"topic": "%prefix%/status/switch:%channel%",
|
|
77
|
+
"extract": "apower",
|
|
78
|
+
"scale": {"from": [0, 1], "to": [0, 1000], "clamp": false}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"attribute": "ElectricalPowerMeasurement.voltage",
|
|
83
|
+
"status": {
|
|
84
|
+
"topic": "%prefix%/status/switch:%channel%",
|
|
85
|
+
"extract": "voltage",
|
|
86
|
+
"scale": {"from": [0, 1], "to": [0, 1000], "clamp": false}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"attribute": "ElectricalPowerMeasurement.activeCurrent",
|
|
91
|
+
"status": {
|
|
92
|
+
"topic": "%prefix%/status/switch:%channel%",
|
|
93
|
+
"extract": "current",
|
|
94
|
+
"scale": {"from": [0, 1], "to": [0, 1000], "clamp": false}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "shelly-gen2/switch",
|
|
3
|
+
"name": "Shelly Gen2 switch",
|
|
4
|
+
"description": "A relay of a Shelly Plus/Pro/Gen3 device (switch:<channel>) as a plug-in unit. Needs Settings → MQTT → Generic status update; commands go as RPC (Switch.Set) to <prefix>/rpc.",
|
|
5
|
+
"vendor": "Shelly",
|
|
6
|
+
"format": 1,
|
|
7
|
+
"variables": {
|
|
8
|
+
"prefix": {
|
|
9
|
+
"label": "MQTT prefix",
|
|
10
|
+
"description": "Settings → MQTT → MQTT prefix; by default the device id (shellyplus1pm-a8032abe54dc)"
|
|
11
|
+
},
|
|
12
|
+
"channel": {
|
|
13
|
+
"label": "Channel",
|
|
14
|
+
"description": "The switch component's id: 0, or 1 for a 2PM's second relay",
|
|
15
|
+
"default": "0"
|
|
16
|
+
},
|
|
17
|
+
"name": {"label": "Name", "default": "Shelly switch"}
|
|
18
|
+
},
|
|
19
|
+
"device": {
|
|
20
|
+
"name": "%name%",
|
|
21
|
+
"vendor": "Shelly",
|
|
22
|
+
"availability": {"topic": "%prefix%/online", "online": "true", "offline": "false"},
|
|
23
|
+
"endpoints": [
|
|
24
|
+
{
|
|
25
|
+
"deviceTypes": ["OnOffPlugInUnit"],
|
|
26
|
+
"mappings": [
|
|
27
|
+
{
|
|
28
|
+
"attribute": "OnOff.onOff",
|
|
29
|
+
"status": {
|
|
30
|
+
"topic": "%prefix%/status/switch:%channel%",
|
|
31
|
+
"extract": "output",
|
|
32
|
+
"type": "boolean",
|
|
33
|
+
"get": {"topic": "%prefix%/command/switch:%channel%", "payload": "status_update"}
|
|
34
|
+
},
|
|
35
|
+
"command": {
|
|
36
|
+
"topic": "%prefix%/rpc",
|
|
37
|
+
"format": {
|
|
38
|
+
"true": "{\"id\":1,\"src\":\"mqtt2matter\",\"method\":\"Switch.Set\",\"params\":{\"id\":%channel%,\"on\":true}}",
|
|
39
|
+
"false": "{\"id\":1,\"src\":\"mqtt2matter\",\"method\":\"Switch.Set\",\"params\":{\"id\":%channel%,\"on\":false}}"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "tasmota/climate",
|
|
3
|
+
"name": "Tasmota climate sensor",
|
|
4
|
+
"description": "A BME280/BME680-style sensor attached to Tasmota: temperature, humidity and pressure (hPa, PressureUnit hPa) from tele/<topic>/SENSOR; humidity and pressure as child endpoints.",
|
|
5
|
+
"vendor": "Tasmota",
|
|
6
|
+
"format": 1,
|
|
7
|
+
"variables": {
|
|
8
|
+
"topic": {"label": "Tasmota topic", "description": "The device's MQTT topic (Configuration → MQTT → Topic)"},
|
|
9
|
+
"sensor": {
|
|
10
|
+
"label": "Sensor",
|
|
11
|
+
"description": "The sensor's key in tele/<topic>/SENSOR (BME280, BME680, …)",
|
|
12
|
+
"default": "BME280"
|
|
13
|
+
},
|
|
14
|
+
"name": {"label": "Name", "default": "Climate"}
|
|
15
|
+
},
|
|
16
|
+
"device": {
|
|
17
|
+
"name": "%name%",
|
|
18
|
+
"vendor": "Tasmota",
|
|
19
|
+
"availability": {"topic": "tele/%topic%/LWT", "online": "Online", "offline": "Offline"},
|
|
20
|
+
"endpoints": [
|
|
21
|
+
{
|
|
22
|
+
"deviceTypes": ["TemperatureSensor"],
|
|
23
|
+
"mappings": [
|
|
24
|
+
{
|
|
25
|
+
"attribute": "TemperatureMeasurement.measuredValue",
|
|
26
|
+
"status": {"topic": "tele/%topic%/SENSOR", "extract": "$.%sensor%.Temperature", "unit": "celsius"}
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "humidity",
|
|
32
|
+
"deviceTypes": ["HumiditySensor"],
|
|
33
|
+
"mappings": [
|
|
34
|
+
{
|
|
35
|
+
"attribute": "RelativeHumidityMeasurement.measuredValue",
|
|
36
|
+
"status": {"topic": "tele/%topic%/SENSOR", "extract": "$.%sensor%.Humidity", "unit": "percent100ths"}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "pressure",
|
|
42
|
+
"deviceTypes": ["PressureSensor"],
|
|
43
|
+
"mappings": [
|
|
44
|
+
{
|
|
45
|
+
"attribute": "PressureMeasurement.measuredValue",
|
|
46
|
+
"status": {"topic": "tele/%topic%/SENSOR", "extract": "$.%sensor%.Pressure"}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|