You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since iOS 13 I can not add the bridge. With iOS 12 it works. Is there anything new what is should be aware of? The iPhone says it can not be added because it could not connect to the device. Thanks for help and thank you for the project!
are you running the latest code from HAP-Java, including 0201d9a ? That should fix iOS 13. If you're using it within OpenHAB, you might want to check out https://github.com/ccutrer/openhab2-addons/releases/tag/2.5.0-cody2 (but with caveats). Otherwise, you'll need to compile and drop latest HAP-Java into whatever other project yourself; there's not a new release yet.
Pairing is not working for me, too. It seems that netty closes the connection too early. I added some Thread.sleep and it helped to get some steps further, but finally failed.
are you running the latest code from HAP-Java, including 0201d9a ? That should fix iOS 13. If you're using it within OpenHAB, you might want to check out https://github.com/ccutrer/openhab2-addons/releases/tag/2.5.0-cody2 (but with caveats). Otherwise, you'll need to compile and drop latest HAP-Java into whatever other project yourself; there's not a new release yet.
I'm having the same issue. I'm seeing the following error when I try to pair my phone to openHAB:
2019-11-01 23:09:59.435 [ERROR] [.hapjava.impl.pairing.PairingManager] - Exception while finalizing pairing org.bouncycastle.crypto.tls.TlsFatalAlert: bad_record_mac(20) at io.github.hapjava.impl.crypto.ChachaDecoder.decodeCiphertext(ChachaDecoder.java:31) ~[299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.crypto.ChachaDecoder.decodeCiphertext(ChachaDecoder.java:41) ~[299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.pairing.FinalPairHandler.decrypt(FinalPairHandler.java:44) ~[299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.pairing.FinalPairHandler.handle(FinalPairHandler.java:39) ~[299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.pairing.PairingManager.handle(PairingManager.java:59) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.connections.HttpSession.handlePairSetup(HttpSession.java:109) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.connections.HttpSession.handleRequest(HttpSession.java:53) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.connections.ConnectionImpl.doHandleRequest(ConnectionImpl.java:54) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.connections.ConnectionImpl.handleRequest(ConnectionImpl.java:47) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.http.impl.AccessoryHandler.channelRead0(AccessoryHandler.java:52) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.http.impl.AccessoryHandler.channelRead0(AccessoryHandler.java:17) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [274:io.netty.transport:4.1.34.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359) [274:io.netty.transport:4.1.34.Final] at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:38) [274:io.netty.transport:4.1.34.Final] at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:350) [274:io.netty.transport:4.1.34.Final] at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) [271:io.netty.common:4.1.34.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905) [271:io.netty.common:4.1.34.Final] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [271:io.netty.common:4.1.34.Final] at java.lang.Thread.run(Thread.java:748) [?:?]
home app has different functions for initial devices load (json parsing) and for device updates.
the initial load is more strict if something not exactly to specification it just stops. the procedure was change with ios13.
what helps - start with a small set of device, e.g. lights, do initial load / add bridge, add more device afterwards.
e.g. there was an issue with thermostat. i add first light and then thermostats.
if you have time, please try to figure out which device exactly is making issue (but trying to bridge with one device with two, etc), so that we can fix it.
home app has different functions for initial devices load (json parsing) and for device updates.
the initial load is more strict if something not exactly to specification it just stops. the procedure was change with ios13.
what helps - start with a small set of device, e.g. lights, do initial load / add bridge, add more device afterwards.
e.g. there was an issue with thermostat. i add first light and then thermostats.
if you have time, please try to figure out which device exactly is making issue (but trying to bridge with one device with two, etc), so that we can fix it.
Hey nice catch. But I even tried adding a bridge without any devices and that did not work as well. :(
Hey nice catch. But I even tried adding a bridge without any devices and that did not work as well. :(
and was it working on ios12? maybe something on the network level.
enable logging with
ssh -p 8101 openhab@localhost
default password is (habopen)
log:set DEBUG org.openhab.io.homekit
log:set DEBUG io.github.hapjava
and you should see the request from the phone in openhab.log
Hey nice catch. But I even tried adding a bridge without any devices and that did not work as well. :(
and was it working on ios12? maybe something on the network level.
enable logging with
ssh -p 8101 openhab@localhost
default password is (habopen)
log:set DEBUG org.openhab.io.homekit
log:set DEBUG io.github.hapjava
and you should see the request from the phone in openhab.log
if you have time, please try to figure out which device exactly is making issue (but trying to bridge with one device with two, etc), so that we can fix it.
Honestly, I gave up with this.
I installed v2.4.0-homekit-6 (https://github.com/hap-java/openhab2-addons/releases/), which didn't work with iOS 13 either. So I booted up an old iOS 12 device, added everything flawlessly on the first try and now I'm happy I have my smart home stuff working again.
I have thermostats, lights (on/off and dimmable), a temperature sensor and door/window sensors - if that helps.
I have the same issue. I use the source code from here with a simple java main (from samples branch) but i am unable to bind with my iPhone. But it seams that some kind of timeout happen.
If i couple with on iPhone using iOS 12 it work but the iOS 13 devices still dont have access.
Didt some one mage to get it run? Or is someone looking for an solution.
i got it working. i have around 90 devices of all different types and it works perfect with ios13 as well as with latest Ipados and tvOs.
my changes are merged to master branch here, but it looks like they dont work for everyone.
i got it working. i have around 90 devices of all different types and it works perfect with ios13 as well as with latest Ipados and tvOs.
my changes are merged to master branch here, but it looks like they dont work for everyone.
Doesn't work for me. Pairing completes, the service says it's re-registering, and then removeUser is called and the device says the process failed. iOS 13.3.1. I already tried with and without re-registering the service, but to no avail.
What I find strange is that the request for accessories is received BEFORE the service is re-registering itself. Could this be the problem? Is there maybe a better way like updating the service instead of re-registering it (by using ServiceInfo.setText)? Or re-register the service immediately after sending the final pairing response, so that the service is ready when the next request comes?
Update: if I remove the MockSwitch and just create the bridge, I can add the bridge successfully. So it must have something to do with the device. I already checked the JSON and it's identical to the one posted here for a successful attempt. No null or anything strange. Any idea?
in the older iOS i had to remove "home" and create again time-to-time to get rid of some strange issues. but with ios 13.3.x i could repeat pairing many times without getting any issues.
can you now add the device? without removing the bridge and home. just add device and restart the sample.
i did recently the refactoring of HAP in order to add support for optional attributes. the changes are not merged yet, but it would be interesting to know whether you get the same issue with a newer version.
Hmm, the jar is only 10 kb and doesn't seem to work? And building it myself would require updating the library, too, because the sample uses parameters for createBridge that I haven't seen before ;-)
Hmm, ok, that one works, so the error is probably somewhere on my side. Ok, here's what I'm trying to do: I'm triyng to get HAP-Java working with IKVM in C#/.NET. Which seems to work for the most part, but I have no idea why it fails on this "small" detail.
If you have time, I have put the logs of both your sample and mine (using the same, cross-compiled 2.0 jar). Apart from the logging difference, I can't make out much difference, only that your's works and mine doesn't :-(
After numerous attempts and switching of library versions, I finally got it working. In the end, the problem was one single character in the Json file ;-) I returned a .NET bool for the power state, which converted to "False" instead of "false". doh ;-)
Hi, I hope I didn't miss it in the discussion: in which version is this expected to be fixed?
As far as I can tell right now, I tried both 1.1.3 and then 1.1.5 and in both of them the pairing does not work with iOS 13.x. It happened to me once from like 20-30 attempts that it worked, but it was literally just once.
Is there a plan to port the fix to the original 1.1.x "beowulfe" series? Or do I have to eventually migrate to the 1.2.x series? I am using HAP Java 1.1.x as a "driver" for HAP Scala and my derived personal projects.
Probably never mind. So far it seems that the migration to 1.2 is extremely smooth. I will hopefully not need the older versions. (But maybe somebody else will?)
Activity
leonborko commentedon Nov 1, 2019
I have the same problem
ccutrer commentedon Nov 1, 2019
are you running the latest code from HAP-Java, including 0201d9a ? That should fix iOS 13. If you're using it within OpenHAB, you might want to check out https://github.com/ccutrer/openhab2-addons/releases/tag/2.5.0-cody2 (but with caveats). Otherwise, you'll need to compile and drop latest HAP-Java into whatever other project yourself; there's not a new release yet.
J-N-K commentedon Nov 1, 2019
Pairing is not working for me, too. It seems that netty closes the connection too early. I added some Thread.sleep and it helped to get some steps further, but finally failed.
christiantschoerner commentedon Nov 1, 2019
Compiled current code but same issue :/.
frank-f commentedon Nov 1, 2019
I'm having the same issue. I'm seeing the following error when I try to pair my phone to openHAB:
2019-11-01 23:09:59.435 [ERROR] [.hapjava.impl.pairing.PairingManager] - Exception while finalizing pairing org.bouncycastle.crypto.tls.TlsFatalAlert: bad_record_mac(20) at io.github.hapjava.impl.crypto.ChachaDecoder.decodeCiphertext(ChachaDecoder.java:31) ~[299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.crypto.ChachaDecoder.decodeCiphertext(ChachaDecoder.java:41) ~[299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.pairing.FinalPairHandler.decrypt(FinalPairHandler.java:44) ~[299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.pairing.FinalPairHandler.handle(FinalPairHandler.java:39) ~[299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.pairing.PairingManager.handle(PairingManager.java:59) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.connections.HttpSession.handlePairSetup(HttpSession.java:109) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.connections.HttpSession.handleRequest(HttpSession.java:53) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.connections.ConnectionImpl.doHandleRequest(ConnectionImpl.java:54) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.connections.ConnectionImpl.handleRequest(ConnectionImpl.java:47) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.http.impl.AccessoryHandler.channelRead0(AccessoryHandler.java:52) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.github.hapjava.impl.http.impl.AccessoryHandler.channelRead0(AccessoryHandler.java:17) [299:org.openhab.io.homekit:2.5.0.201911012204] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [274:io.netty.transport:4.1.34.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359) [274:io.netty.transport:4.1.34.Final] at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:38) [274:io.netty.transport:4.1.34.Final] at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:350) [274:io.netty.transport:4.1.34.Final] at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) [271:io.netty.common:4.1.34.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905) [271:io.netty.common:4.1.34.Final] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [271:io.netty.common:4.1.34.Final] at java.lang.Thread.run(Thread.java:748) [?:?]J-N-K commentedon Nov 1, 2019
@frank-f this is with an upgraded bcprov, right? That‘s not working.
frank-f commentedon Nov 1, 2019
@J-N-K I finally got the version from your repo to compile - it's that one.
Edit: I downgraded bcprov in your fork back to 1.51 - it's not working like that either.
yfre commentedon Nov 3, 2019
home app has different functions for initial devices load (json parsing) and for device updates.
the initial load is more strict if something not exactly to specification it just stops. the procedure was change with ios13.
what helps - start with a small set of device, e.g. lights, do initial load / add bridge, add more device afterwards.
e.g. there was an issue with thermostat. i add first light and then thermostats.
if you have time, please try to figure out which device exactly is making issue (but trying to bridge with one device with two, etc), so that we can fix it.
christiantschoerner commentedon Nov 3, 2019
Hey nice catch. But I even tried adding a bridge without any devices and that did not work as well. :(
yfre commentedon Nov 3, 2019
default password is (habopen)
and you should see the request from the phone in openhab.log
christiantschoerner commentedon Nov 3, 2019
I am not using openHAB I am using it as Library
frank-f commentedon Nov 3, 2019
Honestly, I gave up with this.
I installed v2.4.0-homekit-6 (https://github.com/hap-java/openhab2-addons/releases/), which didn't work with iOS 13 either. So I booted up an old iOS 12 device, added everything flawlessly on the first try and now I'm happy I have my smart home stuff working again.
I have thermostats, lights (on/off and dimmable), a temperature sensor and door/window sensors - if that helps.
GreenRover commentedon Nov 9, 2019
I have the same issue. I use the source code from here with a simple java main (from samples branch) but i am unable to bind with my iPhone. But it seams that some kind of timeout happen.
If i couple with on iPhone using iOS 12 it work but the iOS 13 devices still dont have access.
Didt some one mage to get it run? Or is someone looking for an solution.
I also tryed:
https://github.com/timcharper/HAP-Java
https://github.com/ccutrer/HAP-Java
yfre commentedon Nov 9, 2019
i got it working. i have around 90 devices of all different types and it works perfect with ios13 as well as with latest Ipados and tvOs.
my changes are merged to master branch here, but it looks like they dont work for everyone.
if you want to give a try,
https://1drv.ms/u/s!AqqiEfFRr6WAgYQ8qsC_kZS6jTCsDw?e=W2z9kX
https://1drv.ms/u/s!AqqiEfFRr6WAgYQ-iybGMnJ0B6GYRQ?e=A4awvN
the repos
https://github.com/yfre/HAP-Java
https://github.com/yfre/openhab2-addons/tree/2.4.0/new_devices
christiantschoerner commentedon Nov 9, 2019
Does not work for me :(
28 remaining items
yfre commentedon Mar 25, 2020
cool! added firewall to my checklist :)
obartelt commentedon Mar 31, 2020
Doesn't work for me. Pairing completes, the service says it's re-registering, and then removeUser is called and the device says the process failed. iOS 13.3.1. I already tried with and without re-registering the service, but to no avail.
What I find strange is that the request for accessories is received BEFORE the service is re-registering itself. Could this be the problem? Is there maybe a better way like updating the service instead of re-registering it (by using ServiceInfo.setText)? Or re-register the service immediately after sending the final pairing response, so that the service is ready when the next request comes?
obartelt commentedon Mar 31, 2020
Update: if I remove the MockSwitch and just create the bridge, I can add the bridge successfully. So it must have something to do with the device. I already checked the JSON and it's identical to the one posted here for a successful attempt. No null or anything strange. Any idea?
yfre commentedon Mar 31, 2020
in the older iOS i had to remove "home" and create again time-to-time to get rid of some strange issues. but with ios 13.3.x i could repeat pairing many times without getting any issues.
can you now add the device? without removing the bridge and home. just add device and restart the sample.
obartelt commentedon Mar 31, 2020
No, I can't, because I have to search again and then the bridge isn't found, because it's paired :-(
I also cleared Home completely, but that changes nothing. Any info I can provide?
yfre commentedon Mar 31, 2020
i did recently the refactoring of HAP in order to add support for optional attributes. the changes are not merged yet, but it would be interesting to know whether you get the same issue with a newer version.
could you maybe try run the sample that is based on the refactored version?
you can download it here
https://1drv.ms/u/s!AqqiEfFRr6WAgYgRlv15LrGLAPkq8g?e=UsqzQ2
and run with " java -jar target/hap-sample-0.0.2-SNAPSHOT.jar"
or build it yourself form #102
obartelt commentedon Mar 31, 2020
Hmm, the jar is only 10 kb and doesn't seem to work? And building it myself would require updating the library, too, because the sample uses parameters for createBridge that I haven't seen before ;-)
yfre commentedon Mar 31, 2020
you are right. the libs are missing.
so, i have ziped the target folder with zip and jar.
if you have time, could you please try it one more time
https://1drv.ms/u/s!AqqiEfFRr6WAgYgSE-Tb84IKu4ev9A?e=vwozRf
obartelt commentedon Mar 31, 2020
Hmm, ok, that one works, so the error is probably somewhere on my side. Ok, here's what I'm trying to do: I'm triyng to get HAP-Java working with IKVM in C#/.NET. Which seems to work for the most part, but I have no idea why it fails on this "small" detail.
If you have time, I have put the logs of both your sample and mine (using the same, cross-compiled 2.0 jar). Apart from the logging difference, I can't make out much difference, only that your's works and mine doesn't :-(
https://1drv.ms/u/s!AtK4xQ8gVYfFmF4oiRQcptvbOPZ1?e=1q1JgT
obartelt commentedon Apr 2, 2020
After numerous attempts and switching of library versions, I finally got it working. In the end, the problem was one single character in the Json file ;-) I returned a .NET bool for the power state, which converted to "False" instead of "false". doh ;-)
Otah commentedon Apr 21, 2020
Hi, I hope I didn't miss it in the discussion: in which version is this expected to be fixed?
As far as I can tell right now, I tried both 1.1.3 and then 1.1.5 and in both of them the pairing does not work with iOS 13.x. It happened to me once from like 20-30 attempts that it worked, but it was literally just once.
Is there a plan to port the fix to the original 1.1.x "beowulfe" series? Or do I have to eventually migrate to the 1.2.x series? I am using HAP Java 1.1.x as a "driver" for HAP Scala and my derived personal projects.
Otah commentedon Apr 22, 2020
Probably never mind. So far it seems that the migration to 1.2 is extremely smooth. I will hopefully not need the older versions. (But maybe somebody else will?)
changes from HAP 2.1.0
yfre commentedon Jan 31, 2022
closing as obsolete