openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.57k forks source link

[HomeKit] Supporting new iOS 10 HomeKit accessories #1255

Closed grouchal closed 5 years ago

grouchal commented 7 years ago

iOS 10 now supports many accessories that are not currently supported by openhab:

I would happily contribute and work on extending the plugin to support some of these especially:

Has anyone started this? If so how can I get in touch and plan the work?

cc @beowulfe

andylintner commented 7 years ago

@grouchal - the biggest barrier right now is figuring out how to extend the ESH ontology. I actually have garage doors and shades implemented in my development branch here, with placeholder tags: https://github.com/beowulfe/openhab2/tree/homekit

The discussion on extending the ontology is happening here, feel free to chime in if you have any ideas: https://github.com/eclipse/smarthome/issues/1093

grouchal commented 7 years ago

@beowulfe your branch looks great - could you point me to instructions on how to build and install the bundle please. I would be very happy if I could just controls my blinds for now.

grouchal commented 7 years ago

Or alternately @beowulfe could you provide a version of the bundle jar that I could try out with b4?

andylintner commented 7 years ago

http://docs.openhab.org/developers/ has what you need to get started.

grouchal commented 7 years ago

@beowulfe it took me a while but I have built the JAR and got it installed on the server. I have a config file with :

Group Office_BLeft "Office Left Blind" (Office) [ "WindowCovering" ] Rollershutter Office_Blinds_Left "Office Blinds Left" (Office_BLeft) [ "homekit:position" ]

However I am having no luck.

I know that the bundle is installed because bundle:list gives me:

194 | Active | 80 | 2.0.0.201609261803 | HomeKit Integration

Is there anything obvious that I might be doing wrong?

grouchal commented 7 years ago

@beowulfe OK solved it - was not building the correct version ;-)

grouchal commented 7 years ago

@beowulfe all works fairly well with the rollershutters. I am getting lots of instability with the plugin now though, my iOS devices often show updating for the state of the various accessories.

I am not sure if this related to the state of the implementation or related to the fact I have 59 accessories going via the bridge now. Any thoughts?

neohusky commented 7 years ago

I've currently got about 30 accessories and often get the updating status also.

grouchal commented 7 years ago

Ah OK - I had 41 before I added the RollerShutters / WindowCoverings and with 59 it really seems to struggle. Only with Status updates though all commands seem to go through correctly.

TimWeyand commented 7 years ago

Is there any update on this issue? Will the accessories type extension be available in the next Beta? Is there any movement in https://github.com/eclipse/smarthome/issues/1093 "behind closed doors"?

kaikreuzer commented 7 years ago

Is there any movement in eclipse/smarthome#1093 "behind closed doors"?

No, I am still waiting for responses on my last post on that issue.

andylintner commented 7 years ago

Sorry @kaikreuzer - I somehow missed your reply. I replied on that thread now.

grouchal commented 7 years ago

@beowulfe @kaikreuzer any updates here? Would be great to know this will be finalised in the upcoming release candidates. Happy to help with this if I can.

kaikreuzer commented 7 years ago

Simply check https://github.com/eclipse/smarthome/issues/1093 for the status - no progress yet, sorry.

amp-man commented 7 years ago

@grouchal It would be really nice to get your pre-built jar extension. Is there any way you could provide that? Thanks in advance.

flyingartichoke commented 7 years ago

Are there any updates on getting OpenHAB support for the other HomeKit accessories in this list? I am particularly keen on getting fans (with adjustable speeds) and sensors operational.

grouchal commented 7 years ago

According to eclipse/smarthome#1093

we are waiting for @kaikreuzer to do some reading and provide answers:

@grouchal & @EjvindHald: I still have to read the comments in detail, think about them and continue the discussion - I didn't yet find the time. Anybody is invited to make suggestions on the best way forward; so if you have brilliant ideas, please don't keep them for yourselves.

alexus1211 commented 7 years ago

@grouchal: regarding your blog from September 26, are you sure that the child tag for the rollershutter item is called ["homekit:position"] or simply ["position"]? I was checking the code from the dev branch mentioned by @beowulfe and I couldn't find any reference tohomekit:position. The only child tag with the homekitprefix is homekit:HeatingCoolingMode.

Thanks in advance

matushromada commented 7 years ago

I don't know if you heard it, but a week ago Apple released complete specification for HomeKit for Hobbyists and Makers available here https://developer.apple.com/homekit/ maybe it will help. But I see that this discussion is more about ESH, but posting anyway.

kaikreuzer commented 7 years ago

@matushromada Yes, thanks, we have heard, see https://community.openhab.org/t/homekit-specs-now-open-for-non-commercial-use/2964.

chri46 commented 7 years ago

When to expect first binding which will support additional accessories - mainly shades are of interest.

grouchal commented 7 years ago

@chri46 I have given up on this moving forward in the near future - it is waiting on @kaikreuzer and eclipse/smarthome#1093 which seems to be permanently stuck. I have offered help to @beowulfe and @kaikreuzer before but the problem seems to be bigger than just HomeKit and everything is stuck until they have worked out a new concept which has taken nearly a year so far.

