I have five temperature sensors connected to a Raspberry pi. Three of them provide only temperature, and the other two provide temperature and humidity. I’m using the GitHub - mjcumming/Homie4: Python package for Homie v4 specification python library to read the values and publish them to mqtt. In Openhab 3, the Things created for all five sensors have the statuses as unitless Numbers. For instance:
In Openhab 4, the Things created for objects that only supply temperature show the sensor status as Numbers with a unit of Temperature:
However, the Things created for objects that supply both temperature and humidity show the temperature status as a Number with a unit of ElectricCapacitance:
When I snoop on the mqtt bus, both types of sensors seem to be identical as far as temperature reporting goes - both report temperature units as “F”:
(a temperature-only sensor)
homie/ts-226/status/temperature/$unit F
(a temp/humid sensor)
homie/temphumid2/status/temperature/$unit F
Interestingly, according to Units Of Measurement | openHAB, a unit of “F” is actually a Farad, the unit of capacitance. It’s “°F”, with the degree thingee in front of the F, that’s the unit for temperature (in Fahrenheit). Why would one type of Thing get the units right, and the other get it wrong?
There are assorted warnings in the logs about these objects, but none of them says anything like “I can’t figure out what “F” is so I’m going to assume it’s a temperature”.
I know I can (and now must, in OH4) supply units on the item side, to fix certain dimensionless numbers like humidity, but the temperature items bound to these Things already have “°F” set as the units.
How can I debug this further? And, is there a way to override the units assigned by the MQTT binding? Thanks.
-Joel