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

"Max Thermostat" - maxTemp, minStep #70

Closed jensliebau closed 3 years ago

jensliebau commented 4 years ago

Hi,

(I do not have permission to re-open #68, sorry)

I've added the "Max Thermostat" as suggested in #68. Overall it does work, but there are still some problems:

Max temperature

I've set

"minTemp": "0",
"maxTemp": "30",
"minStep": "0.5"

Nevertheless I can select temperatures up to 35° C in Home.app. Every Value above 30.0 results in the thermostat showing "OFF" which is a equivalent of "0.0". Steps are 1.0 not 0.5

-> Is maxTemp and minStep working as expected?

Mode Is ist possible to hide "Cooling" (and "Auto") in Home.app? Cause the device cant't be used to cool the room?

fex01 commented 4 years ago

The options minTemp, maxTemp and minStep are not mentioned in the README at all - where did you find this / does it work?

jensliebau commented 4 years ago

minTemp, maxTemp and minStep are part of a thermostat definition: https://github.com/steilerDev/homebridge-openhab2-complete#thermostat

Unfortunately they do not work as expected.

steilerDev commented 4 years ago

I guess you are all on v1.1.0 from npm? Because I never came around publishing this feature to npm (you would need to install the plugin from github directly.)

I have some time today to check some of the bug reports. If I don't forget I will publish a new version later.

jensliebau commented 4 years ago

You're correct. I've had installed 1.1.0 from npm.

To test the latest code-changes if've just upgraded hombridge-openhab2-complete by running npm install steilerDev/homebridge-openhab2-complete#master

At the moment this still installs a version named homebridge-openhab2-complete@1.1.0 in which setting minTemp, maxTemp and minStep does not have an effect. Maybe you've updated README.md only ?

steilerDev commented 4 years ago

I just updated the latest commit and added a debug statement. If you don't mind would please update the plugin, restart homebridge in debug mode and paste the log here?

jensliebau commented 4 years ago

I've updated again by "npm install steilerDev/homebridge-openhab2-complete#master"

And started Homebridge in Debug-Mode. Cause this generates so much log entries I've greped for entries containing my Thermostats Name. This is what happens when homebridge starts:

Feb 11 20:19:55 openhab homebridge[23768]: [2/11/2020, 8:19:55 PM] [openHAB2-Complete] Got item ThermostatJens_SetpointTemperature of type Number, adding to type cache
Feb 11 20:19:55 openhab homebridge[23768]: [2/11/2020, 8:19:55 PM] [openHAB2-Complete] Got item ThermostatJens_ValvePosition of type Number, adding to type cache
Feb 11 20:19:55 openhab homebridge[23768]: [2/11/2020, 8:19:55 PM] [openHAB2-Complete] Got item vThermostatJens_HeatingItem of type Contact, adding to type cache
Feb 11 20:19:55 openhab homebridge[23768]: [2/11/2020, 8:19:55 PM] [openHAB2-Complete] Got item ThermostatJens_CurrentTemperature of type Number, adding to type cache
Feb 11 20:19:55 openhab homebridge[23768]: [2/11/2020, 8:19:55 PM] [openHAB2-Complete] Got item ThermostatJens_Mode of type String, adding to type cache
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Checking cache for ThermostatJens_LowBattery
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] No value stored for key ThermostatJens_LowBattery
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Checking cache for ThermostatJens_CurrentTemperature
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Returning value (Number) for key ThermostatJens_CurrentTemperature
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Creating numeric sensor/actor characteristic for Jens Thermostat with ThermostatJens_CurrentTemperature
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Subscribing to changes for ThermostatJens_CurrentTemperature
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Queueing subscription for ThermostatJens_CurrentTemperature
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Checking cache for ThermostatJens_SetpointTemperature
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Returning value (Number) for key ThermostatJens_SetpointTemperature
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Creating numeric sensor/actor characteristic for Jens Thermostat with ThermostatJens_SetpointTemperature
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Subscribing to changes for ThermostatJens_SetpointTemperature
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Queueing subscription for ThermostatJens_SetpointTemperature
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Not configuring numeric sensor characteristic for Jens Thermostat: Required currentHumidityItem for Jens Thermostat not defined: {"name":"Jens Thermostat","type":"thermostat","currentTempItem":"ThermostatJens_CurrentTemperature","targetTempItem":"ThermostatJens_SetpointTemperature","heatingItem":"vThermostatJens_HeatingItem","minTemp":"0","maxTemp":"30","minStep":"0.5","batteryItem":"ThermostatJens_LowBattery","batteryItemInverted":"false","serialNumber":"6DF13436064C92312FC45","version":"1.1.0"}
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Not configuring numeric actor characteristic for Jens Thermostat: Required targetHumidityItem for Jens Thermostat not defined: {"name":"Jens Thermostat","type":"thermostat","currentTempItem":"ThermostatJens_CurrentTemperature","targetTempItem":"ThermostatJens_SetpointTemperature","heatingItem":"vThermostatJens_HeatingItem","minTemp":"0","maxTemp":"30","minStep":"0.5","batteryItem":"ThermostatJens_LowBattery","batteryItemInverted":"false","serialNumber":"6DF13436064C92312FC45","version":"1.1.0"}
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Checking cache for vThermostatJens_HeatingItem
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Returning value (Contact) for key vThermostatJens_HeatingItem
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] coolingItem for Jens Thermostat not defined in config: {"name":"Jens Thermostat","type":"thermostat","currentTempItem":"ThermostatJens_CurrentTemperature","targetTempItem":"ThermostatJens_SetpointTemperature","heatingItem":"vThermostatJens_HeatingItem","minTemp":"0","maxTemp":"30","minStep":"0.5","batteryItem":"ThermostatJens_LowBattery","batteryItemInverted":"false","serialNumber":"6DF13436064C92312FC45","version":"1.1.0"})
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Subscribing to changes for vThermostatJens_HeatingItem
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Queueing subscription for vThermostatJens_HeatingItem
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Not configuring numeric actor characteristic for Jens Thermostat: Required coolingThresholdTempItem for Jens Thermostat not defined: {"name":"Jens Thermostat","type":"thermostat","currentTempItem":"ThermostatJens_CurrentTemperature","targetTempItem":"ThermostatJens_SetpointTemperature","heatingItem":"vThermostatJens_HeatingItem","minTemp":"0","maxTemp":"30","minStep":"0.5","batteryItem":"ThermostatJens_LowBattery","batteryItemInverted":"false","serialNumber":"6DF13436064C92312FC45","version":"1.1.0"}
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Not configuring numeric actor characteristic for Jens Thermostat: Required heatingThresholdTempItem for Jens Thermostat not defined: {"name":"Jens Thermostat","type":"thermostat","currentTempItem":"ThermostatJens_CurrentTemperature","targetTempItem":"ThermostatJens_SetpointTemperature","heatingItem":"vThermostatJens_HeatingItem","minTemp":"0","maxTemp":"30","minStep":"0.5","batteryItem":"ThermostatJens_LowBattery","batteryItemInverted":"false","serialNumber":"6DF13436064C92312FC45","version":"1.1.0"}
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Got item ThermostatJens_SetpointTemperature with value 16.0, adding to value cache
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Got item ThermostatJens_ValvePosition with value 0, not adding to value cache, since it is not linked to homebridge!
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Got item vThermostatJens_HeatingItem with value CLOSED, adding to value cache
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Got item ThermostatJens_CurrentTemperature with value 21.7, adding to value cache
Feb 11 20:19:56 openhab homebridge[23768]: [2/11/2020, 8:19:56 PM] [openHAB2-Complete] Got item ThermostatJens_Mode with value AUTOMATIC, not adding to value cache, since it is not linked to homebridge!

Is there something specific I should look for?

jensliebau commented 4 years ago

this is the device definition

                {
                    "name": "Jens Thermostat",
                    "type": "thermostat",
                    "currentTempItem": "ThermostatJens_CurrentTemperature",
                    "targetTempItem": "ThermostatJens_SetpointTemperature",
                    "heatingItem": "vThermostatJens_HeatingItem",
                    "minTemp": "0",
                    "maxTemp": "30",
                    "minStep": "0.5",
                    "batteryItem": "ThermostatJens_LowBattery",
                    "batteryItemInverted": "false"
                },
jensliebau commented 4 years ago

A, silly me - you want me to look out for "this._log.debug(`Applied minValue....) -> didn't find it in the logs, yet:

[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Found accessory in config: 'Thermostat Jens' (thermostat)
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Creating new accessory: Thermostat Jens
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Trying battery service for Thermostat Jens
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Not configuring battery service for Thermostat Jens: Not configuring battery warning characteristic for Thermostat Jens: Required batteryItem for Thermostat Jens not defined: {"name":"Thermostat Jens","type":"thermostat","currentTempItem":"ThermostatJens_CurrentTemperature","targetTempItem":"ThermostatJens_SetpointTemperature","modeItem":"ThermostatJens_Mode","heatingItem":"ThermostatJens_Mode","minTemp":"5","maxTemp":"30","minStep":"0.5","serialNumber":"4C7E4CF027F2DC0C81650","version":"1.1.0"}
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Creating thermostat service for Thermostat Jens
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Checking cache for ThermostatJens_CurrentTemperature
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Returning value (Number) for key ThermostatJens_CurrentTemperature
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Creating numeric sensor/actor characteristic for Thermostat Jens with ThermostatJens_CurrentTemperature
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Subscribing to changes for ThermostatJens_CurrentTemperature
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Queueing subscription for ThermostatJens_CurrentTemperature
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Checking cache for ThermostatJens_SetpointTemperature
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Returning value (Number) for key ThermostatJens_SetpointTemperature
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Creating numeric sensor/actor characteristic for Thermostat Jens with ThermostatJens_SetpointTemperature
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Subscribing to changes for ThermostatJens_SetpointTemperature
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Queueing subscription for ThermostatJens_SetpointTemperature
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Not configuring numeric sensor characteristic for Thermostat Jens: Required currentHumidityItem for Thermostat Jens not defined: {"name":"Thermostat Jens","type":"thermostat","currentTempItem":"ThermostatJens_CurrentTemperature","targetTempItem":"ThermostatJens_SetpointTemperature","modeItem":"ThermostatJens_Mode","heatingItem":"ThermostatJens_Mode","minTemp":"5","maxTemp":"30","minStep":"0.5","serialNumber":"4C7E4CF027F2DC0C81650","version":"1.1.0"}
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Not configuring numeric actor characteristic for Thermostat Jens: Required targetHumidityItem for Thermostat Jens not defined: {"name":"Thermostat Jens","type":"thermostat","currentTempItem":"ThermostatJens_CurrentTemperature","targetTempItem":"ThermostatJens_SetpointTemperature","modeItem":"ThermostatJens_Mode","heatingItem":"ThermostatJens_Mode","minTemp":"5","maxTemp":"30","minStep":"0.5","serialNumber":"4C7E4CF027F2DC0C81650","version":"1.1.0"}
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Creating 'TargetHeatingCoolingState' characteristic for Thermostat Jens with ThermostatJens_Mode
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Checking cache for ThermostatJens_Mode
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Returning value (String) for key ThermostatJens_Mode
[2/11/2020, 8:58:53 PM] [openHAB2-Complete] Unable to add accessory Thermostat Jens: Error: Not configuring numeric actor characteristic for Thermostat Jens: ThermostatJens_Mode's type (String) is not as expected (["Number"]), skipping
steilerDev commented 3 years ago

Fixed with 1.3.0