From 78b799dd051711f9dc58ad5d3bf197e74c2f8fbe Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 2 Aug 2021 16:22:17 +0200 Subject: [PATCH] Add cost stat ids (#9678) --- src/data/energy.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/data/energy.ts b/src/data/energy.ts index 154ba72cd5..e5d2532b37 100644 --- a/src/data/energy.ts +++ b/src/data/energy.ts @@ -208,9 +208,23 @@ const getEnergyData = async ( // grid source for (const flowFrom of source.flow_from) { statIDs.push(flowFrom.stat_energy_from); + if (flowFrom.stat_cost) { + statIDs.push(flowFrom.stat_cost); + } + const costStatId = info.cost_sensors[flowFrom.stat_energy_from]; + if (costStatId) { + statIDs.push(costStatId); + } } for (const flowTo of source.flow_to) { statIDs.push(flowTo.stat_energy_to); + if (flowTo.stat_compensation) { + statIDs.push(flowTo.stat_compensation); + } + const costStatId = info.cost_sensors[flowTo.stat_energy_to]; + if (costStatId) { + statIDs.push(costStatId); + } } }