sermatec-opensource/sermatec-inverter

Create protocol.json parser

andreondra opened this issue · 3 comments

This new class will be able to load all the information from the protocol.json.

We can get the inverter's software version (command 98, which is available on every inverter's SW version) and then decide which commands will be available in the script for the particular version. There are version keys in the recent protocol.json files, so I suppose they were added for a backward compatibility with non-updated inverters.

This can probably be a separate PyPI module to provide an independent parsing library. not now

Expected features:

  • if no tag is provided in the protocol, we should create the tag from the name,
  • load error code from relevant files and replace the codes with strings

Parser will be moved to separate project and used as a PyPI module: https://github.com/sermatec-opensource/osim-parser

Note: the parser should handle all the protocol-related processing - generating requests, parsing replies.

Parser should output data in a following format: {'tag':{value, 'unit'}, ...}

In "op 2" commands, there is a "checkCommand" key that contains a command code that can be used to check if the value was correctly set - the value to look for is identified by a "tag" key.