From 79bdb30c1cbb44d64b0b8bb8fb56103880dd5a6d Mon Sep 17 00:00:00 2001 From: Mathieu Carbou Date: Thu, 21 Nov 2024 16:52:42 +0100 Subject: [PATCH] Update to mathieucarbou/MycilaJSY @ 12.0.0 which adds support for JSY-MK-193 --- platformio.ini | 2 +- src/init/Events.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/platformio.ini b/platformio.ini index 3453567..1302282 100644 --- a/platformio.ini +++ b/platformio.ini @@ -72,7 +72,7 @@ lib_deps = mathieucarbou/MycilaESPConnect @ 7.0.0 mathieucarbou/MycilaEasyDisplay @ 3.0.2 mathieucarbou/MycilaHADiscovery @ 6.0.1 - mathieucarbou/MycilaJSY @ 11.1.4 + mathieucarbou/MycilaJSY @ 12.0.0 mathieucarbou/MycilaLogger @ 3.2.1 mathieucarbou/MycilaMQTT @ 6.0.2 mathieucarbou/MycilaNTP @ 6.0.3 diff --git a/src/init/Events.cpp b/src/init/Events.cpp index 67145ab..2bd8c84 100644 --- a/src/init/Events.cpp +++ b/src/init/Events.cpp @@ -348,7 +348,7 @@ Mycila::Task initEventsTask("Init Events", [](void* params) { .current = jsy.data.single().current, .energy = jsy.data.single().activeEnergyImported, .energyReturned = jsy.data.single().activeEnergyReturned, - .frequency = jsy.data.frequency, + .frequency = jsy.data.single().frequency, .power = jsy.data.single().activePower, .powerFactor = jsy.data.single().powerFactor, .voltage = jsy.data.single().voltage, @@ -361,7 +361,7 @@ Mycila::Task initEventsTask("Init Events", [](void* params) { .current = jsy.data.channel2().current, .energy = jsy.data.channel2().activeEnergyImported, .energyReturned = jsy.data.channel2().activeEnergyReturned, - .frequency = jsy.data.frequency, + .frequency = jsy.data.aggregate.frequency, .power = jsy.data.channel2().activePower, .powerFactor = jsy.data.channel2().powerFactor, .voltage = jsy.data.channel2().voltage, @@ -374,7 +374,7 @@ Mycila::Task initEventsTask("Init Events", [](void* params) { .current = jsy.data.aggregate.current, .energy = jsy.data.aggregate.activeEnergyImported, .energyReturned = jsy.data.aggregate.activeEnergyReturned, - .frequency = jsy.data.frequency, + .frequency = jsy.data.aggregate.frequency, .power = jsy.data.aggregate.activePower, .powerFactor = jsy.data.aggregate.powerFactor, .voltage = jsy.data.aggregate.voltage, @@ -435,13 +435,14 @@ Mycila::Task initEventsTask("Init Events", [](void* params) { }); break; + case MYCILA_JSY_MK_193: case MYCILA_JSY_MK_194: grid.remoteMetrics().update({ .apparentPower = doc["channel2"]["apparent_power"].as(), .current = doc["channel2"]["current"].as(), .energy = doc["channel2"]["active_energy_imported"].as(), .energyReturned = doc["channel2"]["active_energy_returned"].as(), - .frequency = doc["frequency"].as(), + .frequency = doc["aggregate"]["frequency"].as(), .power = doc["channel2"]["active_power"].as(), .powerFactor = doc["channel2"]["power_factor"].as(), .voltage = doc["channel2"]["voltage"].as(), @@ -454,7 +455,7 @@ Mycila::Task initEventsTask("Init Events", [](void* params) { .current = doc["aggregate"]["current"].as(), .energy = doc["aggregate"]["active_energy_imported"].as(), .energyReturned = doc["aggregate"]["active_energy_returned"].as(), - .frequency = doc["frequency"].as(), + .frequency = doc["aggregate"]["frequency"].as(), .power = doc["aggregate"]["active_power"].as(), .powerFactor = doc["aggregate"]["power_factor"].as(), .voltage = doc["aggregate"]["voltage"].as(),