kaikreuzer commented 7 years ago

it is waiting on @kaikreuzer and eclipse/smarthome#1093

Nope. It is waiting for your input on https://github.com/eclipse/smarthome/issues/3692.

hakan42 commented 7 years ago

The community link seems to be https://community.openhab.org/t/homekit-specs-now-open-for-non-commercial-use/29647

grouchal commented 7 years ago

@beowulfe & @speedmaxx so how can we get this moving again and create something stable before iOS 11 hits the mainstream?

Am happy to provide development and testing support.

I would rely on @beowulfe to suggest the temporary tagging format as he has the most experience here.

Let’s get this moving again.....

SpeedmaxX commented 7 years ago

yes, @grouchal , I'd like to help, too. @beowulfe , what can we do to help?

Testing is no problem, OH2-developing is not yet my hobbyhorse, so, there I'm not really able to support you.

SpeedmaxX commented 6 years ago

@beowulfe Hi, did you already had time to take a closer look to the published homekit documentation?

matushromada commented 6 years ago

Guys, we should support it here Homekit Bounty

piejanssens commented 6 years ago

Stunning, less than a month to go before this issue is 1 year old.

SpeedmaxX commented 6 years ago

Hi, @beowulfe has Updated the base homekit library to 1.1.4

https://github.com/beowulfe/openhab2/releases/tag/homekit-1.1.4

Mr-iX commented 6 years ago

@SpeedmaxX Means that when I install this PreRelease, I can use the Rollershutter items? When yes, which tags need I?

SpeedmaxX commented 6 years ago

Hi, don‘t know yet. Cannot test until tuesday

andylintner commented 6 years ago

No, that version is a bugfix for accessories losing their client-side information (i.e. the rooms you've defined for your accessories in a homekit app). It doesn't have any new accessory types. You can follow the discussion on the bug here: https://github.com/openhab/openhab2-addons/issues/929

Mr-iX commented 6 years ago

@beowulfe Thanks for the clarification. Where can I get a version with the added accessories, so that I can use my rollershutters, while the discussion goes on and on.

andylintner commented 6 years ago

I don't have a working version that supports this. I did at one point, but it's broken with updates. I'm reluctant to put much work into it until we've settled on how to map items to homekit accessories - I'd potentially be doing a lot of work that's ultimately thrown away.

Mr-iX commented 6 years ago

I understand your point. Hopefully there will be a decision in the near future.

I really understand people who switch to a other Smart Home system, because for a normal end user this is unbelievable.

reyem commented 6 years ago
I'm reluctant to put much work into it until we've settled on how to map items to homekit accessories

Following this for a while, it does not look promissing for the near future. I see 2 relatively low effort options to get OH2 and Homekit usable for most end users:

A) simply add rollershutter support to the existing binding. Altough other Accessoires might be desirable, rollershutters are the biggest gap affecting most end users.

B) somebody could invest limited time to get homebridge working with OH2. Then there would at least be a workaround available for the time required for the "clean" OH2 Solution....

andylintner commented 6 years ago

I think there's actually been some recent progress on the dependency - I'm cautiously optimistic.

That said, I started a branch that adds support for WindowCoverings. It's pre-pre-alpha, totally unsupported, and any configuration changes you make to support them probably won't continue to work when we finalize the design. It only supports position via a Rollershutter - no vane controls. The release is here: https://github.com/beowulfe/openhab2/releases/tag/homekit-new-accessories-1

Use it at your own risk. Tag the Rollershutter item with "Blinds"

Mr-iX commented 6 years ago

Now I have installed the Homekit Addon and the rollershutters were successfully added to the Home App. The problem is that I cannot turn them up or down. The status in the Home App and in OpenHAB changes, but there is no command sent to my KNX rollershutters. And the status of OpenHAB is reversed. When they are open, Homekit says that they are closed.

OpenHAB Log:


