Apple homekit integration!

Discussion in 'Voice Control' started by ievolve, Nov 7, 2016.

  1. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I'd like to hear if anyone has tried USB PCI too.

    To use CGate on Windows is pretty easy.
    To make it all start up automatically is just a little bit more work.

    On the pi change the ip address in config.json to the WIndows machine ip address.

    On the Windows machine add your pi ip address to C:\Clipsal\C-Gate2\config\access.txt
    Maybe restart for that to take affect.

    Open your project with Toolkit and open the network.
    Open the units and let them sync.
    Then reboot the pi.

    I run CGate in it's own Window but if you have the service running which is default install I did have some Windows firewall problems.
    Temporarily disable it if needed.

    Good luck
     

    Attached Files:

    Last edited: Dec 17, 2017
    DarylMc, Dec 17, 2017
  2. ievolve

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,522
    Likes Received:
    173
    Location:
    Adelaide, Australia
    This should work fine and is a good way to start off. All you should need to do is set the access.txt like you have and you should be able to connect. If you run cgate from a command prompt on windows (i.e. not as a service) you will get a log of who is trying to connect. Then try running a telnet client on the pi connecting to cgate. If that work it means you json config file is wrong. Otherwise there is either a network or access.txt issue.
     
    Ashley, Dec 17, 2017
  3. ievolve

    Ben77006

    Joined:
    Dec 17, 2017
    Messages:
    8
    Likes Received:
    0
    Hi Ashley thanks for your help! This is probably basic, but are you able to explain how to run cgate from a commany prompt rather than the service? Also could you explain how to telnet from the pi connecting to the cgate?
     
    Ben77006, Dec 17, 2017
  4. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I just tried it again.
    You might need to add the project name to project.default and project.start in the CGateconfig file on the PC too.
    Then you can just launch CGate
     
    DarylMc, Dec 17, 2017
  5. ievolve

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,522
    Likes Received:
    173
    Location:
    Adelaide, Australia
    If it's running as a service stop it first. Then either

    Start / All Programs / Clipsal / C-Gate / C-Gate

    or open a command prompt and run

    C:\Clipsal\C-Gate2\cgate.exe

    telnet xxx.xxx.xxx.xxx 20023

    You should get a:
    201 Service ready: Clipsal C-Gate Version: v2.6.1 (build 2245)

    if telnet isn't installed will will need "sudo apt-get install telnet"

    Check out the help file in C:\Clipsal\C-Gate2
     
    Ashley, Dec 17, 2017
  6. ievolve

    Ben77006

    Joined:
    Dec 17, 2017
    Messages:
    8
    Likes Received:
    0
    Hi Everyone! Thanks so much for your help! I finally worked it out and have set everything up! My issue was the settings on my windows stopped incoming connections, which I turned off and it is now working! I only have one small issue that I cannot seem to work out which is the states. I can turn on and off lights from my phone and it will update on the DLT's but when i turn off/on a light from the DLT, it does not update on the app. Is there soemthing that I need to change in the code? Thanks for all your help so far, very happy!

    -Ben
     
    Ben77006, Dec 18, 2017
  7. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I'm not sure if it is the same issue but I think I recall that happening if Homebridge starts before CGate has finished syncing the network.
    That's why I incorporated a timer delay to start Homebridge on the pi which also has CGate running.
    Quick test get CGate running and synced then restart Homebridge.
     
    DarylMc, Dec 18, 2017
    Mr Mark likes this.
  8. ievolve

    Ben77006

    Joined:
    Dec 17, 2017
    Messages:
    8
    Likes Received:
    0
    Hi DarylMc, I think the issue may be similar, it has started to work although only when I close the home app and reopen? So when I turn a light on from the DLT, with the home app open, the home app does not update, but if the light was turned on from the DLT then the home app is opened, it is updated. Any ideas why this may be happening?

    -Ben
     
    Ben77006, Dec 19, 2017
  9. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I tried to make a new image last night following my own instructions.
    It had all sorts of problems with status changes and CBus.
    I haven’t figured out why yet.
    I suspect either HomeKit in iOS 11.2.1 has done something different for new homes or Toolkit 1.15.2 has done something odd to the .xml.
     
    DarylMc, Dec 19, 2017
  10. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    @daniel
    There is a version difference with CGate.zip and the CGate.exe bundled in Toolkit 1.15.2

    Do you know if that is likely to cause any problems.
    Part of my fix was to completely remove Toolkit 1.15.2 and install 1.15.1 and redo the whole project from scratch to make a new xml.
    I did so many other things it is hard to pinpoint.
     
    DarylMc, Dec 19, 2017
  11. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Everything is working fine now.
    I found a little problem with status on one accessory.
    It would be a rare use case scenario and just happened to be the accessory I was turning on and off to confirm two way status updating was working nice.
     
    DarylMc, Dec 20, 2017
  12. ievolve

    Ben77006

    Joined:
    Dec 17, 2017
    Messages:
    8
    Likes Received:
    0
    Ok thanks DarylMc, my status seems to still be a little slow, I'll see what happens once I leave it for a little as i'm still configuring it properly while my electiricans are fitting off new lights.

    Another question for you all, today my electrician let me know that all my hallway lights could not fit onto one group for some reason or another, I've set it up that my DLT uses 1 button for <multiple> groups. I was wondering, is it possible to change the config.json so it comes up as only 1 accessory instead of having to press 2 lights seperately, I understand I could just create a scene on the home app but I think it would be cleaner if it just came up as 1 light?

    -Ben
     
    Ben77006, Dec 21, 2017
  13. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I can't think of a reason why your hall lights would need two group addresses.
    Unless they needed to be switched individually sometimes.
    Do the electricians mean they need two dimmer outputs?
    Just assign the two dimmer outputs to group address "Hall".

    If there is a good reason to have two group addresses for the hall lights, then they can easily be grouped together in the Home app to be a single button.
     
    DarylMc, Dec 21, 2017
  14. ievolve

    Ben77006

    Joined:
    Dec 17, 2017
    Messages:
    8
    Likes Received:
    0
    They're not dimmable lights, I belive it's something to do with voltage or amps, not exactly sure. They're on relays so would you be able to explain how to group them?
     
    Ben77006, Dec 21, 2017
  15. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Select one of the lights in home app by holding down.
    Open "details".
    Scroll down and you will see "group with other accessories".
     
    DarylMc, Dec 21, 2017
  16. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Actually if there was a good reason to have seperate group addresses for the lights it will now be broken because both group adresses will now be linked and always operate together.

    Consult whoever is setting up your CBus and ask about making just one group address for the hall lights.
     
    Last edited: Dec 21, 2017
    DarylMc, Dec 21, 2017
  17. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Here is a link to smb config files for all the rusted on Windows users like myself.
    For users who have followed my install instructions on a pi3.
    It allows editing of all relevant Homebridge CBus files from the comfort of your Windows network.
    https://1drv.ms/t/s!AminzOc-NC4UgZ8bt1wOvGMeCN_rdw
     
    DarylMc, Dec 26, 2017
  18. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Like this.
     

    Attached Files:

    Last edited: Dec 26, 2017
    DarylMc, Dec 26, 2017
  19. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I've found Notepad ++ to be good and as much as I am a rusted on Windows user it is now set as my default text editor.
     

    Attached Files:

    DarylMc, Dec 26, 2017
  20. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    In case anyone was wondering.
    I set up some automations in Home app for my Hue lamps.
    They are grouped to a CBus group address in the Home app..
    So the CBus key input can turn them on and off, cool.
    I set both the iOS devices, iPhone and iPad to "aeroplane mode"
    It didn't work anymore.
    So automations rely on your iOS device being online.
    The point of mentioning this is that any smarts you can get CBus network to do is going to be a lot more reliable.
     
    Last edited: Dec 26, 2017
    DarylMc, Dec 26, 2017
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.