Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thermostat not working with Siri, but OK with Home app #32

Closed
SupraJames opened this issue Jan 16, 2019 · 3 comments
Closed

Thermostat not working with Siri, but OK with Home app #32

SupraJames opened this issue Jan 16, 2019 · 3 comments

Comments

@SupraJames
Copy link
Contributor

I set this all up over a year ago - but at some point something broke - I could no longer use Siri to set the desired temperature of my heating.

I found today that there is a difference in how Siri and the Home app work. On my iPhone running iOS 12.1.2 I can use the Home app to set the temperature and it works fine:

Jan 16 20:13:40 smartie homebridge[20463]: Wed, 16 Jan 2019 20:13:40 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics
Jan 16 20:13:40 smartie homebridge[20463]: Wed, 16 Jan 2019 20:13:40 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":17,"iid":13,"value":21}]
Jan 16 20:13:40 smartie homebridge[20463]: Wed, 16 Jan 2019 20:13:40 GMT Accessory [Homebridge] Setting Characteristic "Target Temperature" to value 21
Jan 16 20:13:40 smartie homebridge[20463]: [2019-1-16 20:13:40] [Heatmiser] setTargetTemperature from: http://localhost:4321/targetTemperature/21
Jan 16 20:13:40 smartie homebridge[20463]: [2019-1-16 20:13:40] [Heatmiser] response success

However, if I ask Siri to 'set the temperature to 21 degrees' then HomeKit seems to use a different Characteristic, which is not implemented:

Jan 16 19:54:15 smartie homebridge[476]: Wed, 16 Jan 2019 19:54:15 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics
Jan 16 19:54:15 smartie homebridge[476]: Wed, 16 Jan 2019 19:54:15 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":17,"iid":17,"value":5}]
Jan 16 19:54:15 smartie homebridge[476]: Wed, 16 Jan 2019 19:54:15 GMT Accessory [Homebridge] Setting Characteristic "Heating Threshold Temperature" to value 5
Jan 16 19:54:15 smartie homebridge[476]: Wed, 16 Jan 2019 19:54:15 GMT EventedHTTPServer [::ffff:192.168.100.143] Sending HTTP event '17.17' with data: {"characteristics":[{"aid":17,"iid":17,"value":5}]}
Jan 16 19:54:15 smartie homebridge[476]: Wed, 16 Jan 2019 19:54:15 GMT EventedHTTPServer [::ffff:192.168.100.176] Muting event '17.17' notification for this connection since it originated here.
Jan 16 19:54:15 smartie homebridge[476]: Wed, 16 Jan 2019 19:54:15 GMT EventedHTTPServer [::ffff:192.168.100.176] HTTP Response is finished

So, short story, Home app uses "Target Temperature" and Siri uses "Heating Threshold Temperature".

I have no idea when this change, presumably in iOS, occurred. Editing index.js for homebridge-thermostat and commenting out the following lines fixes the issue:

                this.service
                        .getCharacteristic(Characteristic.HeatingThresholdTemperature)
                        .on('get', this.getHeatingThresholdTemperature.bind(this));

We then don't register this characteristic with HomeKit, and it doesn't get called. Siri starts to work again.

I'm opening this as an issue, I think the simple fix would be just to delete these lines but don't want to break anything.

@PJCzx
Copy link
Owner

PJCzx commented Jan 20, 2019

Thx @SupraJames for this feedback. I just roughly pushed and publish on NPN your feedback. Can you let me know if it's better ? Thx

@PJCzx
Copy link
Owner

PJCzx commented Feb 6, 2019

15 days without feedback, I close the issue

@PJCzx PJCzx closed this as completed Feb 6, 2019
@phenotypic
Copy link
Contributor

phenotypic commented Feb 18, 2019

@SupraJames I've found a solution to your issue. As you suggested, we can simply remove the HeatingThreshholdTemperature as having it caused Siri to use this to set the temperature instead of TargetTemperature.

Currently, my fork is too different to simply make a pull request, however, once I have solved a number of other issues with the plugin, I will do. If you are interested in making a pull request yourself or would like to make your own fork which adds this functionality, the steps to do it are fairly simple:

  1. Delete all sections which contain the word "threshold". This includes the this.service declaration, the getHeatingThresholdTemperature function as well as the functions relating to CoolingThresholdTemperature. Thus, you can also delete any variables related to this field located near the top.

Hopefully that helps you!

EDIT
I have now made a pull request which will solve this issue.

PJCzx added a commit that referenced this issue Feb 19, 2019
Thx to @SupraJames for his feedback

I set this all up over a year ago - but at some point something broke - I could no longer use Siri to set the desired temperature of my heating.

I found today that there is a difference in how Siri and the Home app work. On my iPhone running iOS 12.1.2 I can use the Home app to set the temperature and it works fine:

Jan 16 20:13:40 smartie homebridge[20463]: Wed, 16 Jan 2019 20:13:40 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics
Jan 16 20:13:40 smartie homebridge[20463]: Wed, 16 Jan 2019 20:13:40 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":17,"iid":13,"value":21}]
Jan 16 20:13:40 smartie homebridge[20463]: Wed, 16 Jan 2019 20:13:40 GMT Accessory [Homebridge] Setting Characteristic "Target Temperature" to value 21
Jan 16 20:13:40 smartie homebridge[20463]: [2019-1-16 20:13:40] [Heatmiser] setTargetTemperature from: http://localhost:4321/targetTemperature/21
Jan 16 20:13:40 smartie homebridge[20463]: [2019-1-16 20:13:40] [Heatmiser] response success
However, if I ask Siri to 'set the temperature to 21 degrees' then HomeKit seems to use a different Characteristic, which is not implemented:

Jan 16 19:54:15 smartie homebridge[476]: Wed, 16 Jan 2019 19:54:15 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics
Jan 16 19:54:15 smartie homebridge[476]: Wed, 16 Jan 2019 19:54:15 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":17,"iid":17,"value":5}]
Jan 16 19:54:15 smartie homebridge[476]: Wed, 16 Jan 2019 19:54:15 GMT Accessory [Homebridge] Setting Characteristic "Heating Threshold Temperature" to value 5
Jan 16 19:54:15 smartie homebridge[476]: Wed, 16 Jan 2019 19:54:15 GMT EventedHTTPServer [::ffff:192.168.100.143] Sending HTTP event '17.17' with data: {"characteristics":[{"aid":17,"iid":17,"value":5}]}
Jan 16 19:54:15 smartie homebridge[476]: Wed, 16 Jan 2019 19:54:15 GMT EventedHTTPServer [::ffff:192.168.100.176] Muting event '17.17' notification for this connection since it originated here.
Jan 16 19:54:15 smartie homebridge[476]: Wed, 16 Jan 2019 19:54:15 GMT EventedHTTPServer [::ffff:192.168.100.176] HTTP Response is finished
So, short story, Home app uses "Target Temperature" and Siri uses "Heating Threshold Temperature".

I have no idea when this change, presumably in iOS, occurred. Editing index.js for homebridge-thermostat and commenting out the following lines fixes the issue:

                this.service
                        .getCharacteristic(Characteristic.HeatingThresholdTemperature)
                        .on('get', this.getHeatingThresholdTemperature.bind(this));

We then don't register this characteristic with HomeKit, and it doesn't get called. Siri starts to work again.

I'm opening this as an issue, I think the simple fix would be just to delete these lines but don't want to break anything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants