I’ve just kept it as Bq/m³ because all I really care about is the relative levels and whether it’s at a level I need to worry about (since installing the remediation I’ve been green).
Since pCi/L isn’t supported by the upstream library that provides UoM support, if you want to convert it you will have to do the following:
Redefine the Item as Number
Create a SCRIPT transformation to convert the received Bq/m³ to pCi/L
Apply that transformation as a transform Profile on the link between the Thing and the Item.
I don’t think it will cause a problem if you set the State Description Pattern on the Item to %.1f pCi/L but be aware that this Item will not actually carry any units at all. It’ll just be a naked number.
Create a Number Item to act as the proxy for the reading
Create a rule that triggers when the reading changes and divides the reported Bq/m³ by 0.972 and updates the Item created in 1 with that value.
Do the same as 4 above.
The first approach is a little cleaner.
Here’s the default list item widget I use for the radon readings:
- description: Widget title
- context: item
description: Item to display
timestamp: Aug 26, 2022, 9:43:08 AM
iconColor: '=(Number.parseInt(items[props.item].state) >= 148) ? "red" : (Number.parseInt(items[props.item].state) >= 99.9) ? "orange" : (Number.parseInt(items[props.item].state) >= 51.8) ? "yellow" : "green"'
The icon changes colors based on the safety levels that causes the value to change color in the AirThings App. It’s that color that is really the only thing that matters.