00000000 50 00 25 4C 2E 47 60 28 63 07 E3 5E FD C6 72 3C P.%L.G`(c..^..r<
00000010 36 16 10 6D 87 1B 09 46 D0 FE A7 1D 25 02 69 BE 6..m...F....%.i.
00000020 56 96 28 0C F9 03 58 CF F1 2A 34 06 DA 80 26 13 V.(...X..*4...&.
00000030 A1 B1 60 19 11 3F 0A 09 08 1B 72 5E 03 7B 7D F6 ..`..?....r^.{}.
00000040 53 28 6C A6 6B 5A D0 A9 8E 99 13 54 04 9D B6 E7 S(l.kZ.....T....
00000050 40 DB 8D 96 FA 62 B7 C2 B7 19 0B D8 CA 0F DA A8 @....b..........
00000060 62 99                                           b.

2017-10-02 09:52:15.207 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Received message of length 98. Existing buffer is 0
2017-10-02 09:52:15.208 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Attempting to read message of length 98
2017-10-02 09:52:15.210 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Read complete message
2017-10-02 09:52:15.211 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Returning 1 results
2017-10-02 09:52:15.212 [TRACE] [lfe.hap.impl.http.impl.BinaryHandler] - Received data [/192.168.6.39:55302]:
00000000 47 45 54 20 2F 63 68 61 72 61 63 74 65 72 69 73 GET /characteris
00000010 74 69 63 73 3F 69 64 3D 34 34 39 36 33 35 37 39 tics?id=44963579
00000020 38 2E 31 32 20 48 54 54 50 2F 31 2E 31 0D 0A 48 8.12 HTTP/1.1..H
00000030 6F 73 74 3A 20 6F 70 65 6E 48 41 42 2E 5F 68 61 ost: openHAB._ha
00000040 70 2E 5F 74 63 70 2E 6C 6F 63 61 6C 0D 0A 0D 0A p._tcp.local....

2017-10-02 09:52:15.215 [INFO ] [ap.impl.http.HomekitClientConnection] - 200 /characteristics?id=449635798.12
2017-10-02 09:52:15.216 [TRACE] [lfe.hap.impl.http.impl.BinaryHandler] - Sending data [/192.168.6.39:55302]:
00000000 48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D HTTP/1.1 200 OK.
00000010 0A 43 6F 6E 74 65 6E 74 2D 74 79 70 65 3A 20 61 .Content-type: a
00000020 70 70 6C 69 63 61 74 69 6F 6E 2F 68 61 70 2B 6A pplication/hap+j
00000030 73 6F 6E 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 6E son..Content-Len
00000040 67 74 68 3A 20 35 38 0D 0A 43 6F 6E 6E 65 63 74 gth: 58..Connect
00000050 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D ion: keep-alive.
00000060 0A 0D 0A 7B 22 63 68 61 72 61 63 74 65 72 69 73 ...{"characteris
00000070 74 69 63 73 22 3A 5B 7B 22 76 61 6C 75 65 22 3A tics":[{"value":
00000080 30 2C 22 61 69 64 22 3A 34 34 39 36 33 35 37 39 0,"aid":44963579
00000090 38 2C 22 69 69 64 22 3A 31 32 7D 5D 7D          8,"iid":12}]}

2017-10-02 09:52:15.218 [TRACE] [pl.http.impl.NettyHomekitHttpService] - WRITE UnpooledUnsafeDirectByteBuf(ridx: 0, widx: 175, cap: 256) [/192.168.6.39:55302]:
00000000 9D 00 4E 9A 62 52 C0 98 8A D1 F3 82 9C BA BE 6B ..N.bR.........k
00000010 A1 CB 8B 7C EA 9E D6 83 B9 08 EC 9A EA 44 97 C5 ...|.........D..
00000020 BB 49 1F 0E 55 30 81 BD FA FE 46 F5 BE 68 1C 53 .I..U0....F..h.S
00000030 68 EF BF 2F 82 1B 94 03 87 FC A2 F3 26 B9 F4 03 h../........&...
00000040 C6 7B A7 81 FD 29 94 82 E5 6E 57 E9 47 F2 57 9E .{...)...nW.G.W.
00000050 36 9A 62 C8 EB D9 03 A2 36 19 96 88 66 34 DE 64 6.b.....6...f4.d
00000060 5C 50 3C 5D 27 8C 9C 44 CC BA F9 20 2E 9B AF 7D \P<]'..D... ...}
00000070 C9 AA 6A EC 72 DC 12 1F F9 21 24 0F 8B 05 35 99 ..j.r....!$...5.
00000080 93 15 26 C0 61 68 7B 8A BA F5 65 52 BB C9 1C A7 ..&.ah{...eR....
00000090 F6 F7 6E 75 03 39 4E 70 CE D0 10 B4 85 75 F2 B0 ..nu.9Np.....u..
000000A0 0D 4B BD 31 A5 28 20 D1 71 B4 D3 D7 1D 51 DB    .K.1.( .q....Q.

2017-10-02 09:52:15.270 [TRACE] [pl.http.impl.NettyHomekitHttpService] - READ UnpooledUnsafeDirectByteBuf(ridx: 0, widx: 198, cap: 432) [/192.168.6.39:55302]:
00000000 B4 00 DD 01 A6 62 1A 6A 54 FA 61 D7 DA F7 30 4C .....b.jT.a...0L
00000010 62 89 02 B1 4E 2B 78 3F D5 0B 55 3A EF 7C AE 7B b...N+x?..U:.|.{
00000020 77 63 7F 7C E6 FB 07 3F ED 9A A1 4F 6B 5C AF DE wc.|...?...Ok\..
00000030 6E DF 79 31 C6 49 B2 22 E7 19 A5 BB 23 B9 85 8B n.y1.I."....#...
00000040 EB 03 68 6D BB EB FD 81 14 70 00 57 90 38 D3 FE ..hm.....p.W.8..
00000050 63 A0 F2 33 CE 99 24 75 AD C4 FE 59 ED 02 D8 36 c..3..$u...Y...6
00000060 03 9C F8 E3 A6 76 53 72 A4 CB 1E 09 DB 59 4A 44 .....vSr.....YJD
00000070 F6 95 8E DC F4 12 5C FF 8E 2D 51 DC 9E 6D F2 66 ......\..-Q..m.f
00000080 E4 DE D3 5D C7 7D 83 FA A4 54 06 51 8F 1E A7 07 ...].}...T.Q....
00000090 71 6F DE 30 67 64 F6 18 D0 8F 7A EB 37 EF 34 11 qo.0gd....z.7.4.
000000A0 AE F4 C5 2F 0A 13 0C 50 A2 B9 20 D0 82 A1 A8 AF .../...P.. .....
000000B0 78 39 BF 4F 9D 98 47 6B 15 A4 00 F8 FC DE 72 CA x9.O..Gk......r.
000000C0 33 DD FB 25 FF EC                               3..%..

2017-10-02 09:52:15.272 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Received message of length 198. Existing buffer is 0
2017-10-02 09:52:15.273 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Attempting to read message of length 198
2017-10-02 09:52:15.274 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Read complete message
2017-10-02 09:52:15.279 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Returning 1 results
2017-10-02 09:52:15.281 [TRACE] [lfe.hap.impl.http.impl.BinaryHandler] - Received data [/192.168.6.39:55302]:
00000000 50 55 54 20 2F 63 68 61 72 61 63 74 65 72 69 73 PUT /characteris
00000010 74 69 63 73 20 48 54 54 50 2F 31 2E 31 0D 0A 48 tics HTTP/1.1..H
00000020 6F 73 74 3A 20 6F 70 65 6E 48 41 42 2E 5F 68 61 ost: openHAB._ha
00000030 70 2E 5F 74 63 70 2E 6C 6F 63 61 6C 0D 0A 43 6F p._tcp.local..Co
00000040 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 36 30 ntent-Length: 60
00000050 0D 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20 ..Content-Type: 
00000060 61 70 70 6C 69 63 61 74 69 6F 6E 2F 68 61 70 2B application/hap+
00000070 6A 73 6F 6E 0D 0A 0D 0A 7B 22 63 68 61 72 61 63 json....{"charac
00000080 74 65 72 69 73 74 69 63 73 22 3A 5B 7B 22 61 69 teristics":[{"ai
00000090 64 22 3A 34 34 39 36 33 35 37 39 38 2C 22 69 69 d":449635798,"ii
000000A0 64 22 3A 31 32 2C 22 76 61 6C 75 65 22 3A 31 30 d":12,"value":10
000000B0 30 7D 5D 7D                                     0}]}

