Install HomeKit controller on Mac

I’m running home assistant on my Mac mini and I’m trying to install HomeKit controller. I’ve worked through a few issues, like getting gmpy2 to install for example. Now I’m seeing this in my log file.

ERROR (SyncWorker_17) [homeassistant.util.package] Unable to install package homekit==0.6: Failed building wheel for py25519

I’ve tried pip3 install py25519 but that fails too. I’ve done a lot of Googling and haven’t found any fixes. Any help would be appreciated.

I remember having an issue too on my Mac Mini but unfortunately I can’t remember what I did. Have you tried pip3 install wheel or making sure it’s up to date?

Good idea with pip3 install wheel, but it looks like I already have the latest installed.

Here’s a list of everything I have installed. If you don’t mind sharing, maybe you have something I don’t?

brew list
eigen gmp jpeg libmpdclient mpc numpy openexr python sqlite xvid ffmpeg icu4c lame libpng mpfr open-zwave openssl python@2 tbb xz. gdbm ilmbase libmpc libtiff node opencv pkg-config readline x264

pip3 list
Package Version


aiohttp 3.2.1
astral 1.6.1
async-timeout 3.0.0
attrs 18.1.0
certifi 2018.4.16
cffi 1.11.5
cffi-utils 0.79
chardet 3.0.4
gmpy 1.17
gmpy2 2.0.8
hkdf 0.0.3
homeassistant 0.71.0
idna 2.6
idna-ssl 1.0.1
Jinja2 2.10
MarkupSafe 1.0
multidict 4.3.1
netifaces 0.10.7
nose 1.3.7
numpy 1.14.5
pip 10.0.1
pycparser 2.18
pytz 2018.4
PyYAML 3.12
requests 2.18.4
setuptools 39.0.1
typing 3.6.4
urllib3 1.22
voluptuous 0.11.1
wheel 0.31.0
yarl 1.2.5
zeroconf 0.20.0

Sorry for the late reply:

Package Version


aiohttp 3.2.1
astral 1.6.1
async-timeout 3.0.0
asyncio 3.4.3
attrs 18.1.0
certifi 2018.4.16
chardet 3.0.4
DateTime 4.2
homeassistant 0.71.0
idna 2.6
idna-ssl 1.0.1
Jinja2 2.10
lnetatmo 1.4.3
MarkupSafe 1.0
multidict 4.3.1
netdisco 1.3
netifaces 0.10.6
pip 10.0.1
pycryptodome 3.6.1
pytz 2018.4
PyYAML 3.12
requests 2.18.4
setuptools 39.0.1
soco 0.14
typing 3.6.4
urllib3 1.22
voluptuous 0.11.1
websockets 4.0.1
xmltodict 0.11.0
yarl 1.2.3
zeroconf 0.20.0
zope.interface 4.4.3

Boy, this would be great if we could figure it out, but I was never able to circumvent this issue.

Through countless hours of research, I never found a way to install py22519 or rebuild the wheel that worked. You’ll see that others are having the same issue here:

This issue led me to setting up a new docker based install and I’m now ultimately happier with the install if that matters…

I finally got py25519 to install on my Mac mini after A LOT of trial and error and some educated guessing. It looks like py25519 has a bug in it and is missing a few files maybe? I’m not a Python person so let me know if I’m wrong.

First I downloaded py25519 from Github and ran the setup.py file to see if I had the same issue, I did. I Googled some of the errors it was printing and stumbled on replacing this line

# include <malloc.h>

With these lines in the files main.c and external_call.h

#ifndef __clang__
# include <malloc.h>
#endif

That let the pip installer move farther, but then it complained about missing some files, custom_blind.c and custom_blind.h. I found a copy in those files in a Github search under curve25519. I put them in the directory /Py25519-0.1328/c/source (I put the original Github set of files at the root level of my drive) and py25519 installed.

Now I can see “Home Assistant Bridge” on my Overview page in Home Assistant. Which to be fair, I don’t know what to do with yet. I’ve tried the HomeKit code for an outlet switch but nothing happens. This outlet worked before with HomeKit.

Now I’m wondering if my hack to get py25519 installed still didn’t get things correct.

1 Like

Just to add to this, I also had to run a couple of additional commands. I kept getting hung up when trying to install gmpy2 due to an error saying the mpc.h file couldn’t be found. If you run ‘brew install libmpc’ that should install it. I also saw that mpfr is a requirement of gmpy2, so I ran ‘brew install mpfr’ as well. With those two commands as well as what was listed above, I was able to get the HomeKit component installed on my Mac and added to the Home.app.

but were you actually able to add a homekit device to home assistant?

It works! I was able to successfully add my HomeKit Insignia smart switch to home assistant. The trick was getting the switch on my local wi-fi network but not entering in the HomeKit passcode. Using the Insignia app didn’t allow for this.
I did a factory reset to the switch. Then in the wi-fi settings of my iPhone, I noticed a “New Accessory” option with the name of the switch, clicked it and my phone added the switch to my local network. Then in home assistant I punched in the HomeKit code, success. FYI, you need to enter in the dashes too 123-45-678

Hope this helps someone else, it’s been bugging me for 3 months.

You can find custom_blind.c and custom_blind.h in this github repo: