Created
May 8, 2019 19:27
-
-
Save Bouni/b7a77c2d1f84e1f7c3442ab9a396319d to your computer and use it in GitHub Desktop.
Export KNX Adresses from Loxone project
This file contains hidden or 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
#!/usr/bin/env python | |
import sys | |
import re | |
if len(sys.argv) != 2: | |
print("please pass .loxone file as argument") | |
sys.exit(1) | |
with open(sys.argv[1]) as lox, open("export.txt","w") as ex: | |
data = lox.read() | |
res = re.findall(r"Title=\"([\w\s\d\.]+)\".*EibAddr=\"(\d+.\d+.\d+):?\d?\"", data) | |
for r in res: | |
ex.write(f"{r[0]:<50}{r[1]}\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't ask why but I needed to know all the KNX addresses used in my Loxone project :-)