Corretto il percorso del messaggio SignalK per il BMS e semplificato il nome del campo SOC

This commit is contained in:
Giuseppe Raffa
2026-05-13 13:16:27 +02:00
parent cc006a8791
commit bd03d3ac9a

View File

@@ -32,7 +32,7 @@ module.exports = function (app) {
let opts = null;
const timers = new Set();
const sk = (path, value) => ({ path: `electrical.batteries.${opts.batteryId}.${path}`, value });
const sk = (path, value) => ({ path: `meb.battery.${opts.batteryId}.${path}`, value });
const sendDelta = values => values && values.length && app.handleMessage(plugin.id, { updates: [{ values }] });
const safe = async (label, fn) => {
@@ -47,7 +47,7 @@ module.exports = function (app) {
sendDelta([
sk('voltage', s.total_voltage),
sk('current', s.current), // SignalK: + = uscita (scarica), come Daly
sk('capacity.stateOfCharge', s.soc_percent / 100)
sk('soc', s.soc_percent / 100)
]);
}