Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function devs() {
}
function counters() {
return Object.entries(props.entry)
.filter(([k, v]) => k.startsWith('counter') && k.length > 2 && v > 0)
.filter(([k, v]) => k.startsWith('counter') && k != 'counters' && k.length > 2 && v > 0)
.map(([k, v]) => {
return {
power: v,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:transform="'translate(' + 0 + ',' + (height / 2 + 9) + ')'"
></g>
</svg>
<svg :x="0" :width="props.width + 10">
<svg :x="0" :width="props.width">
<g :transform="'translate(' + margin.left + ',' + margin.top + ')'">
<g
id="PGXAxis"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
:stack-order="globalConfig.usageStackOrder"
/>
<PgXAxis
:width="width - margin.left - margin.right"
:width="width"
:height="height - margin.top - margin.bottom"
:margin="margin"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { registry, resetHistoricData } from '@/assets/js/model'
import { globalConfig } from '@/assets/js/themeConfig'
import { shDevices } from '../smartHome/model'
import { itemNames } from './model'
import { counters } from '../counterList/model'
import { Counter, counters } from '../counterList/model'
import { chargePoints } from '../chargePointList/model'
// methods:
/* const noAutarchyCalculation = [
Expand Down Expand Up @@ -68,14 +68,28 @@ function transformRow(currentRow: RawDayGraphDataItem): GraphDataItem {
currentItem.date = currentRow.timestamp * 1000
currentItem.evuOut = 0
currentItem.evuIn = 0
currentItem.counters = 0

Object.entries(currentRow.counter).forEach(([id, values]) => {
if (values.grid) {
currentItem.evuOut += values.power_exported
currentItem.evuIn += values.power_imported
if (!gridCounters.includes(id)) {
gridCounters.push(id)
}
} else {
if (!registry.keys().includes(id)) {
registry.duplicateItem(id, counters.get(+id.slice(7))!)
//registry.items.get(id)!.showInGraph = true
}
const item : Counter = registry.items.get(id) as Counter
if (item._showInGraph) {
currentItem.counters += values.power_imported ?? 0
currentItem[id] = values.power_imported ?? 0

}
}

})
if (currentItem.evuOut == 0 && currentItem.evuIn == 0) {
// legacy mode
Expand Down Expand Up @@ -151,19 +165,20 @@ function transformRow(currentRow: RawDayGraphDataItem): GraphDataItem {
})

// Counters
currentItem.counters = 0
/* currentItem.counters = 0
Object.entries(currentRow.counter).forEach(([id, values]) => {
if (!values.grid) {
currentItem[id] = values.power_imported ?? 0
if (!registry.keys().includes(id)) {
registry.duplicateItem(id, counters.get(+id.slice(7))!)
//registry.items.get(id)!.showInGraph = true
}
if (registry.items.get(id)!.showInGraph) {
*/ //registry.items.get(id)!.showInGraph = true
/* }
const item : Counter = registry.items.get(id) as Counter
if (item._showInGraph) {
currentItem.counters += values.power_imported ?? 0
}
}
})
}) */
// Self Usage
currentItem.selfUsage = Math.max(0, currentItem.pv - currentItem.evuOut)
// House
Expand Down