sermatec-opensource / sermatec-inverter

LAN communication docs and scripts for the Sermatec solar inverter.
MIT License
4 stars 2 forks source link

Create protocol.json parser #24

Closed andreondra closed 8 months ago

andreondra commented 1 year ago

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:

andreondra commented 1 year ago

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.

andreondra commented 1 year ago

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

andreondra commented 1 year ago

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.