2017-10-02 09:52:15.284 [INFO ] [ap.impl.http.HomekitClientConnection] - 204 /characteristics
2017-10-02 09:52:15.289 [INFO ] [impl.connections.SubscriptionManager] - Publishing changes for 449635798
2017-10-02 09:52:15.288 [INFO ] [impl.connections.SubscriptionManager] - Publishing changes for 449635798
2017-10-02 09:52:15.293 [TRACE] [lfe.hap.impl.http.impl.BinaryHandler] - Sending data [/192.168.6.39:55302]:
00000000 48 54 54 50 2F 31 2E 31 20 32 30 34 20 4E 6F 20 HTTP/1.1 204 No 
00000010 43 6F 6E 74 65 6E 74 0D 0A 43 6F 6E 74 65 6E 74 Content..Content
00000020 2D 74 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 -type: applicati
00000030 6F 6E 2F 68 61 70 2B 6A 73 6F 6E 0D 0A 43 6F 6E on/hap+json..Con
00000040 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 30 0D 0A tent-Length: 0..
00000050 43 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 Connection: keep
00000060 2D 61 6C 69 76 65 0D 0A 0D 0A                   -alive....

2017-10-02 09:52:15.298 [TRACE] [pl.http.impl.NettyHomekitHttpService] - WRITE UnpooledUnsafeDirectByteBuf(ridx: 0, widx: 124, cap: 256) [/192.168.6.39:55302]:
00000000 6A 00 9C 35 A3 5A 0A 53 67 CA 33 79 99 74 80 E6 j..5.Z.Sg.3y.t..
00000010 6F B4 1F BB B0 26 B5 DB A3 42 C1 11 09 5A 1E F7 o....&...B...Z..
00000020 34 52 53 0F 71 6F 28 CC E8 0A 0E 42 08 ED A3 53 4RS.qo(....B...S
00000030 FF 40 7E 16 BC 09 D9 18 AB 3B 88 85 F2 DF DE E3 .@~......;......
00000040 CF 3F B2 B7 36 86 9F F1 B9 26 39 D5 70 92 29 77 .?..6....&9.p.)w
00000050 9E B5 E1 63 1C 52 A4 E2 DF CE 4C 7D 79 F4 9D 9A ...c.R....L}y...
00000060 AA 87 D6 A9 6A F3 97 F4 CF C0 3E A1 10 94 F7 A3 ....j.....>.....
00000070 56 44 73 78 AD 9D 9E 36 7A 26 BB 90             VDsx...6z&..

2017-10-02 09:52:15.303 [INFO ] [impl.connections.SubscriptionManager] - Publishing changes for 449635798
2017-10-02 09:52:15.302 [INFO ] [impl.connections.SubscriptionManager] - Publishing changes for 449635798
2017-10-02 09:52:15.301 [INFO ] [impl.connections.SubscriptionManager] - Publishing changes for 449635798
2017-10-02 09:52:15.300 [INFO ] [impl.connections.SubscriptionManager] - Publishing changes for 449635798
2017-10-02 09:52:15.317 [TRACE] [lfe.hap.impl.http.impl.BinaryHandler] - Sending data [/192.168.6.39:55302]:
00000000 45 56 45 4E 54 2F 31 2E 30 20 32 30 30 20 4F 4B EVENT/1.0 200 OK
00000010 0D 0A 43 6F 6E 74 65 6E 74 2D 74 79 70 65 3A 20 ..Content-type: 
00000020 61 70 70 6C 69 63 61 74 69 6F 6E 2F 68 61 70 2B application/hap+
00000030 6A 73 6F 6E 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 json..Content-Le
00000040 6E 67 74 68 3A 20 36 30 0D 0A 43 6F 6E 6E 65 63 ngth: 60..Connec
00000050 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 tion: keep-alive
00000060 0D 0A 0D 0A 7B 22 63 68 61 72 61 63 74 65 72 69 ....{"characteri
00000070 73 74 69 63 73 22 3A 5B 7B 22 61 69 64 22 3A 34 stics":[{"aid":4
00000080 34 39 36 33 35 37 39 38 2C 22 69 69 64 22 3A 31 49635798,"iid":1
00000090 32 2C 22 76 61 6C 75 65 22 3A 31 30 30 7D 5D 7D 2,"value":100}]}

2017-10-02 09:52:15.326 [TRACE] [pl.http.impl.NettyHomekitHttpService] - WRITE UnpooledUnsafeDirectByteBuf(ridx: 0, widx: 178, cap: 256) [/192.168.6.39:55302]:
00000000 A0 00 29 41 FF CA 0D 32 93 1A 01 46 88 C9 DE 8A ..)A...2...F....
00000010 A2 07 FE 5A 4C DA DD 2E 9B D8 55 DE 8A C9 D7 EE ...ZL.....U.....
00000020 E2 A5 A4 FB 92 E2 1A E2 F3 3D B0 6C E6 A5 17 50 .........=.l...P
00000030 3F 91 2C 57 DA EA 31 67 A0 61 48 11 3F 68 4C 15 ?.,W..1g.aH.?hL.
00000040 05 49 28 97 4E DA 50 94 9B D0 1A 37 D3 07 B0 EE .I(.N.P....7....
00000050 A6 E4 23 6C 2F 01 0A 67 F0 8E DD E1 15 5C 12 1C ..#l/..g.....\..
00000060 8B 32 93 C4 2D 57 78 38 F8 D3 E8 13 A6 99 96 62 .2..-Wx8.......b
00000070 3D F6 17 69 AB F5 C6 38 77 C4 16 EB 76 86 09 CD =..i...8w...v...
00000080 6A 37 E4 22 91 DE C1 66 6F 47 4C B3 9F 0B 05 87 j7."...foGL.....
00000090 EA C6 CC 3D BC 0A B7 5E F0 57 96 71 44 8B FC D9 ...=...^.W.qD...
000000A0 65 E4 F8 66 5A 11 E8 C1 5A 18 C3 FC 10 78 74 2A e..fZ...Z....xt*
000000B0 5E 07                                           ^.

2017-10-02 09:52:15.329 [TRACE] [lfe.hap.impl.http.impl.BinaryHandler] - Sending data [/192.168.6.39:55302]:
00000000 45 56 45 4E 54 2F 31 2E 30 20 32 30 30 20 4F 4B EVENT/1.0 200 OK
00000010 0D 0A 43 6F 6E 74 65 6E 74 2D 74 79 70 65 3A 20 ..Content-type: 
00000020 61 70 70 6C 69 63 61 74 69 6F 6E 2F 68 61 70 2B application/hap+
00000030 6A 73 6F 6E 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 json..Content-Le
00000040 6E 67 74 68 3A 20 35 39 0D 0A 43 6F 6E 6E 65 63 ngth: 59..Connec
00000050 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 tion: keep-alive
00000060 0D 0A 0D 0A 7B 22 63 68 61 72 61 63 74 65 72 69 ....{"characteri
00000070 73 74 69 63 73 22 3A 5B 7B 22 61 69 64 22 3A 34 stics":[{"aid":4
00000080 34 39 36 33 35 37 39 38 2C 22 69 69 64 22 3A 39 49635798,"iid":9
00000090 2C 22 76 61 6C 75 65 22 3A 31 30 30 7D 5D 7D    ,"value":100}]}

