Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Set device as HeaterCooler instead of Thermostat. - #5

Merged
dave-atx merged 6 commits into
dave-atx:masterfrom
DFurnes:heater-cooler
Apr 11, 2019
Merged

Set device as HeaterCooler instead of Thermostat.#5
dave-atx merged 6 commits into
dave-atx:masterfrom
DFurnes:heater-cooler

Conversation

@DFurnes

@DFurnes DFurnes commented Jun 22, 2018

Copy link
Copy Markdown
Contributor

Thanks for the fantastic plugin!!

I wanted to be able to tap the accessory in the Home app in order to turn on & off my air conditioner. Switching the service to be a HeaterCooler seems to have done the trick.

After swapping that, I was also able to toggle the "state" from COOLING to IDLE based on whether the thermometer read lower than the target, so that the app would show the correct icon and verb:

@DFurnes

DFurnes commented Jul 1, 2018

Copy link
Copy Markdown
Contributor Author

Added some error checking in 432adea, in case the thermostat is broken:

@DFurnes

DFurnes commented Jul 12, 2018

Copy link
Copy Markdown
Contributor Author

Updated for the new mymodlet.com in 5453fd7.

@Tecnico1931

Copy link
Copy Markdown

I got it working after installing https://github.com/cheeriojs/cheerio.

@DFurnes
DFurnes force-pushed the heater-cooler branch 5 times, most recently from caf3ee7 to 0eb9482 Compare July 17, 2018 01:42
@DFurnes

DFurnes commented Jul 17, 2018

Copy link
Copy Markdown
Contributor Author

It turns out the new website allows controlling the A/C when the thermostat is offline! I've updated this pull request's error checking in 9427bf0 to only error out with "No response" if the modlet itself is offline, and otherwise show "0°" for the current temperature to indicate if the thermostat is broken.

@picnicbob

Copy link
Copy Markdown

Thanks for this. So far your branch is the only way I've found to get the modlet working with homebridge again after the web update.
I do have an issue now though that might be related to the HeaterCooler change, and I'm not sure if it's an Apple bug or if it's something we can fix:
If an automation is run that should set the AC OFF it seems to toggle it instead, turning it ON if it is already OFF.
Anyone else having this issue? I'm going to investigate a little bit today.

@picnicbob picnicbob left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to do this myself or I would. Not a frequent user of GitHub.com

Comment thread index.js Outdated
return callback(new Error('Modlet broken.'));
}

this.api.log(this.name, 'set heating / cooling active: ' + !this.powerOn);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setActiveState() is not necessarily always called to toggle, it can be called with the existing value. Use value instead of !this.powerOn

Comment thread index.js Outdated

this.api.log(this.name, 'set heating / cooling active: ' + !this.powerOn);

this.powerOn = !this.powerOn;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Use value instead of !this.powerOn here too obviously)

@DFurnes

DFurnes commented Sep 16, 2018

Copy link
Copy Markdown
Contributor Author

Oh, good catch @picnicbob! Fixed in cf3e48f.

@matthew-gerstman

Copy link
Copy Markdown

just wanna leave this command here if anyone is trying to install this branch

npm install -g https://github.com/DFurnes/homebridge-platform-smartac#cf3e48f66fbd728fa33f670ad9053c4fab184ea6

installs the plugin @DFurnes branch commit

@dave-atx

Copy link
Copy Markdown
Owner

Apologies for the long absence -- I moved and don't have a AC unit that can use the SmartAC devices anymore. I'll merge this in and do a new release.

If anyone would like to take over stewardship of the project, please reach out.

@dave-atx
dave-atx merged commit 89f5254 into dave-atx:master Apr 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants