Add RadiationDoseRate dimension#5418
Conversation
Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com> add RadiationAirDose unit Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com> add RadiationAmbientDose unit Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
There was a problem hiding this comment.
I would suggest RadiationDoseRate as that seems slightly better. And what about the default unit fo µSv/h ?
Otherwise looks good.
Could you also create a PR against the docs repo, to add this to the UoM table with default units ? Maybe better to wait and see if this gets merged.
That would also align it with |
There was a problem hiding this comment.
Pull request overview
This PR adds a new quantity dimension and default unit to openHAB Core so addons (e.g., SensorCommunity) can model radiation readings in µSv/h as a proper Number:<Dimension> item type.
Changes:
- Introduce a new
RadiationAmbientDosequantity dimension in core. - Add a corresponding derived unit (
SIEVERT_PER_HOUR) to the centralUnitsregistry. - Register
RadiationAmbientDosewith the default unit provider (i18n/unit mapping) so formatting/conversion can work out of the box.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| bundles/org.openhab.core/src/main/java/org/openhab/core/library/unit/Units.java | Adds SIEVERT_PER_HOUR unit constant for the new radiation quantity. |
| bundles/org.openhab.core/src/main/java/org/openhab/core/library/dimension/RadiationAmbientDose.java | Introduces the new Quantity interface for the dimension. |
| bundles/org.openhab.core/src/main/java/org/openhab/core/internal/i18n/I18nProviderImpl.java | Registers the default unit mapping for the new dimension. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
bundles/org.openhab.core/src/main/java/org/openhab/core/library/unit/Units.java
Outdated
Show resolved
Hide resolved
.../org.openhab.core/src/main/java/org/openhab/core/library/dimension/RadiationAmbientDose.java
Outdated
Show resolved
Hide resolved
.../org.openhab.core/src/main/java/org/openhab/core/library/dimension/RadiationAmbientDose.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
|
Thx for your valuable comments. To sum it up:
|
|
Hi @weymann, so far the addition looks good to me.
|
Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
Both done. |
SensorCommunity addon provides a radiation sensor which measures
μSv/hvalues. There's no directDimensionwhich can be referred in code /thing-types.xml. To provide this in a clean way I addedDimensionandUnitto the core component.If there's a more sophisticated name than than
RadiationAmbientDoseI'm happy to change it.When building addon code analysis fails.
I assume this check doesn't know this Dimension yet and it should be fine after integration
Tested with preliminary versions.

Conversion for different units (Sv/h, μSv/s) works seemless.