www.homeseer.com    
 

Go Back   HomeSeer Message Board > HomeSeer Products & Services > HomeSeer Software > HS3 / HS3PRO > HS3 Plug-In Development

HS3 Plug-In Development Discussions related to developing plugins for HS3.

Reply
 
Thread Tools Display Modes
  #1  
Old November 29th, 2014, 12:04 PM
Fraggel Fraggel is offline
Seer Master
 
Join Date: May 2013
Location: The Netherlands
Posts: 523
Post 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.
Reply With Quote
  #2  
Old November 29th, 2014, 12:14 PM
kideon kideon is offline
Seer Master
 
Join Date: May 2014
Location: virginia
Posts: 746
If you pull it off and get a functional plug in you'll be our hero!
Reply With Quote
  #3  
Old November 29th, 2014, 01:18 PM
huggy_d1's Avatar
huggy_d1 huggy_d1 is offline
Seer Master
 
Join Date: Nov 2001
Location: Somewhere, VA, USA
Posts: 1,066
Quote:
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
Reply With Quote
  #4  
Old November 29th, 2014, 03:22 PM
Fraggel Fraggel is offline
Seer Master
 
Join Date: May 2013
Location: The Netherlands
Posts: 523
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.
Reply With Quote
  #5  
Old November 29th, 2014, 04:02 PM
Jakob.Sand's Avatar
Jakob.Sand Jakob.Sand is offline
Seer Deluxe
 
Join Date: Jan 2008
Location: Denmark, Karlebo
Posts: 468
When you need at tester let me know.
I have all apples devices and HS3 with +400 devices.


Quote:
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!
Reply With Quote
  #6  
Old November 29th, 2014, 05:49 PM
spud's Avatar
spud spud is offline
Moderator
 
Join Date: Jan 2012
Location: Canada
Posts: 4,504
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?
Reply With Quote
  #7  
Old December 1st, 2014, 06:13 AM
Fraggel Fraggel is offline
Seer Master
 
Join Date: May 2013
Location: The Netherlands
Posts: 523
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.
Reply With Quote
  #8  
Old February 3rd, 2015, 11:36 AM
Fraggel Fraggel is offline
Seer Master
 
Join Date: May 2013
Location: The Netherlands
Posts: 523
Thumbs up 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!
Reply With Quote
  #9  
Old February 4th, 2015, 02:37 PM
Skinnez's Avatar
Skinnez Skinnez is offline
Seer Deluxe
 
Join Date: Nov 2013
Location: Uk
Posts: 419
I'm very interested to see this, I'm sure others are. Keep it up
__________________
HS3 3.0.0.318 Windows 8.1 Pro VM on a Mac-Mini VirtualBox
HSTouch, iTunes DAAP, Kodi, MediaController, PHLocation, Pushover, RFXCOM, UltraNetCam3, BLRadar, BLShutdown, weatherXML, Random, Jon00 Network Monitor, JowiHue, Nest, UZB-1
600+ Devices, 400+ Events & lots of scripts.

Hyper-V 2012 virtual domain - 3 VM's
Server 2008 R2, Server 2012, Exchange 2013..
Reply With Quote
  #10  
Old February 16th, 2015, 01:11 PM
bibowoka bibowoka is offline
Seer
 
Join Date: Apr 2012
Location: East Midlands, UK
Posts: 48
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.
Reply With Quote
  #11  
Old February 16th, 2015, 01:56 PM
TomTom's Avatar
TomTom TomTom is offline
Seer Master
 
Join Date: Apr 2012
Location: USA
Posts: 1,414
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
Reply With Quote
  #12  
Old February 17th, 2015, 04:24 PM
Jakob.Sand's Avatar
Jakob.Sand Jakob.Sand is offline
Seer Deluxe
 
Join Date: Jan 2008
Location: Denmark, Karlebo
Posts: 468
me2 I am ready to pay for this.
Reply With Quote
  #13  
Old March 10th, 2015, 12:24 PM
codey codey is offline
Seer Deluxe
 
Join Date: Jul 2001
Location: South Wales UK
Posts: 406
I've also got cash waiting for this, awesome idea. Gives me the perfect excuse to buy an apple watch
Reply With Quote
  #14  
Old April 10th, 2015, 01:33 AM
Fraggel Fraggel is offline
Seer Master
 
Join Date: May 2013
Location: The Netherlands
Posts: 523
Smile 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 10th, 2015 at 05:21 AM.
Reply With Quote
  #15  
Old April 10th, 2015, 02:09 AM
codey codey is offline
Seer Deluxe
 
Join Date: Jul 2001
Location: South Wales UK
Posts: 406
Awesome news, keep up the good work, if your looking for testers I'm happy to help.
Reply With Quote
  #16  
Old April 10th, 2015, 03:19 AM
bartbakels's Avatar
bartbakels bartbakels is offline
Seer Master
 
Join Date: Sep 2011
Location: NL
Posts: 590
Interested +1
Reply With Quote
  #17  
Old April 10th, 2015, 03:33 AM
Skinnez's Avatar
Skinnez Skinnez is offline
Seer Deluxe
 
Join Date: Nov 2013
Location: Uk
Posts: 419
Nice!
One question I have...
Will it be possible to use this to get voice commands from Siri into HS3?
Fingers crossed.
Reply With Quote
  #18  
Old April 10th, 2015, 04:31 AM
TomTom's Avatar
TomTom TomTom is offline
Seer Master
 
Join Date: Apr 2012
Location: USA
Posts: 1,414
Thank you for your post and hard work


Tom
Reply With Quote
  #19  
Old April 10th, 2015, 05:20 AM
Fraggel Fraggel is offline
Seer Master
 
Join Date: May 2013
Location: The Netherlands
Posts: 523
@skinnez

As far as I know, Siri sends the commands into the apple cloud along with all kinds of metadata about contacts and ofcourse homekit information. In the cloud computing performance is available to interpret the voice command and translate them to an actual command siri can execute on the iDevice.
The iDevice will execute the command and could for example tell HS to switch on a light.

The voice command itself will never reach HS.
Reply With Quote
  #20  
Old April 10th, 2015, 06:10 AM
Skinnez's Avatar
Skinnez Skinnez is offline
Seer Deluxe
 
Join Date: Nov 2013
Location: Uk
Posts: 419
So could I say for example
"Homeseer all off"
And that could execute in the iDevice to run an event on HS then?
Running events like this was what I was thinking?
Cheers
J
Reply With Quote
Reply

Bookmarks

Tags
apple, development, homekit, plugin, siri

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HomeKit - Apples attempt at home automation Raptor HomeSeer General Discussion Area 15 November 29th, 2014 12:06 PM
Does this plugin work with the Windows Media Center plugin? rdimitri SqueezeBox Plug-In (3P) 0 May 16th, 2011 05:05 PM
Upgrade procedure for ACRF plugin from W800 free plugin htsource ACRF Processor (3P) 14 January 26th, 2006 11:21 AM
Switch-to messages, plugin restart, and plugin startup Michael McSharry Plug-In Development 4 January 27th, 2003 11:20 PM


All times are GMT -4. The time now is 05:09 PM.


Copyright HomeSeer Technologies, LLC