Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Model 64020] Json swaps ProbeTmp and MainTmp fields compared to XML #240

Open
nielsbasjes opened this issue Dec 31, 2022 · 3 comments
Open

Comments

@nielsbasjes
Copy link
Contributor

The smdx_64020.xml (Mersen GreenString) XML says (note the ordering of the fields and the offsets):

      <point id="ProbeTmp" offset="6" type="int16" units="C" mandatory="true" />
      <point id="MainTmp" offset="5" type="int16" units="C" mandatory="true" />

and the json says:

            {
                "label": "Probe Temperature",
                "mandatory": "M",
                "name": "ProbeTmp",
                "size": 1,
                "type": "int16",
                "units": "C"
            },
            {
                "label": "Main Temperature",
                "mandatory": "M",
                "name": "MainTmp",
                "size": 1,
                "type": "int16",
                "units": "C"
            },

Because in the Json variant the offsets are implicitly calculated from the ordering (without and explicit offset field) this effectively means these two fields have been swapped in the migration from XML to json.

@nielsbasjes
Copy link
Contributor Author

@shelcrow / @bobfox : Which is correct? The json or the xml?

@bobfox
Copy link
Contributor

bobfox commented Jan 5, 2023

I think there are a couple of issues here.

I think some tools did not use the offset attribute as it was somewhat redundant if there are no gaps between points in the model definitions. I suspect if you read that model with pysunspec2 using the SMDX model definition, it would order it based on the point order not the offset attribute.

This is a vendor defined model that is published by SunSpec but controlled by the manufacturer. SunSpec converted these models to the json encoding for convenience but you could argue that is not ideal as SunSpec does not control the model definition. Also, I don't believe this model definition is actually being used by anyone but am not sure.

Ideally, it would be good to work through the manufacturer to clarify the correct solution but I suspect that may be difficult.

@nielsbasjes
Copy link
Contributor Author

I did some googling and your assessment of "may be difficult" seems very correct.

I have found only very small number of sites mentioning "Mersen Greenstring" which show a device, but that was not on any mersen related website.

The websites https://www.mersen.com/ and https://ep-us.mersen.com/ both return 0 results on terms like greenstring, sunspec and even modbus.
Searching for helioprotection results in some entries but nothing to do with monitoring (mostly fuses).

So I conclude it is a device that was for sale in 2016 and right now they have wiped all references to it.

So at this point it seems you're correct in that no one is actually using it.

Given your remark about pysunspec2 I propose to simply swap the offset values in the (deprecated) XML. This makes both "the same" (which may be wrong) and changes nothing for any existing users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants