Hi all,
at some point I confused myself with the content of things and items files.
So: I wanted only one place to edit - and press a button to create the two files for OH2.
I created the attached Excel-Worksheet that offers some macros.
The fie contains some example data to make the understanding easier and to play immediately with the macro.
The example data is just a brute force reduction of my installation …
There are Macros for the creation of the two files and a simple check, if GA are already used.
Core principle:
- To define a switch etc. only one line needs to be created in the Excel
- The Thing definition and connection of Items to the device in the Things is all taken care of by the macro
- After opening the Excel, the menu will be extended by “Add-Ins” and the “KNX-Editor”
- Do the editing in the Things+Items, Go into Menu: “Add-Ins” to run the macro for creation of the file(s).
- The output can be written into the files. Te content is also available on the clipboard for a manual paste.
Structure of “Things+Items”
- While processing the sheet, each line is used for either Thing or Item or both
- Text, only to be put into the Thing file, comes in Col B, similar for the Item file in Col C
- A typical header of a ‘Thing device … {’ is put in Col B and closes later with ‘}’
- The type of each element is written in Col B or C
- Thing is created from Col D + F + G plus the K
- Item is created from Col E + F + G + H + I + J + the device created from last Thing plus the Name of item
- The name of the device (needed for the item to connect) is expected in the “Thing device …” context
Some specials:
- Place “File=” in any B or C Col to allow automatic storage of the content into the files when the macro is running
- All results are also on the clipboard … if you don not want to allow any overwriting by the macro just paste it manually
- A comment can be placed into Col B or C to be placed into Things or Items. If a comment shall be visible in both files, put a “…” in Col B and place the comment in C
- Group definitions can be placed in Col C
- Group reference and Icon definition for the item in H and I
- To allow Homekit support, I created a dropdown list per line to be selected in J
- To make the files look nice … the length of names etc are determined in advance, to align the text
- To ignore a line, say yes in Col A
- The channel parameter allows also incomplete text like “<11/7/0” and makes it complaint
- “Check for Double GA” : The Col K is scanned for duplicate naming of address. Everything that is double, is marked red.
This might be on purpose - but it helped my to find a unwanted redefinition
Download at: https://1drv.ms/x/s!AkXhwKpZ5CVoj6AC8FaUe4Dbwr7ZGg?e=iL3Yq1
You must store locally, start Excel and allow to run Macros!
You might need to enable the “Add-Ins Menu entry” → Rightclick on the menubar → Adjust… (Menüband anpassen) → Enable “Add-Ins”
This software comes with no guarantee … protect your *.items and *.things before running this !!
This is a hack - but I helped me to get a clean items and things file
Enjoy !
Michael