Closed saintonotole closed 5 years ago
Hi @saintonotole,
I didn't even know that you could have a Unit of Measurement inside your basic item types.
I tested your setup and found, that the log correctly shows a warning, when using Number:Temperature
and does not add the accessory to the system. Unfortunately I haven't seen a way to request the 'raw' number from openHAB, instead of the number + unit.
I think so far it is expected behavior, however it is not desired behavior. Therefore I will look into it.
Thanks. Well, at least, you can get pair of number + unit and pattern from api, and try to parse pattern.
Request URL https://openhab.local/rest/items/Bedroom_Temp
Response Body
"link": "https://openhab.local/rest/items/Bedroom_Temp",
"state": "27.0 °C",
"stateDescription": {
"pattern": "%.1f %unit%",
"readOnly": true,
"options": []
},
Hi @saintonotole ,
my latest commit on the V0.10.0
branch (382a369) should fix your problem and support UoM inside Number types. You can test it by manually installing this state or wait a bit, since I plan to release V0.10.0
very soon and use the upstream release later.
Regards,
Frank
Released with V0.10.0
and commit e8bf1246991e671ae0a872a18eac2b83a9316b62.
Unless you are still experiencing problems, I will now close the issue.
Describe the bug If i use generic item type "Number" in OH2, then everything works fine. If i use more specific "Number:Temperature" item type, HomeKit Item silently not created at all.
Expected behavior I expect plugin to correctly parse readings from number:temperature items, or, at least, throw warning in logs about wrong item type.
Configurations
Environment (please complete the following information):