Issue with storage quanity data (with units) in MongoDB

Hello openHab Community,

I hope this message finds you well. I am a newcomer to the openhab community and have recently started using tools for home automation. While exploring the tool, I identified an issue related to the persistence mechanism with MongoDB.

Issue Description:

The problem I encountered is related to the way data is stored in MongoDB when it comes to values and units.

E.g. configuration

Number:Temperature      supplyTemperature                                                             <temperature>    (gTemperature, gAir)       ["Point","Temperature"]    {channel="modbus:data:localhostTCP:temperature:supplyTemperature:number"}

Then value stored in mongodb is:
7.3 °C

Should be:
7.3

Proposed Solution: To address this issue, I have created a PR that modifies the persistence mechanism to store only the value in the designated field, separate from the unit. This proposed change aims to equalize structure with other persistance service e.g. jdbc.

My Status as a Contributor: I want to emphasize that I am relatively new to open-source contributions, and this is one of my initial attempts to contribute to the community. Therefore, I would greatly appreciate your guidance and feedback throughout the process to ensure that my contribution aligns with the project’s standards and goals.

PR Link: [mongodb]: fix quantity type storage, introduce new types by konradzawadka · Pull Request #15617 · openhab/openhab-addons · GitHub

I am eager to collaborate with the community and learn from experienced contributors. Your input and suggestions will not only help resolve this issue but also assist me in becoming a more effective contributor to open-source projects.

Thank you for your time and consideration. I look forward to working together with the community to improve this valuable tool for home automation.

Best regards,

1 Like