Skip to content
Closed
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 @@ -39,7 +39,7 @@ const topicsToSubscribe = [
'openWB/chargepoint/#',
'openWB/vehicle/#',
'openWB/general/chargemode_config/pv_charging/#',
'openWB/optional/et/#',
'openWB/optional/ep/#',
'openWB/system/#',
'openWB/LegacySmartHome/#',
'openWB/command/' + mqttClientId() + '/#',
Expand Down Expand Up @@ -85,7 +85,7 @@ function processMqttMessage(topic: string, payload: Buffer) {
processMonthGraphMessages(topic, message)
} else if (topic.match(/^openwb\/log\/yearly\//i)) {
processYearGraphMessages(topic, message)
} else if (topic.match(/^openwb\/optional\/et\//i)) {
} else if (topic.match(/^openwb\/optional\/ep\//i)) {
processEtProviderMessages(topic, message)
} else if (topic.match(/^openwb\/system\//i)) {
processSystemMessages(topic, message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ function devs() {
}
function counters() {
return Object.entries(props.entry)
.filter(([k, v]) => k.startsWith('counter') && k != 'counters' && 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 @@ -69,7 +69,7 @@ function transformRow(currentRow: RawDayGraphDataItem): GraphDataItem {
currentItem.evuOut = 0
currentItem.evuIn = 0
currentItem.counters = 0

Object.entries(currentRow.counter).forEach(([id, values]) => {
if (values.grid) {
currentItem.evuOut += values.power_exported
Expand All @@ -82,14 +82,12 @@ function transformRow(currentRow: RawDayGraphDataItem): GraphDataItem {
registry.duplicateItem(id, counters.get(+id.slice(7))!)
//registry.items.get(id)!.showInGraph = true
}
const item : Counter = registry.items.get(id) as Counter
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 @@ -171,8 +169,8 @@ function transformRow(currentRow: RawDayGraphDataItem): GraphDataItem {
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
/* }
*/ //registry.items.get(id)!.showInGraph = true
/* }
const item : Counter = registry.items.get(id) as Counter
if (item._showInGraph) {
currentItem.counters += values.power_imported ?? 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import { etData } from './model'

export function processEtProviderMessages(topic: string, message: string) {
if (topic == 'openWB/optional/ep/configured') {
etData.active = message == 'true'
} else if (topic == 'openWB/optional/ep/flexible_tariff/provider') {
const data = JSON.parse(message)
if (data.type == null) {
etData.active = false
} else {
etData.active = true
}
etData.etProvider = data.name
if (data.configuration && data.configuration.country != null) {
globalData.country = data.configuration.country
}
Expand Down