Announcement

Collapse
No announcement yet.

Homekit plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Homekit plugin

    Hi everyone,

    As was announced in another topic, I am investigating the development of a Homekit plugin for Apple idevices.

    Through homekit, users of idevices can use several apps to control appliances in their homes. These appliances can also be controled through siri, which offers a a lot of possibilities.

    Within homekit a the concept of a bridge exists. A bridge supports transferring homekit commands to other systems, for example homeseer. By building a bridge for homeseer, all devices listed in homeseer could be made available through homekit.

    =============================================
    Progress until 29-11-2014:

    At this moment I am developing a proof of concept. This will be a just a bridge with a dummy device, not yet linked to homeseer. Since HS is built in .net, I need to build this software in .net as well. That is no problem, but since Apple uses several proprietary techniques and protocols, some specific techniques are not yet available as .net library. This makes development very hard.

    Right now I am working on the pairing of the bridge and the idevice. This is done through several steps and is probably the hardest part to develop. I just started working on the last step, I hope everything will speed up when pairing is finished.

    As soon as the proof of concept is operational, I will post back here.

    ==============================================

    Due to a non disclosure agreement I cannot post any details of techniques used.
    If you want to assist in development, please send a PM, but keep in mind that I need some proof that you are member of the Apple MFi program before I can share any details.

    #2
    If you pull it off and get a functional plug in you'll be our hero!

    Comment


      #3
      Originally posted by Fraggel View Post
      Hi everyone,

      As was announced in another topic, I am investigating the development of a Homekit plugin for Apple idevices.

      Through homekit, users of idevices can use several apps to control appliances in their homes. These appliances can also be controled through siri, which offers a a lot of possibilities.

      Within homekit a the concept of a bridge exists. A bridge supports transferring homekit commands to other systems, for example homeseer. By building a bridge for homeseer, all devices listed in homeseer could be made available through homekit.

      =============================================
      Progress until 29-11-2014:

      At this moment I am developing a proof of concept. This will be a just a bridge with a dummy device, not yet linked to homeseer. Since HS is built in .net, I need to build this software in .net as well. That is no problem, but since Apple uses several proprietary techniques and protocols, some specific techniques are not yet available as .net library. This makes development very hard.

      Right now I am working on the pairing of the bridge and the idevice. This is done through several steps and is probably the hardest part to develop. I just started working on the last step, I hope everything will speed up when pairing is finished.

      As soon as the proof of concept is operational, I will post back here.

      ==============================================

      Due to a non disclosure agreement I cannot post any details of techniques used.
      If you want to assist in development, please send a PM, but keep in mind that I need some proof that you are member of the Apple MFi program before I can share any details.
      Would you make this a two-piece kit where you have the HS plugin talk via bonjour or whatever secure protocol Apple requires and natively convert between .net and homekit protocols, and then the iOS and OS/X apps can simply connect to the HS plugin as if it were a bunch of supporting hardware devices??
      huggy_d1

      Automating made easy

      Comment


        #4
        Yes, that would be the idea.

        The idevice will see the bridge plugin as a bunch of devices and does not see homeseer behind it. The plugin will translate any homekit request to a homeseer action.
        Since the protocol, which indeed uses bonjour for discovery, is part of iOS, multiple apps can make use of it and Siri as well.

        Comment


          #5
          When you need at tester let me know.
          I have all apples devices and HS3 with +400 devices.


          Originally posted by Fraggel View Post
          Yes, that would be the idea.

          The idevice will see the bridge plugin as a bunch of devices and does not see homeseer behind it. The plugin will translate any homekit request to a homeseer action.
          Since the protocol, which indeed uses bonjour for discovery, is part of iOS, multiple apps can make use of it and Siri as well.
          Best,
          Jakob Sand, I automate everything!

          Comment


            #6
            interesting...

            do you need to be a member of the Apple MFi program to develop such a bridge?
            I saw some open source implementations of bridges:
            https://github.com/etwmc/PersonalHomeKit
            https://github.com/KhaosT/HAP-NodeJS
            but they are based on reverse engineering of the protocol, so I guess the answer to my first question is yes, right?

            Looks like to apply to the MFi program you need to be a company and not an individual developer? So, to build a bridge for HS don't you have to be a HomeSeer employee or somehow a Homeseer sub-contracter?

            Comment


              #7
              There are indeed some projects based on reverse engineering.
              But to do it correctly you have to be a member of the MFi program.

              As a company you can apply for a developer-membership. However this does not allow you to manufacture any hardware or license the software.
              This is only allowed to MFi members with a manufacturing license and that is only given to companies who own a manufacturing facility.
              Since I am a self-employed IT-specialist, I could apply for the development membership. Therefore I have access to all the information, but not to the licensing part.

              Any software created needs to use a special chip to sign messages. otherwise the idevice will indicate that the accessory (e.g. the bridge-plugin) is not a certified apple product. the chip can only be aquired by licensed manufacturers.

              If and when the plugin becomes available here, it will certainly be without certification.

              I don't know whether HS has a large manufacturing plant themselves and could aquire for such a chip for their devices. If so, that could be really interesting.

              Comment


                #8
                Update

                Hi,

                Things have been quiet for a moment, however work has been going on.

                Around Christmas I finally managed to get pair-setup working. At this moment I am working on the pair-verify process. After that the iDevice is able to access and control the devices in the bridge (and homeseer).

                At the moment the process got stuck on some strange error. Where the iDevice just stops with the pairing process. This is actually by design and means faulty data is sent, so I messed something up. Unfortunetely, there is no tooling to tell me wich part is wrong.

                I recently got myself a raspberry pi and decided to add Personal Homekit to it. Since sourcecode is available for this device (C++), it could probably help me to complete the pair-verify process sooner.
                For my problem I could compare my own code to the PHK code and found that I am on the right track for the implementation. All calculations seem to be in order. This means something else is not working right. I just have to figure out what it is...

                I will keep you posted!

                Comment


                  #9
                  I'm very interested to see this, I'm sure others are. Keep it up

                  Comment


                    #10
                    I would pay a fair wedge of cash for this if it works out for you... It will effectively make 30+ devices around my house HomeKit enabled... possibilities are endless once your everyday iOS apps begin to support actions and events.

                    Comment


                      #11
                      I Would definitely be interested in this plugin. I'm sure there are lots of others.


                      Tom
                      Tom
                      baby steps...starting again with HS3
                      HS3Pro: Z-NET & 80 Z wave Devices,
                      HSTouch: 4 Joggler (Android Kitkat), 2 iPhone, 3 iPads
                      Whole House Audio: 5 SqueezePlay Jogglers w Bose Speakers
                      In The Works: 10 Cameras Geovision, new Adecmo/Envisalink Alarm, Arduinos
                      System: XP on Fanless Mini-ITX w/ SSD

                      Comment


                        #12
                        me2 I am ready to pay for this.
                        Best,
                        Jakob Sand, I automate everything!

                        Comment


                          #13
                          I've also got cash waiting for this, awesome idea. Gives me the perfect excuse to buy an apple watch

                          Comment


                            #14
                            Update

                            Hi guys,

                            Thank you for all the support!

                            I finally had some time to spend on HomeKit again. The problem I was facing was actually a result of lack in experience of TCP/IP programming and misunderstanding the HomeKit manual.
                            I was using sockets to proxy requests to an internal webserver. A lot of times this gave me errors. I found that by using TCPclient the connection was more stable.
                            In the end, the whole webserver has been pulled out, since the protocol is not http-compliant although the manual gives you the impression that it should be (apart for 2 lines somewhere I probably didn't read or misunderstood earlier). It is now back to fully parsing the TCP message myself.

                            It looks like all the difficult encryption parts are in order now and I finally see the iDevice requesting a list of my accessories. Unfortunately it looks like the dummydata I send becomes corrupted somewhere, so I will have to figure out what is causing this behavior.

                            Since I now can send a list of appliances to an iDevice, it is about time to get the information out of HS.
                            I will have to look into HS developer guides how to do this.

                            Next steps:
                            - fix corrupted data
                            - control dummy-device using iDevice
                            - read data from HS
                            - control HS devices using iDevice
                            - a lot more like how to serve 100+ devices...

                            I will keep you posted.
                            Last edited by Fraggel; April 10, 2015, 04:21 AM.

                            Comment


                              #15
                              Awesome news, keep up the good work, if your looking for testers I'm happy to help.

                              Comment

                              Working...
                              X