|
Bogdan Timofte
authored
2 weeks ago
|
1
|
<script type="text/x-red" data-template-name="z2m-smart-socket-energy">
|
|
|
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
|
<div class="form-row">
|
|
|
11
|
<label for="node-input-entityType">Entity type</label>
|
|
|
12
|
<select id="node-input-entityType">
|
|
|
13
|
<option value="load">Load</option>
|
|
|
14
|
<option value="source">Source</option>
|
|
|
15
|
<option value="storage">Storage</option>
|
|
|
16
|
<option value="grid">Grid</option>
|
|
|
17
|
<option value="transfer">Transfer</option>
|
|
|
18
|
</select>
|
|
|
19
|
</div>
|
|
|
20
|
</script>
|
|
|
21
|
|
|
|
22
|
<script type="text/x-red" data-help-name="z2m-smart-socket-energy">
|
|
|
23
|
<p>
|
|
|
24
|
Projects <code>A1Z</code> and <code>S60ZBTPF</code> smart socket measurements onto the canonical Energy Bus.
|
|
|
25
|
</p>
|
|
|
26
|
<p>
|
|
|
27
|
Canonical topic shape:
|
|
|
28
|
<code><site>/energy/<entity_type>/<entity_id>/<metric>/<stream></code>
|
|
|
29
|
</p>
|
|
|
30
|
<p>
|
|
|
31
|
Standardized metrics:
|
|
|
32
|
<code>active_power</code>,
|
|
|
33
|
<code>energy_total</code>,
|
|
|
34
|
<code>voltage</code>,
|
|
|
35
|
<code>current</code>,
|
|
|
36
|
plus <code>energy_today</code>, <code>energy_yesterday</code>, and <code>energy_month</code> for <code>S60ZBTPF</code>.
|
|
|
37
|
</p>
|
|
|
38
|
<h3>Inputs</h3>
|
|
|
39
|
<p>
|
|
|
40
|
Raw Zigbee2MQTT telemetry:
|
|
|
41
|
<code>zigbee2mqtt/A1Z/<site>/<location>/<device_id></code> or
|
|
|
42
|
<code>zigbee2mqtt/S60ZBTPF/<site>/<location>/<device_id></code>,
|
|
|
43
|
plus optional sibling <code>/availability</code>.
|
|
|
44
|
</p>
|
|
|
45
|
<h3>Outputs</h3>
|
|
|
46
|
<ol>
|
|
|
47
|
<li>MQTT-ready Energy Bus and <code>sys</code> publish messages.</li>
|
|
|
48
|
<li>Dynamic <code>mqtt in</code> control messages that subscribe to both supported raw Zigbee2MQTT model trees.</li>
|
|
|
49
|
</ol>
|
|
|
50
|
</script>
|
|
|
51
|
|
|
|
52
|
<script>
|
|
|
53
|
RED.nodes.registerType("z2m-smart-socket-energy", {
|
|
|
54
|
category: "myNodes",
|
|
|
55
|
color: "#fce3cf",
|
|
|
56
|
defaults: {
|
|
|
57
|
name: { value: "" },
|
|
|
58
|
site: { value: "unknown" },
|
|
|
59
|
entityType: { value: "load" },
|
|
|
60
|
mqttSite: { value: "" },
|
|
|
61
|
mqttBus: { value: "" },
|
|
|
62
|
mqttRoom: { value: "" },
|
|
|
63
|
mqttSensor: { value: "" }
|
|
|
64
|
},
|
|
|
65
|
inputs: 1,
|
|
|
66
|
outputs: 2,
|
|
|
67
|
icon: "font-awesome/fa-bolt",
|
|
|
68
|
label: function() {
|
|
|
69
|
return this.name || "z2m-smart-socket-energy";
|
|
|
70
|
},
|
|
|
71
|
paletteLabel: "smart socket energy"
|
|
|
72
|
});
|
|
|
73
|
</script>
|