steilerDev / homebridge-openhab2-complete

A homebridge plugin for openHAB, that has the expectation to fully support all Services offered by Apple's Homekit Accessory Protocol (HAP)
GNU General Public License v3.0
52 stars 16 forks source link

Type temp cannot show negative temperatures #32

Closed EjvindHald closed 4 years ago

EjvindHald commented 5 years ago

If an openHAB Number item contains a negative value it seems to show zero in the Homekit app instead of the actual negative value.

By using the native Homekit support in openHAB it shows the correct negative number in Homekit.

steilerDev commented 4 years ago

Which accessory are you using? Certain HomeKit Types do not support negative values.

EjvindHald commented 4 years ago

I am on vacation, so I do not have the code available. But I am quite sure I used type 'temp' in homebridge.

I have connected the very same Item in openHAB to both Homebridge and Homekit native integration, so it is easy to see the difference in behaviour on my iPhone.

EjvindHald commented 4 years ago

I can see that other have had problems with this as well. It seems that the Homebridge server uses default values (min=0, max=100) and according to @KhaosT the application should override these with the values needed. Read here for more info include small code examples of how to set a custom minimum and maximum temperature.

I suggest the minimum in openHAB Complete to be -100 and maximum to +200. Both are in Celcius, and the reason for the high maximum number is because I have sensors on my solar panels and they can easily exceed 100 degree Celcius.

Thanks.

steilerDev commented 4 years ago

I just implemented a potential fix for this (wasn't able to test it locally since I am currently traveling). Feel free to test the latest commit (b10ac33) on this.

Note: The Configuration syntax for 'temp' changed slightly.