2017-10-02 09:52:15.334 [TRACE] [pl.http.impl.NettyHomekitHttpService] - WRITE UnpooledUnsafeDirectByteBuf(ridx: 0, widx: 177, cap: 256) [/192.168.6.39:55302]:
00000000 9F 00 6F 2C 92 C8 51 FA 90 48 1C E7 33 20 FB BB ..o,..Q..H..3 ..
00000010 05 C8 B9 29 F1 1F 2A 9E 5E F3 03 3D 7B 9C C1 B8 ...)..*.^..={...
00000020 23 EC 13 B8 78 4D 8C F5 33 8C 5A 8F DE 3F 74 BB #...xM..3.Z..?t.
00000030 8B 7E 51 A7 30 81 40 69 D6 71 B9 25 9F D6 B9 3E .~Q.0.@i.q.%...>
00000040 4C 3F 2B CE 5C 40 8D E3 F5 07 61 1A B5 27 4E 9F L?+.\@....a..'N.
00000050 22 E4 B5 CC 28 A1 89 D3 F1 2F 7A 72 20 0E 2B 9A "...(..../zr .+.
00000060 29 E9 AF 06 C1 4E BF FE F2 4C 6F 2E FF 99 DC 12 )....N...Lo.....
00000070 56 13 18 5E 16 F3 D9 4B 70 6E FB AB 3C 28 2E 1A V..^...Kpn..<(..
00000080 B1 EC BC 2E E5 C1 E5 BF 96 C9 1F 0C F8 27 E8 47 .............'.G
00000090 40 C9 36 9A 17 23 B9 17 19 C4 C5 4B 9F B2 45 77 @.6..#.....K..Ew
000000A0 26 B2 8A BC F9 9A 0E 8C 16 E6 3D A4 0E 00 B0 BD &.........=.....
000000B0 B0                                              .

2017-10-02 09:52:15.337 [TRACE] [lfe.hap.impl.http.impl.BinaryHandler] - Sending data [/192.168.6.39:55302]:
00000000 45 56 45 4E 54 2F 31 2E 30 20 32 30 30 20 4F 4B EVENT/1.0 200 OK
00000010 0D 0A 43 6F 6E 74 65 6E 74 2D 74 79 70 65 3A 20 ..Content-type: 
00000020 61 70 70 6C 69 63 61 74 69 6F 6E 2F 68 61 70 2B application/hap+
00000030 6A 73 6F 6E 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 json..Content-Le
00000040 6E 67 74 68 3A 20 36 30 0D 0A 43 6F 6E 6E 65 63 ngth: 60..Connec
00000050 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 tion: keep-alive
00000060 0D 0A 0D 0A 7B 22 63 68 61 72 61 63 74 65 72 69 ....{"characteri
00000070 73 74 69 63 73 22 3A 5B 7B 22 61 69 64 22 3A 34 stics":[{"aid":4
00000080 34 39 36 33 35 37 39 38 2C 22 69 69 64 22 3A 31 49635798,"iid":1
00000090 32 2C 22 76 61 6C 75 65 22 3A 31 30 30 7D 5D 7D 2,"value":100}]}

2017-10-02 09:52:15.340 [TRACE] [pl.http.impl.NettyHomekitHttpService] - WRITE UnpooledUnsafeDirectByteBuf(ridx: 0, widx: 178, cap: 256) [/192.168.6.39:55302]:
00000000 A0 00 81 98 F9 92 DD F3 76 6D 2B AD 58 81 FE A8 ........vm+.X...
00000010 C7 33 E6 55 76 44 FA 8A 46 72 01 DA 63 AD 87 6B .3.UvD..Fr..c..k
00000020 F4 31 38 D2 62 AA 7E 6C E8 B8 5F 6D BA 0C BC C6 .18.b.~l.._m....
00000030 BA 8A 3A B8 0D 2C 6A 61 73 22 0E AD 8F 10 C7 34 ..:..,jas".....4
00000040 37 91 1D F7 DD 13 65 60 33 0B 76 C6 CD C6 CE AE 7.....e`3.v.....
00000050 44 54 20 2C C0 50 D9 70 8E CB E7 46 28 D1 F3 8D DT ,.P.p...F(...
00000060 DD 86 21 72 B3 A6 0F 93 E8 80 DB 9E F1 77 CD 87 ..!r.........w..
00000070 70 B6 7F FB 4A CD 87 AC 87 75 F8 66 3E 14 74 24 p...J....u.f>.t$
00000080 2E 07 1C 20 07 32 72 22 DA 65 15 32 AC 4D EE 12 ... .2r".e.2.M..
00000090 42 D5 EF CF 13 9F AD 57 84 F7 B4 E2 70 62 46 9D B......W....pbF.
000000A0 F4 45 AD C6 FF 6D 7D E5 51 65 B5 3A 93 3A 1C 3A .E...m}.Qe.:.:.:
000000B0 BB E3                                           ..

2017-10-02 09:52:15.346 [TRACE] [lfe.hap.impl.http.impl.BinaryHandler] - Sending data [/192.168.6.39:55302]:
00000000 45 56 45 4E 54 2F 31 2E 30 20 32 30 30 20 4F 4B EVENT/1.0 200 OK
00000010 0D 0A 43 6F 6E 74 65 6E 74 2D 74 79 70 65 3A 20 ..Content-type: 
00000020 61 70 70 6C 69 63 61 74 69 6F 6E 2F 68 61 70 2B application/hap+
00000030 6A 73 6F 6E 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 json..Content-Le
00000040 6E 67 74 68 3A 20 35 39 0D 0A 43 6F 6E 6E 65 63 ngth: 59..Connec
00000050 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 tion: keep-alive
00000060 0D 0A 0D 0A 7B 22 63 68 61 72 61 63 74 65 72 69 ....{"characteri
00000070 73 74 69 63 73 22 3A 5B 7B 22 61 69 64 22 3A 34 stics":[{"aid":4
00000080 34 39 36 33 35 37 39 38 2C 22 69 69 64 22 3A 39 49635798,"iid":9
00000090 2C 22 76 61 6C 75 65 22 3A 31 30 30 7D 5D 7D    ,"value":100}]}

2017-10-02 09:52:15.348 [TRACE] [pl.http.impl.NettyHomekitHttpService] - WRITE UnpooledUnsafeDirectByteBuf(ridx: 0, widx: 177, cap: 256) [/192.168.6.39:55302]:
00000000 9F 00 B9 47 C8 E6 B6 9D E2 4B 39 EE 12 74 5A 83 ...G.....K9..tZ.
00000010 60 8B 05 07 1D 8E AB 7B 46 3D E6 B5 75 92 7B B5 `......{F=..u.{.
00000020 E9 2B 94 AE BC 13 35 EB 0B C0 A3 A1 8E 39 9E D6 .+....5......9..
00000030 19 A7 81 21 5C 93 94 30 B6 D7 7B DC 76 2C 64 EB ...!\..0..{.v,d.
00000040 E4 61 FB DA 13 F7 AD 17 D0 F3 CD F8 31 D8 9F 42 .a..........1..B
00000050 2E A2 EB BA F5 41 D6 64 C5 0C 8F 59 40 F8 AD F7 .....A.d...Y@...
00000060 4C 0B E0 13 3D 05 C0 E2 AF 63 31 86 06 9B 97 B6 L...=....c1.....
00000070 0A 1F 85 C6 97 BD D9 31 2D F5 DA C0 8A 6A AE 21 .......1-....j.!
00000080 CB F0 0E 85 74 0F A6 36 38 CF B6 EF 10 47 C1 D0 ....t..68....G..
00000090 40 0E AE CF CC B9 21 B8 25 EE 88 52 0C 90 04 BA @.....!.%..R....
000000A0 6A 40 6B BB C9 9B E8 C2 AE 3A 8F 3D 77 EF 44 3F j@k......:.=w.D?
000000B0 4E                                              N
andylintner commented 6 years ago

For the reversed status - I just assumed Openhab's numbers matched Homekit's - 0 is fully closed, 100 is fully open. I did a brief scan of the documentation, and couldn't find anything. Maybe someone more knowledgeable than I can comment on what's expected.

As far as the blinds not reacting to the commands - I'm not sure. If it's updating in the OH UI, it must be receiving the command. Does KNX support targeting a specific position vs up/down commands?

Mr-iX commented 6 years ago

In my specific case they can only get the up and down command. Could that case also be realized?

Olivierr92500 commented 6 years ago

Thanks for driving things forward on this topic.

I installed release 2.2.0.201710012338 of HomeKit Integration on my Openhab 2.1 release by uninstalling the 2.1 release and placing the new jar file into /usr/share/openhab2/addons.

It is active under karaf bundle:list 225 | Active | 80 | 2.2.0.201710012338 | HomeKit Integration

But in the log I get the following error:

2017-10-03 19:47:10.718 [ERROR] [org.openhab.io.homekit              ] - [org.openhab.homekit(227)] The setItemRegistry method has thrown an exception
java.lang.NoSuchMethodError: org.eclipse.smarthome.core.items.ItemRegistry.get(Ljava/lang/Object;)Lorg/eclipse/smarthome/core/common/registry/Identifiable;
        at org.openhab.io.homekit.internal.HomekitTaggedItem.isMemberOfRootGroup(HomekitTaggedItem.java:118)
        at org.openhab.io.homekit.internal.HomekitTaggedItem.<init>(HomekitTaggedItem.java:44)
        at org.openhab.io.homekit.internal.HomekitChangeListener.added(HomekitChangeListener.java:36)
        at org.openhab.io.homekit.internal.HomekitChangeListener.lambda$0(HomekitChangeListener.java:77)
        at java.util.ArrayList.forEach(ArrayList.java:1249)[:1.8.0_144]
        at org.openhab.io.homekit.internal.HomekitChangeListener.setItemRegistry(HomekitChangeListener.java:77)
        at org.openhab.io.homekit.internal.HomekitImpl.setItemRegistry(HomekitImpl.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_144]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_144]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_144]
        at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_144]
        at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)
        at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)
        at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)
        at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)
        at org.apache.felix.scr.impl.inject.BindMethod.invoke(BindMethod.java:655)
        at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1722)
        at org.apache.felix.scr.impl.manager.DependencyManager.open(DependencyManager.java:1556)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:260)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:108)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:906)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:879)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:823)[31:org.apache.felix.scr:2.0.6]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_144]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService(ResourceTracker.java:39)[9:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253]
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)[org.osgi.core-6.0.0.jar:]
        at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

I have updated my raspberry pi with latest libraries and rebooted it but I still get the same error. Is there someting I am doing wrong?

Thanks

rinal13 commented 6 years ago

I got exactly the same error as Olivierr92500, but one addition after the error I got the message, as i activated the logging, "00:23:41.457 [INFO ] [com.beowulfe.hap.HomekitRoot ] - Added accessory openHAB" I also recognised that the command "openhab:homekit clearPairings" isn't working. It looks for me that at "HomekitTaggedItem.java" Line 119: Item groupItem = itemRegistry.get(groupName); it should be Line 119: Item groupItem = itemRegistry.getItem(groupName); as the "org.eclipse.smarthome.core.items.ItemRegistry" has not "get" Methode only "getItem"

May this helps to find the cause. Regards

andylintner commented 6 years ago

It won’t work with 2.1 - it’s built against the latest nightly 2.2.

Olivierr92500 commented 6 years ago

Thanks Beowulfe for your answer. I uninstalled 2.1 and installed 2.2.0-SNAPSHOT Build #1054 I removed the default homekit and installed the following: 10 │ Active │ 80 │ 2.2.0.201710012338 │ HomeKit Integration

When starting OpenHab, it does seem to load correctly: 2017-10-04 21:19:01.822 [INFO ] [omekit.internal.OpenhabHomekitBridge] - Reached homekit target state for version 3, starting No other related messages

But when I try to add a new device to my iPhone, it does not find the OpenHab bridge

I added more logs by setting log:set DEBUG omekit.internal.OpenhabHomekitBridge But after rebooting, I am not getting any more logs

Any clue?

rinal13 commented 6 years ago

For me it works, I only have to check the bticino binding, which I use, as it seams that the setpoint from the homekit blind, is not translated correctly to a command. Hope I find some time to do it in the next days.

Olivierr92500 commented 6 years ago

I think I found my problem. Not fully tested yet but I could have it to work with standard homebridge. It think the problem was related to pairing that I needed to be cleared when changing release.

smarthome:homekit clearPairings smarthome:homekit allowUnauthenticated true

I keep you posted with next results

Olivierr92500 commented 6 years ago

Making some progress. I can now start openhab with the modified jar and manage to pair Openhab with my iPhone However, I only get 2 devices when using the new jar vs the 4 I get with the standard one: -With the standard jar I get my 3 light switches plus my amplifier -With the new jar, I get only 1 light switch plus my amplifier (and still no rollershutter)

below my various items files with the items with homekit definition:

avr4000.items:Switch AV_FF_Salon "Ampli" [ "Switchable" ] {denon="avr4000#PW"} rollershuters.items:Rollershutter VR_FF_Bureau "VR Bureau" (FF_Bureau) [ "Blinds" ] { mochadx10="l9:pl" } switch.items:Switch LS_FF_Salon "Salon" (FF_Salon) [ "Lighting" ] {mqtt=">[mosquitto:cmnd/FF_LS1/light:command:ON:1],>[mosquitto:cmnd/FF_LS1/light:command:OFF:0],<[mosquitto:status/FF_LS1/light:state:MAP(binary.map)]", autoupdate="false"} switch.items:Switch LS_FF_Bureau "Bureau" (FF_Bureau) [ "Lighting" ] {mqtt=">[mosquitto:cmnd/LS_FF_Bureau/light:command:ON:1],>[mosquitto:cmnd/LS_FF_Bureau/light:command:OFF:0],<[mosquitto:status/LS_FF_Bureau/light:state:MAP(binary.map)]", autoupdate="false"} switch.items:Switch LS_FF_SdB "Salle de Bain" (FF_SdB) [ "Lighting" ] {mqtt=">[mosquitto:cmnd/LS_FF_SdB/light:command:ON:1],>[mosquitto:cmnd/LS_FF_SdB/light:command:OFF:0],<[mosquitto:status/LS_FF_SdB/light:state:MAP(binary.map)]", autoupdate="false"}

kaikreuzer commented 6 years ago

I think there's actually been some recent progress on the dependency - I'm cautiously optimistic.

There is. See https://github.com/eclipse/smarthome/pull/4390#issuecomment-335190549 - any comments welcome!

rinal13 commented 6 years ago

The homekit roller shutter is working with my adjusted in the bticino binding. I got it working by defining limits for the roller shutter value. 0 - 45 => Command UP 45 - 55 => Command Stop 55 - 100 => Command Down

the right solution would be: previous state > actual state/command => Command Up previous state = actual state/command => Command Stop previous state < actual state/command => Command Down

But I didn't found a way to get a previous state of an item in the code. I am an newbie in Java and openHAB. Every hint would be helpful how to do right.