Skip to content

added SALZBURGNETZ supplier #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ A template file `meter_template.json` can be recycled for this.

The AES key format is "hex string", e.g. `a4f2d...`

Please provide your electricity supplier by the field "supplier". Because each supplier uses its own security standard,
the telegrams differ. This script was tested with suppliers:
Please provide your electricity supplier by the field "supplier". Because each supplier may use its own security standard,
the telegrams may differ. This script was tested with suppliers:
- TINETZ
- SALZBURGNETZ
- EVN


Expand Down
2 changes: 1 addition & 1 deletion dpkg/build_pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ if [ $? -ne 0 ]; then
exit 1
fi

cd ..
cd ..
17 changes: 12 additions & 5 deletions kaifareader.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,19 @@ class Supplier:
ic_start_byte = None
enc_data_start_byte = None


class SupplierTINETZ(Supplier):
name = "TINETZ"
frame2_start_bytes_hex = '68727268'
frame2_start_bytes = b'\x68\x72\x72\x68' # 68 72 72 68
ic_start_byte = 23
enc_data_start_byte = 27

class SupplierSALZBURGNETZ(Supplier):
name = "SALZBURGNETZ"
frame2_start_bytes_hex = '68727268'
frame2_start_bytes = b'\x68\x72\x72\x68' # 68 72 72 68
ic_start_byte = 23
enc_data_start_byte = 27

class SupplierEVN(Supplier):
name = "EVN"
Expand All @@ -78,7 +83,6 @@ class SupplierEVN(Supplier):
ic_start_byte = 22
enc_data_start_byte = 26


class Constants:
config_file = "/etc/kaifareader/meter.json"
export_format_solarview = "SOLARVIEW"
Expand Down Expand Up @@ -332,12 +336,15 @@ def get_act_energy_neg_kwh(self):
bytesize = g_cfg.get_bytesize(),
timeout = g_cfg.get_interval())

if g_cfg.get_supplier().upper() == SupplierTINETZ.name:
supplierName = g_cfg.get_supplier().upper()
if supplierName == SupplierTINETZ.name:
g_supplier = SupplierTINETZ()
elif g_cfg.get_supplier().upper() == SupplierEVN.name:
elif supplierName == SupplierSALZBURGNETZ.name:
g_supplier = SupplierSALZBURGNETZ()
elif supplierName == SupplierEVN.name:
g_supplier = SupplierEVN()
else:
raise Exception("Supplier not supported: {}".format(g_cfg.get_supplier()))
raise Exception("Supplier not supported: {}".format(supplierName))

# main task endless loop
while True:
Expand Down