- Platform information:
- Hardware: Intel amd64
- OS: Debian 12 stable
- Java Runtime Environment: OpenJDK Runtime Environment 21.10-(Zulu-17.30+15-linux_x64)
- openHAB version: 4.0.1-1
All,
My units have been behaving rather well with the OH4 upgrade, but I can’t figure out how to get air pressure values to do that.
My system is set to imperial units (living in the US), however, I’d like to use Pa (hPa, rather) for air pressure values.
I may be oldschool, but I prefer to do configuration in .things and .items files, so I hope I can get this figured out using those.
Data feeds into OH via MQTT in a .things file. That does not incluce a unit, although adding one in the .things file does not affect anything. Here’s the relevant part"
Type number : pressure1 "Pressure1" [ stateTopic="raspi1/pressure1" ]
The item is defined in an .items file. I’ve tried two different versions (not at the same time, of course):
Number:Pressure weather_raspi1_pressure1 "Pressure1 RPi BME280" <pressure> (pressure) {channel="mqtt:topic:home:Raspi1:pressure1",stateDescription=" "[pattern="%.2f hPa"]}
Number:Pressure weather_raspi1_pressure1 "Pressure1 RPi BME280 [%.2f hPa]" <pressure> (pressure) {channel="mqtt:topic:home:Raspi1:pressure1"}
Both give me the same result, which is the hPa-Value (as delivered by MQTT) with “inHg” as the unit.
Visible on Karaf:
weather_raspi1_pressure1 (Type=NumberItem, State=1015.89 inHg, Label=Pressure1 RPi BME280, Category=pressure, Groups=[pressure])
The sitemap even tries to convert that value to hPa.
Of course, I can fix this by creating the item as “Number” instead of “Number:Pressure”, but there must be a better way than that.
Thanks!