NorthernMan54 / homebridge-alexa

Expose your homebridge controlled devices to Amazon Alexa.
https://www.homebridge.ca
442 stars 77 forks source link

Enables HK Thermostat type accessory to turn off #605

Closed banboobee closed 3 months ago

banboobee commented 3 months ago

This PR enables turning HK thermostat type accessories to OFF.

I was wondering and frustrated that there's no way for turning HK thermostat type accessories to OFF from day 1. I think this not limited on my environment, as shown in https://github.com/NorthernMan54/homebridge-alexa/wiki/Thermostat-Voice-Control-Comparison.

Recently I found an Amazon document describing that this is an intended behavior, and recommends to implement PowerController for air conditioners.

https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-thermostatcontroller.html#discover-response-example-for-an-air-conditioner

According to the document, this PR adds PowerController entries for discover, response, and stateReport for HK thermostat services to enable turning them ON/OFF. Turning ON is internally interpreted as COOL as in homebridge-gsh.

Currently, this is working well in my environment, and I hope anyone try to see if any issues or side effects.

NorthernMan54 commented 3 months ago

Tks for this enhancement, let me do some local testing with it and see how it goes.

NorthernMan54 commented 3 months ago

Added to the current beta package along with dependancy updates

NorthernMan54 commented 3 months ago

This is bundled into homebridge-alexa@0.6.9-beta.11

banboobee commented 3 months ago

Thanks. It is great if integrated to this amazing plugin.

NorthernMan54 commented 3 months ago

I was testing this, and had my AC just turn on during the middle of winter here in Canada, outdoor temps were below freezing. Am thinking that wiring Turn on to Cool is problematic in some regions.

Am going to look at adding config option to choose the Turn on behaviour.

NorthernMan54 commented 3 months ago

Beta 18 includes the ability to change the Thermostat Turn On behaviour with a new config setting thermostatTurnOn which defaults to Cool - 2.

This is the likely release candidate after further regression testing of the package.

banboobee commented 3 months ago

Adding an option is also good for heat only accessories.👍

NorthernMan54 commented 3 months ago

After a bit more thought about the impact to existing users, I made a couple more tweaks to the behaviour. I removed the Turn On action if thermostatTurnOn is unset. With this tweak, when you ask Alexa to Turn On Alexa will respond with That command does not work on device ... unless thermostatTurnOn is configured. Which is the existing behaviour. To enable Turn On, they need to set the mode in the config settings.

Hopefully this will now be the final - homebridge-alexa (0.6.9-beta.19)

This is what is it looks like in the config menu.

image

NorthernMan54 commented 3 months ago

And published as release 0.6.9

Tks very much for this feature

banboobee commented 3 months ago

I'm really happy to collaborate with you, and contribute to this amazing plugin.

banboobee commented 3 months ago

Just FYI. Updated to 0.6.9 and set thermostatTurnOn to auto. Working well. Great.

NorthernMan54 commented 3 months ago

Tks for the feedback, much appreciated.