Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions config_json/se_meter_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"config": {
"fetch": 73
},
"data": [
[40188, 1, "M_C_SunSpec_DID", "uint16", "Well-known value. Uniquely identifies this as a SunSpecMODBUS Map"],
[40189, 1, "M_C_SunSpec_Length", "uint16", "Length of meter model block"],
[40190, 1, "M_AC_Current", "int16", "AC Current (sum of active phases)"],
[40191, 1, "M_AC_Current_A", "int16", "Phase A AC Current"],
[40192, 1, "M_AC_Current_B", "int16", "Phase B AC Current"],
[40193, 1, "M_AC_Current_C", "int16", "Phase C AC Current"],
[40194, 1, "M_AC_Current_SF", "int16", "AC Current Scale Factor"],
[40195, 1, "M_AC_Voltage_LN", "int16", "Line to Neutral AC Voltage (average of activephases)"],
[40196, 1, "M_AC_Voltage_AN", "int16", "Phase A to Neutral AC Voltage"],
[40197, 1, "M_AC_Voltage_BN", "int16", "Phase B to Neutral AC Voltage"],
[40198, 1, "M_AC_Voltage_CN", "int16", "Phase C to Neutral AC Voltage"],
[40199, 1, "M_AC_Voltage_LL", "int16", "Line to Line AC Voltage (average of activephases)"],
[40200, 1, "M_AC_Voltage_AB", "int16", "Phase A to Phase B AC Voltage"],
[40201, 1, "M_AC_Voltage_BC", "int16", "Phase B to Phase C AC Voltage"],
[40202, 1, "M_AC_Voltage_CA", "int16", "Phase C to Phase A AC Voltage"],
[40203, 1, "M_AC_Voltage_SF", "int16", "AC Voltage Scale Factor"],
[40204, 1, "M_AC_Freq", "int16", "AC Frequency"],
[40205, 1, "M_AC_Freq_SF", "int16", "AC Frequency Scale Factor"],
[40206, 1, "M_AC_Power", "int16", "Total Real Power (sum of active phases)"],
[40207, 1, "M_AC_Power_A", "int16", "Phase A AC Real Power"],
[40208, 1, "M_AC_Power_B", "int16", "Phase B AC Real Power"],
[40209, 1, "M_AC_Power_C", "int16", "Phase C AC Real Power"],
[40210, 1, "M_AC_Power_SF", "int16", "AC Real Power Scale Factor"],
[40211, 1, "M_AC_VA", "int16", "Total AC Apparent Power (sum of active"],
[40212, 1, "M_AC_VA_A", "int16", "Phase A AC Apparent Power"],
[40213, 1, "M_AC_VA_B", "int16", "Phase B AC Apparent Power"],
[40214, 1, "M_AC_VA_C", "int16", "Phase C AC Apparent Power"],
[40215, 1, "M_AC_VA_SF", "int16", "AC Apparent Power Scale Factor"],
[40216, 1, "M_AC_VAR", "int16", "Total AC Reactive Power (sum of active phases)"],
[40217, 1, "M_AC_VAR_A", "int16", "Phase A AC Reactive Power"],
[40218, 1, "M_AC_VAR_B", "int16", "Phase B AC Reactive Power"],
[40219, 1, "M_AC_VAR_C", "int16", "Phase C AC Reactive Power"],
[40220, 1, "M_AC_VAR_SF", "int16", "AC Reactive Power Scale Factor"],
[40221, 1, "M_AC_PF", "int16", "Average Power Factor (average of activephases)"],
[40222, 1, "M_AC_PF_A", "int16", "Phase A Power Factor"],
[40223, 1, "M_AC_PF_B", "int16", "Phase B Power Factor"],
[40224, 1, "M_AC_PF_C", "int16", "Phase C Power Factor"],
[40225, 1, "M_AC_PF_SF", "int16", "AC Power Factor Scale Factor"],
[40226, 2, "M_Exported", "uint32", "Total Exported Real Energy"],
[40228, 2, "M_Exported_A", "uint32", "Phase A Exported Real Energy"],
[40230, 2, "M_Exported_B", "uint32", "Phase B Exported Real Energy"],
[40232, 2, "M_Exported_C", "uint32", "Phase C Exported Real Energy"],
[40234, 2, "M_Imported", "uint32", "Total Imported Real Energy"],
[40236, 2, "M_Imported_A", "uint32", "Phase A Imported Real Energy"],
[40238, 2, "M_Imported_B", "uint32", "Phase B Imported Real Energy"],
[40240, 2, "M_Imported_C", "uint32", "Phase C Imported Real Energy"],
[40242, 1, "M_Energy_W_SF", "int16", "Real Energy Scale Factor"],
[40243, 2, "M_Exported_VA", "uint32", "Total Exported Apparent Energy"],
[40245, 2, "M_Exported_VA_A", "uint32", "Phase A Exported Apparent Energy"],
[40247, 2, "M_Exported_VA_B", "uint32", "Phase B Exported Apparent Energy"],
[40249, 2, "M_Exported_VA_C", "uint32", "Phase C Exported Apparent Energy"],
[40251, 2, "M_Imported_VA", "uint32", "Total Imported Apparent Energy"],
[40253, 2, "M_Imported_VA_A", "uint32", "Phase A Imported Apparent Energy"],
[40255, 2, "M_Imported_VA_B", "uint32", "Phase B Imported Apparent Energy"],
[40257, 2, "M_Imported_VA_C", "uint32", "Phase C Imported Apparent Energy"],
[40259, 1, "M_Energy_VA_SF", "int16", "Apparent Energy Scale Factor"],
[40260, 2, "M_Import_VARh_Q1", "uint32", "Quadrant 1: Total Imported Reactive Energy"],
[40262, 2, "M_Import_VARh_Q1A", "uint32", "Phase A - Quadrant 1: Imported Reactive"],
[40264, 2, "M_Import_VARh_Q1B", "uint32", "Phase B- Quadrant 1: Imported Reactive Energy"],
[40266, 2, "M_Import_VARh_Q1C", "uint32", "Phase C- Quadrant 1: Imported Reactive Energy"],
[40268, 2, "M_Import_VARh_Q2", "uint32", "Quadrant 2: Total Imported Reactive Energy"],
[40270, 2, "M_Import_VARh_Q2A", "uint32", "Phase A - Quadrant 2: Imported Reactive"],
[40272, 2, "M_Import_VARh_Q2B", "uint32", "Phase B- Quadrant 2: Imported Reactive Energy"],
[40274, 2, "M_Import_VARh_Q2C", "uint32", "Phase C- Quadrant 2: Imported Reactive Energy"],
[40276, 2, "M_Export_VARh_Q3", "uint32", "Quadrant 3: Total Exported Reactive Energy"],
[40278, 2, "M_Export_VARh_Q3A", "uint32", "Phase A - Quadrant 3: Exported ReactiveEnergy"],
[40280, 2, "M_Export_VARh_Q3B", "uint32", "Phase B- Quadrant 3: Exported Reactive Energy"],
[40282, 2, "M_Export_VARh_Q3C", "uint32", "Phase C- Quadrant 3: Exported Reactive Energy"],
[40284, 2, "M_Export_VARh_Q4", "uint32", "Quadrant 4: Total Exported Reactive Energy"],
[40286, 2, "M_Export_VARh_Q4A", "uint32", "Phase A - Quadrant 4: Exported Reactive"],
[40288, 2, "M_Export_VARh_Q4B", "uint32", "Phase B- Quadrant 4: Exported Reactive Energy"],
[40290, 2, "M_Export_VARh_Q4C", "uint32", "Phase C- Quadrant 4: Exported Reactive Energy"],
[40292, 1, "M_Energy_VAR_SF", "int16", "Reactive Energy Scale Factor"]
]
}
22 changes: 21 additions & 1 deletion se-modbus-json.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,26 @@
host: {value:"192.168.1.200"},
port: {value:"1502"},
poll: {value:"1000"},
device: {value: "se_inverter"}
device: {value: "se_inverter"},
seMeter1: {value: false}
},
inputs:0,
outputs:1,
icon: "bridge.png",
label: function() {
return this.name||"se-modbus";
},
oneditprepare: function() {
$("#node-input-device").change(function() {
var value = $("#node-input-device").val();
if (value === "se_inverter") {
$("#node-input-seMeter1").attr("disabled", false);
} else {
$("#node-input-seMeter1").prop("checked", false);
$("#node-input-seMeter1").attr("disabled", true);
}
});
$("#node-input-device").change();
}
});
</script>
Expand Down Expand Up @@ -42,6 +55,13 @@
<option value="em_300">EM 300 Power Meter</option>
</select>
</div>
<div class="form-row">
<label for="node-input-seMeter1"> </label>
<label for="node-input-seMeter1" style="width:70%">
<input type="checkbox" id="node-input-seMeter1" style="display:inline-block; width:22px; vertical-align:baseline;" autocomplete="off">
<span>Include Solar Edge Power Meter (1)</span>
</label>
</div>
</script>

<script type="text/html" data-help-name="lower-case">
Expand Down
15 changes: 15 additions & 0 deletions se-modbus-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ function ModbusScanner(){

promises.push( fetch_register(modbusClient, data.slice(start_index, stop_index)) );
}

if (config.seMeter1) {
per_item = config.seMeter1Json.config.fetch;
data = config.seMeter1Json.data;
for (let i=0; i< Math.ceil(data.length / per_item); i++){
let start_index = i * per_item;
let stop_index = ((i + 1) * per_item >= data.length ? data.length : (i + 1) * per_item);

promises.push( fetch_register(modbusClient, data.slice(start_index, stop_index)) );
}
}

Promise.all(promises).then(promise => {
node.status({fill:"green",shape:"dot",text:"connected"});
Expand Down Expand Up @@ -119,6 +130,10 @@ function device_to_config(config){
case "em_300": config.json = require('./config_json/em_300.json'); break;
}

if (config.seMeter1) {
config.seMeter1Json = require('./config_json/se_meter_1.json');
}

return config;
}

Expand Down