Found a bug, but it was not your bug. However, I think I see what’s going on (or I have a guess):
Whenever I try to log in with the script WHILE I am logged in via a browser, I get a login redirect. I believe this is not correctly caught on the script side yet (I will look at adding this check).
In any case, this means two things:
Make sure you are logged out everywhere while you are testing the script or the serve will return a logout/redirect, and
We will need to find a way to work around this in production or you can’t check your thermostat manually when the script could be running.
I will investigate how they are doing their duplicate session detection and work on some mitigations.
No progress. I am researching how to start hooking up the PyPi module into the climate framework for HA…if there are any experts listening that can give me pointers, that would be great!
I think it would be unlikely that you would get any development pointers from this thread. I wish I could help you with this, but do please consider posting a request for assistance to https://community.home-assistant.io/c/development
I just stumbled upon this discussion for the S30 and would be willing to help out with any testing. I was excited to see Homekit climate support added to Homeassistant only to find out the S30 wouldn’t play nicely with it.
the issue with the homekit controller seems to be the way the thermostat randomly generates a pin code…
made a fork of jlusardi’s code https://github.com/jakeapp/homekit_python and it works to put a code on the screen for longer than shooting a incorrect code with the configurator (also removed some lines in some places to get discovery to work better-- something to do with feature flags)…
Using the configurator with the code on the screen throws off a BusyError
Some sort of change to the homekit_python code would be required to initiate a pin call, wait for a while, and in the same session to be able to send one as well… it’s not there yet, and with a bit more effort it could be…
Really wish that Lennox would do like every other connected thermostat maker and have some sort of public API (looks like they use Microsoft Azure)… Maybe if we all nagger Lennox they’ll get around to it.
It’s really great you are trying to update the HA Homekit component to work with the Lennox S30 series. I sure hope you can figure out the pin code handshake and get it working.
I discovered another possibility recently. There is an opensource Homebridge server on Github that emulates the iOS Homekit API. It also supports plugins to control various devices, including a plugin for the Lennox iComfort! Unfortunately, the docs don’t say if this is for iComfort Wifi or S30.
EDIT: I received a reply from the dev that it supports the iComfort WiFi unit only.
@BenMenchaca’s “web scraper” test code was actually working quite well to read and configure S30 settings. His last comment was that he was needing help with hooking up the PyPi module into the climate framework for HA. It would be great if he could get that help and get this implemented.
@jakeapp - I see that you have made some additional updates to your homekit code for PIN support a month ago. Is it working with the iComfort S30 now? Thanks for posting any news about it.
There hasn’t been any further work on @BenMenchaca 's code that I can see on Github, so it’s looking more hopeful for Homekit integration than anything else.
Just an FYI - there is a completed PR for a new iComfort WiFi component that will be in the next version. This will NOT support the S30/E30/M30.
@jakeapp - please let us know if you’ve made any progress with this, and if not, if you have any plans to work on it any more. I’ll sure be happy to help you test it.
Is there a working solution for S30 integration as of yet? Seems new May software updated added some more connection features (ex. IFTTT, Google Assistant).
The new Lennox S30 IFTTT integration has intriguing possibilities with HA’s IFTTT component for remote control. I don’t see how this integration could be used to retrieve data from the T-stat though.
As mentioned above, the most promising solution is to leverage the Lennox Homekit integration with HA’s Homekit controller component. There is work in progress to fix pairing issues with T-stats that require a PIN (Ecobee, S30) which also required updates to python-Homekit.
HASS .93 will contain many updates to the Homekit controller component, but not until the .94 version is S30 pairing expected to be working seamlessly according to @jc2k in this thread.
Here is an update on the HomeKit controller roadmap.
0.93 contains the groundwork for the config entry support coming in 0.94. It has a bunch of fixes that are relevant to all HomeKit thermostats.
0.94 is so far just config entry support. Config entry support means your homekit accessories appear in “Integrations”. They should also start working after a HA restart without much delay (there is currently a delay of 30ish seconds before they are discovered). The pairing UI is better, and translated.
I’m currently working on a folow up PR that properly uses the device registry API so HA knows how entities found on a bridge are grouped together in devices.
After that I will be concentrating on polishing up the pairing fix. The basic code is written and in my patch queue, but there are a few edge cases it introduces that I need to look at. I’m hoping this is ready for 0.94, but it might slip to 0.95.
For anyone landing here to find out the latest status of this Lennox iComfort x30 HASS integration - good news!
The Homekit Controller component is working nicely to pair and control the iComfort S30/E30/M30 thermostats. When using HASS versions > .95, the inconsistent pairing issues seem to have been solved with the latest iComfort x30 firmware update (version: 3.55.626).
With this firmware update, an iOS device and the “WAC” Wi-Fi setup option is no longer required for pairing. Just be sure the thermostat has been cleared of a previous pairing (via either the Homekit factory reset or the new clear pairings option on the thermostat).
All that is needed in configuration.yaml is the inclusion of zeroconf: which should automatically detect the thermostat via its bonjour broadcast and create a notification flag in HASS of a pending iComfort integration. The random pairing code displayed on the thermostat is then entered via the HASS integration menu.
The current Homekit non-commercial API provides only a basic set of supported features for any Homekit-compatible thermostat as can be seen from the following HASS states listing…
I just flashed a fresh image of hassio and was able to add the icomfort via homekit. Thus far it’s working great with essentially no config. Just a heads up to anyone else looking for a solution.
However, whenever I try to change the temp either by calling climate.set_temperature or using the thermostat widget in the UI, HA shows the new value until the next time homekit_controller polls and then it goes back to the current set temp. I have homeassistant.components.homekit_controller set to debug, but not seeing anything in the logs. Not sure what component I should be looking at for errors.
I’m not sure what you mean by “it goes back to the current set temp”. Did you mean that when you set a new temp, the set temp soon falls back to what it was previously? I’ve not seen that reported by anyone using this component before.
Just in case it isn’t clear - the attribute “temperature” is the set temp and “current_temperature” is the current room temp.
The Homekit component has received excellent support. I would suggest opening an issue on Homeassistant github to get expert help in further diagnosing your problem.