-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sml2 plugin: fix webinterface missing item column
- Loading branch information
Showing
5 changed files
with
213 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab | ||
######################################################################### | ||
# Copyright 2012-2014 Oliver Hinckel [email protected] | ||
# Copyright 2018-2021 [email protected] | ||
# Copyright 2018-2023 [email protected] | ||
# Copyright 2022-2022 Julian Scholle [email protected] | ||
######################################################################### | ||
# | ||
|
@@ -35,6 +35,7 @@ | |
import traceback | ||
from smllib import SmlStreamReader | ||
from smllib import const as smlConst | ||
from .const import FURTHER_OBIS_NAMES | ||
|
||
from lib.module import Modules | ||
from lib.item import Items | ||
|
@@ -95,7 +96,7 @@ def connection_lost(self, exc): | |
self.smlx.logger.error("Connection so serial device was closed") | ||
self.smlx.connected = False | ||
|
||
PLUGIN_VERSION = '2.0.0' | ||
PLUGIN_VERSION = '2.0.1' | ||
|
||
def __init__(self, sh): | ||
""" | ||
|
@@ -135,6 +136,8 @@ def __init__(self, sh): | |
self.init_webinterface(WebInterface) | ||
self.task = None | ||
self.values = {} | ||
self.obis_names = { **smlConst.OBIS_NAMES, **FURTHER_OBIS_NAMES } | ||
self.obis_units = smlConst.UNITS | ||
|
||
def run(self): | ||
""" | ||
|
@@ -339,8 +342,8 @@ def parse_data(self): | |
obis_code = sml_entry.obis.obis_code | ||
if obis_code not in self.values: | ||
self.values[obis_code] = dict() | ||
self.values[obis_code]['name'] = smlConst.OBIS_NAMES.get(sml_entry.obis) | ||
self.values[obis_code]['unit'] = smlConst.UNITS.get(sml_entry.unit) | ||
self.values[obis_code]['name'] = self.obis_names.get(sml_entry.obis) | ||
self.values[obis_code]['unit'] = self.obis_units.get(sml_entry.unit) | ||
if obis_code in self._items: | ||
if 'valueReal' in self._items[obis_code]: | ||
for item in self._items[obis_code]['valueReal']: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env python3 | ||
|
||
FURTHER_OBIS_NAMES = { | ||
'010000020000': 'Firmware Version, Firmware Prüfsumme CRC, Datum', | ||
'0100010800ff': 'Bezug Zählerstand Total', | ||
'0100010801ff': 'Bezug Zählerstand Tarif 1', | ||
'0100010802ff': 'Bezug Zählerstand Tarif 2', | ||
'0100011100ff': 'Total-Zählerstand', | ||
'0100020800ff': 'Einspeisung Zählerstand Total', | ||
'0100020801ff': 'Einspeisung Zählerstand Tarif 1', | ||
'0100020802ff': 'Einspeisung Zählerstand Tarif 2', | ||
'0100600100ff': 'Server-ID', | ||
'010060320101': 'Hersteller-Identifikation', | ||
'0100605a0201': 'Prüfsumme', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.