openv / vcontrold

:fire: vcontrold Daemon for control and logging of Viessmann® type heating devices
https://github.com/openv/openv/wiki
GNU General Public License v3.0
101 stars 54 forks source link

Discussion: To do list #1

Closed l3u closed 6 years ago

l3u commented 6 years ago

Hi :-)

First of all, I would recommend that all development and communication is done in English. Viessmann heatings are not only sold in Germany, and if we speak German here, we probably alienate possible foreign developers. I think everybody willing to work on this code speaks at least a bit English.

So, here's what I think that has to be done, please tell me what you think:

Moving the documentation

All wiki pages should be moved here (from openv/openv) and translated to English.

Changing the build system

Done:-)

Reworking the sources

Formatting

I think the sources need a more uniform appearance, speaking of coding style (indentation etc.). I'd propose to stick to the kdelibs/Qt coding style, as this one is clean and easy to read and write.

I would firstly format all sources with

astyle --style=kr --add-one-line-brackets --pad-header --pad-comma --align-pointer=name --pad-oper vcontrold.c

and then do some fine tuning.

Same thing for the XML files. I would give them a nice and consistent look via

xmllint --format

and then do some fine tuning by hand.

At this point, nothing in the sources would have been changed, only the formatting.

Reworking the documentation

I would suggest to convert the manpages to something more maintainable like ReStructuredText and then compile a manpage from them when building the package. The rst tools come with such a tool by default. I'm a big fan of rst and think it's way better than the other ones around (including Markdown).

Compiling the documentation could be made conditional via cmake. If we have the tools we need, the docs are built (and probably installed). If not, then not. I am doing this exact thing (but with a HTML conversion, not man – still, it's the very same thing) already with another of my projects and it works fine.

Translation

I would translate all German messages and variable names to their English counterpart. For the very same reasons I'm writing in English here (see above).

Same for manpages, readmes etc.

Probably, one should also translate the German-English mix command names of the vito.xml file (e. g. getTempA should be getTempO etc.).

(Re-)Unify the development

We should try to collaborate with

Someone's working on the code there, and most probably, the changes are meaningful. We should all work on the "official" code here, which finally made it out of sf/svn.

speters commented 6 years ago

Concerning translations of messages und names, I suggest adhering to the "official" diction of Viessmann.

At https://gist.github.com/speters/57896313e35f4593f6efa85f793690ec I posted some "hints" on how to get some great info about datapoints/addresses, their types, names, and meanings in various languages from the Vitоѕоft demo software. These XML files are basically sql dumps for the initial setup of an ms-sql database. https://gist.github.com/speters/6b5dfc59f7d681da8ba148a2032ecf3f shows a way how to strip the ms-specific parts for importing into an sqlite db for example. It's just some rough scripts, but I think it's possible to get the point.

PS: @thelsing went a similar way: he pulled his info from the db of a live installation of the beforementioned software to create his specific xml files.

l3u commented 6 years ago

Well, then I would leave the XML names as-is for now. I always wondered where all this came from ;-)

l3u commented 6 years ago

Well, I think most of this has been already done now. Much faster than I thought :-) Closing this for now.

lolorc commented 6 years ago

@speters would care sharing more details about the datapoints/addresses and how to get them. It looks like your gist only extracts the database structure from DPDefinitions.xml

speters commented 6 years ago

@lolorc DPDefinitions.xml is a complete database dump for the MS SQL server VitoSoft is using. In one of the gists linked above there is an XSL along with instructions on how to convert it to something that can be fed into SQLite (which is sufficient for developing purposes in this case).

Vitosofts XML files are UTF16 encoded, you may have to reencode them into UTF8 to be able to work on them with the usual tools (sed, grep, ...)

For the start, just look into ecnEventTypes.xml and ecnDataPointType.xml. First is a list of addresses with their functions and data structures. The latter is a list of heating devices, their ids and a list of the addresses they support.

I was very lazy and simply coded some snippets of Python like this one:

import xmltodict
import dataset

with open("ecnEventType.xml") as fd:
    obj = xmltodict.parse(fd.read())

db = dataset.connect('sqlite:///t.db')
t = db['ecnAddresses']

for et in obj['EventTypes']['EventType']:
    et['eID'] = et.pop('ID') #sqlite is picky about ID as primary key
    t.insert(et)

Now with everything in a DB, picking data is just a matter of a simple query.

The data supplied with VitoSoft demo is huge, but I spotted some inaccuracies and voids. Maybe it is a bit outdated and Viessmann doesn't care to update the demo.

Feel free to add you findings in the openv Wiki. This is a vcontrold specific issue tracker, so I leave this closed.