|
Bogdan Timofte
authored
2 weeks ago
|
1
|
<script type="text/x-red" data-template-name="z2m-smart-socket-homebus">
|
|
|
2
|
<div class="form-row">
|
|
|
3
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
|
4
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
|
5
|
</div>
|
|
|
6
|
<div class="form-row">
|
|
|
7
|
<label for="node-input-site"><i class="fa fa-globe"></i> Site</label>
|
|
|
8
|
<input type="text" id="node-input-site" placeholder="vad">
|
|
|
9
|
</div>
|
|
|
10
|
</script>
|
|
|
11
|
|
|
|
12
|
<script type="text/x-red" data-help-name="z2m-smart-socket-homebus">
|
|
|
13
|
<p>
|
|
|
14
|
Translates Zigbee2MQTT smart socket telemetry for <code>A1Z</code> and <code>S60ZBTPF</code> into canonical HomeBus control topics.
|
|
|
15
|
</p>
|
|
|
16
|
<p>
|
|
|
17
|
The adapter standardizes both models to the same HomeBus capability set, with <code>state</code> mapped to
|
|
|
18
|
<code><site>/home/<location>/power/<device_id>/...</code>.
|
|
|
19
|
</p>
|
|
|
20
|
<p>
|
|
|
21
|
Supported canonical projections:
|
|
|
22
|
<code>power</code>,
|
|
|
23
|
<code>power_restore_mode</code>,
|
|
|
24
|
<code>countdown</code>,
|
|
|
25
|
<code>lock</code>,
|
|
|
26
|
<code>indicator_mode</code>,
|
|
|
27
|
<code>button_mode</code>,
|
|
|
28
|
<code>protection_enabled</code>.
|
|
|
29
|
</p>
|
|
|
30
|
<h3>Inputs</h3>
|
|
|
31
|
<p>
|
|
|
32
|
Raw Zigbee2MQTT telemetry:
|
|
|
33
|
<code>zigbee2mqtt/A1Z/<site>/<location>/<device_id></code> or
|
|
|
34
|
<code>zigbee2mqtt/S60ZBTPF/<site>/<location>/<device_id></code>
|
|
|
35
|
</p>
|
|
|
36
|
<p>
|
|
|
37
|
Raw availability is also supported on the sibling <code>/availability</code> topic.
|
|
|
38
|
</p>
|
|
|
39
|
<p>
|
|
|
40
|
Canonical HomeBus power commands are accepted on:
|
|
|
41
|
<code><site>/home/<location>/power/<device_id>/set</code>
|
|
|
42
|
with payload <code>true</code>, <code>false</code>, <code>on</code>, <code>off</code>, or <code>toggle</code>.
|
|
|
43
|
</p>
|
|
|
44
|
<h3>Outputs</h3>
|
|
|
45
|
<ol>
|
|
|
46
|
<li>MQTT-ready HomeBus and <code>sys</code> publish messages.</li>
|
|
|
47
|
<li>MQTT-ready Zigbee2MQTT raw command publishes, for example <code>zigbee2mqtt/A1Z/vad/kitchen/coffee/set</code>.</li>
|
|
|
48
|
<li>Dynamic <code>mqtt in</code> control messages that subscribe to <code>zigbee2mqtt/A1Z/#</code> and <code>zigbee2mqtt/S60ZBTPF/#</code>.</li>
|
|
|
49
|
</ol>
|
|
|
50
|
</script>
|
|
|
51
|
|
|
|
52
|
<script>
|
|
|
53
|
RED.nodes.registerType("z2m-smart-socket-homebus", {
|
|
|
54
|
category: "myNodes",
|
|
|
55
|
color: "#d9ecfb",
|
|
|
56
|
defaults: {
|
|
|
57
|
name: { value: "" },
|
|
|
58
|
site: { value: "unknown" },
|
|
|
59
|
mqttSite: { value: "" },
|
|
|
60
|
mqttBus: { value: "" },
|
|
|
61
|
mqttRoom: { value: "" },
|
|
|
62
|
mqttSensor: { value: "" }
|
|
|
63
|
},
|
|
|
64
|
inputs: 1,
|
|
|
65
|
outputs: 3,
|
|
|
66
|
icon: "font-awesome/fa-plug",
|
|
|
67
|
label: function() {
|
|
|
68
|
return this.name || "z2m-smart-socket-homebus";
|
|
|
69
|
},
|
|
|
70
|
paletteLabel: "smart socket homebus"
|
|
|
71
|
});
|
|
|
72
|
</script>
|