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

Make Characteristic.TargetTemperature properties configurable #52

Closed weakfl closed 4 years ago

weakfl commented 4 years ago

It would be great if the properties maxTemp, minTemp and minStep of Characteristic.TargetTemperature would be configurable.

These properties determine the range of the temperature slider within the Home App. Making them configurable would allow more fine grained control of thermostats.

Example:

Characteristic.setProps({
    minValue: 6,
    maxValue: 28,
    minStep: 0.5
});
steilerDev commented 4 years ago

Hi @weakfl,

I just added this parameter with my latest commit (1c24051) to Thermostat and Temperature Sensor accessories. I don't have the time to test it right now, so feel free to check it out and report any issue back.

Thank you, Frank

grzegorz914 commented 4 years ago

removed

weakfl commented 4 years ago

Thanks a lot @steilerDev!

I'm not sure if it's related, as I have just set up homebridge, but I'm getting the following error with your latest commit:

 Error: This callback function has already been called by someone else; it can only be called one time.
    at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:12:13
    at ThermostatAccessory.<anonymous> (/usr/lib/node_modules/homebridge-openhab2-complete/util/Util.js:37:21)
    at OpenHAB.getState (/usr/lib/node_modules/homebridge-openhab2-complete/util/OpenHAB.js:76:13)
    at ThermostatAccessory.getState (/usr/lib/node_modules/homebridge-openhab2-complete/util/Util.js:21:19)
    at Characteristic.TargetTemperature.emit (events.js:203:15)
    at Characteristic.TargetTemperature.Characteristic.getValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:164:10)
    at Bridge.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:771:20)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleGetCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:735:8)
    at HAPServer.emit (events.js:198:13)
[9/29/2019, 5:35:35 PM] Got SIGTERM, shutting down Homebridge...
weakfl commented 4 years ago

@steilerDev everything's working fine with your previous commit.

Btw, I love this add-on 👍

grzegorz914 commented 4 years ago

Same error.

weakfl commented 4 years ago

@steilerDev I think the new defaults are a bit too big and might impact UX. I would keep the current ones, which seem to be:

minValue: 10
maxValue: 38
minStep: 1
MichlW commented 4 years ago

This does not work for me with Temperature sensor.

I configured:

{
   "name": "Außentemperatur",
   "type": "temp",
   "currentTempItem": "Aussen_Temperatur",
   "tempUnit": "Celsius",
   "minTemp": "-100",
   "maxTemp": "100",
   "minStep": "0.1"
}

[openHAB2-Complete] Received state: 13.9375 (transformed to 13.9375) for Außentemperatur [Aussen_Temperatur]

The value is shown as 14.0 °C in Home App - even without configuring minTemp, maxTemp and minStep...

But with the settings above I expect 13.9 °C... What am I doing wrong?

MichlW commented 4 years ago

I think i know it. The related commit is quite newer than version 1.1.0 that i actually use. Sorry for my question.

When do you plan to release the next version with minTemp, maxTemp and minStep support?

steilerDev commented 4 years ago

Error should be gone now. Finally found the time to go through the issues and should release a point release soon.

P.S.: @MichlW This seems to be a rounding behavior of HomeKit, which I can't control.

weakfl commented 4 years ago

Thanks!

kiwiRickNZ commented 3 years ago

@steilerDev I think the new defaults are a bit too big and might impact UX. I would keep the current ones, which seem to be:

minValue: 10
maxValue: 38
minStep: 1

can we please get the max value changed to 40, im trying to control my hot tub atm and when I change the temperature through Siri it won't let me change the temp above 38.