Apple homekit integration!

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

  1. ievolve

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,420
    Likes Received:
    62
    Location:
    Adelaide
    The new Automation Controllers are equivalent to the Wiser2 in this regard. They have one C-Bus interface dedicated to the controller and another dedicated to CNI functionality.
     
    NickD, Nov 27, 2017
  2. ievolve

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    So is this through the network interface, or is there one on the network and one on the USB input?
     
    Ashley, Nov 27, 2017
  3. ievolve

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,420
    Likes Received:
    62
    Location:
    Adelaide
    Technically they are both the same.

    When you connect to the USB port it presents as a network interface at 192.168.254.10 using RNDIS and you can connect to the CNI at this address on port 10001 (as long as there is not already a connection on the other network interface).

    Alternatively you can connect to the CNI via the devices Ethernet IP on the same port (as long as it's not connected already on the USB).

    Nick
     
    NickD, Nov 28, 2017
    Ashley likes this.
  4. ievolve

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    That's very good. It makes it much more versatile.
     
    Ashley, Nov 28, 2017
  5. ievolve

    asimcox

    Joined:
    Jul 19, 2017
    Messages:
    23
    Likes Received:
    0
    Location:
    Melbourne
    Hi djagger,
    I'm not sure if replying to your off topic means mine is also off topic, but apologies in advance if so.
    I just wanted to check if you connected your CBUS SIM 5000SM/2 direct to the Raspberry Pi GPIO serial port pins or if you used some type of level converter. From what I can work out the 5000SM/2 uses TTL level logic which is 5V, but the Raspberry Pi GPIO is only 3.3V.
    I have a Raspberry Pi Model B+ setup with a CGate server which I am hoping to also use as a Misterhouse server to get a Google Home to control my CBUS lighting and MARPA audio system. I have a 5000SM/2 which I recovered from a no longer used Clipsal (NESS) homesafe so if I can connect that up directly it would be useful.
    If the Pi can handle it I will also probably try to install PHLEX on it so I can use the Plex server in my NAS with Google Home as well (as an audio source for the MARPA as well as a video source for TVs).

    -A
     
    asimcox, Dec 1, 2017
  6. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    @asimcox
    If you do get Ness CBus interface running on pi please tell more about it.
    I think I have one of those from Ness lying around too but never considered it might be 5000SM/2.
     
    DarylMc, Dec 1, 2017
  7. ievolve

    asimcox

    Joined:
    Jul 19, 2017
    Messages:
    23
    Likes Received:
    0
    Location:
    Melbourne
    Hi DarylMc
    Yes, from what I can see, the Clipsal/Ness board is identical to a 5000SM/2. There seems to be a few different board layouts of 5000SM/2, but the one I have is the same as the one in the 5000sm/2 Serial Interface Module Implementation Guide from Clipsal. It might have different firmware though.

    Unfortunately it is soldered to a level converter board which will be for 12V levels going into the alarm system. It took a bit of work with the solder sucker to desolder the two. It wasn't helped by there being a very small surface mount component which I think was a resistor soldered between the +Vcc and Rx pins on the level converter board. I didn't even see it there until I used a magnifying glass to see why the solder wasn't being sucked out of the holes properly. I think the component must have been glued in place and it was exactly the right length to fit between the pins so it made getting the solder from those two pins very hard. I suspect the SMD might be part of a level conversion, although I'm not sure how that configuration would work. It doesn't seem to make much sense tying the Rx line high.

    I saw on one of the forums that someone said you can just wire up a 5000SM/2 to a Raspberry Pi GPIO serial port directly, however I haven't been able to find that forum post again. The Clipsal guys on the forums seem to point to the fact the 5000SM/2 can work with 3.3V circuits, but that might be that the receive levels will be recognised by the module even if they are only 3.3V. I suspect the transmit is where the problem will be. Until I can confirm I am a bit nervous plugging this in to my Pi in case I fry it. If I power the device from the Pi 3.3V line instead of 5V I guess it is unlikely to be using 5V TTL transmit levels even though that is what the spec says. In that configuration the SIM may not be stable though.

    I guess if no one can confirm I could always try to find my old USB to RS232 TTL converter and make sure the 5000SM/2 works via the Pi USB port. While I am doing it I can stick a CRO on the transmit line to see what the actual transmit levels are.

    Just out of interest does anyone know if there are initialisation strings required for the 5000SM/2, and if so does CGate send the appropriate commands? I assume the SIM will have a CBUS address, but I'm not sure if that needs to be reprogrammed after each power on. From the Implementation Guide it mentions other characteristics may be programmed into the SIM by toolkit but doesn't show if they are retained after a power cycle.

    -A
     
    asimcox, Dec 2, 2017
  8. ievolve

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    The 5000SM/2 is rated to operate from 3V to 5.5V so just hook it up the the 3.3V line and directly connect the RX and TX lines.

    It looks identical to a serial interface to CGate so no extra initialisation is required.

    You need to give it a unique unit address in Toolkit, otherwise you will get address conflict errors. No other Toolkit set up is required.
     
    Ashley, Dec 2, 2017
    Mr Mark likes this.
  9. ievolve

    asimcox

    Joined:
    Jul 19, 2017
    Messages:
    23
    Likes Received:
    0
    Location:
    Melbourne
    Hi Ashley,

    Thanks for the confirmation.

    I just hooked it up via a breadboard and the LEDs showed the network was synced. It took a little while but eventually I was able to access it as a remote CGate from my PC using Toolkit. The device comes up as "Homesafe Security Panel, 16 zones with C-Bus" in toolkit, but otherwise seems to be working as expected. I changed a couple of timers on some sensors in my CBUS install and turned a few lights on and off to confirm and it all seems to work.

    Now on to installing Misterhome and Phlex.

    By the way, the reason I am trying Misterhome is because it has an emulation mode for Phillips Hue which means the Google Home thinks the CBUS lights are Phillips Hue. This means I can just say "OK Google turn on kitchen lights" rather than "OK Google tell XXXXX to turn on kitchen lights". XXXXX being whatever other service I might have used.

    Thanks all for the help.
    As I get the Google Home install going I will report back, but I'll do that in the Google Assistant C-Bus Integration thread as that looks like the place this should be.

    -A
     
    asimcox, Dec 2, 2017
  10. ievolve

    rhamer

    Joined:
    Aug 3, 2004
    Messages:
    673
    Likes Received:
    3
    Location:
    Melbourne, Australia
    Depending on the age of the Ness interface, it may be an earlier 5000sm which doesn’t handle 3.3v TTL as well as the newer /2.
    Also don’t try to use it with toolkit as they are specifically blocked from working that way to prevent conflict with the sales of the PCI.

    Rohan
     
    rhamer, Dec 2, 2017
  11. ievolve

    asimcox

    Joined:
    Jul 19, 2017
    Messages:
    23
    Likes Received:
    0
    Location:
    Melbourne
    Hi Rohan,
    Looks like I got lucky and got a 5000SM/2.
    It is working nicely with toolkit still.
    It's nice using the remote CGate since it doesn't need to rescan the network each time I start up toolkit. A little extra delay by being remote, but that is nothing compared to the time it took to scan the network on startup using the PC and CNI.
    -A
     
    asimcox, Dec 3, 2017
  12. ievolve

    discjockeyr

    Joined:
    Jan 9, 2007
    Messages:
    59
    Likes Received:
    0
    hi guys,
    I am trying to configure all stuff but i am coming across the following error. Note that i have follow the instruction and install everything on my windows pc and i manage to communicate with sample config.json between homekit and pc (not cbus yet), but when i am trying to use Functional example config.json file i cannot communicate with pc. i will appreciate any help as i am stacked here. Below is my error:

    C:\Users\Chris\AppData\Roaming\npm\node_modules\homebridge\bin>node homebridge
    [12/8/2017, 12:35:54 PM] ====================
    [12/8/2017, 12:35:54 PM] ERROR LOADING PLUGIN homebridge-cbus:
    [12/8/2017, 12:35:54 PM] SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:404:25)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\Users\Chris\AppData\Roaming\npm\node_modules\homebridge-cbus\lib\cgate-client.js:14:19)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    [12/8/2017, 12:35:54 PM] ====================
    [12/8/2017, 12:35:54 PM] Loaded plugin: homebridge-http
    [12/8/2017, 12:35:54 PM] Registering accessory 'homebridge-http.Http'
    [12/8/2017, 12:35:54 PM] ---
    [12/8/2017, 12:35:54 PM] Loaded config.json with 0 accessories and 1 platforms.
    [12/8/2017, 12:35:54 PM] ---
    [12/8/2017, 12:35:54 PM] Loading 1 platforms...
    C:\Users\Chris\AppData\Roaming\npm\node_modules\homebridge\lib\api.js:128
    throw new Error("The requested platform '" + name + "' was not registered by any plugin.");
    ^

    Error: The requested platform 'homebridge-cbus.CBus' was not registered by any plugin.
    at API.platform (C:\Users\Chris\AppData\Roaming\npm\node_modules\homebridge\lib\api.js:128:13)
    at Server._loadPlatforms (C:\Users\Chris\AppData\Roaming\npm\node_modules\homebridge\lib\server.js:294:45)
    at Server.run (C:\Users\Chris\AppData\Roaming\npm\node_modules\homebridge\lib\server.js:85:36)
    at module.exports (C:\Users\Chris\AppData\Roaming\npm\node_modules\homebridge\lib\cli.js:40:10)
    at Object.<anonymous> (C:\Users\Chris\AppData\Roaming\npm\node_modules\homebridge\bin\homebridge:17:22)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:457:10)
     
    discjockeyr, Dec 8, 2017
  13. ievolve

    MadDude

    Joined:
    Aug 17, 2015
    Messages:
    16
    Likes Received:
    1
    Location:
    EU
    Just a quick update for those who were wondering if there's an option to run the whole setup on a NAS - I've been using a docker image with homebridge on my Synology + cgate on an windows server without any problems so far.

    However, i've got a few questions and I apologize in advance for my rusty english:
    1) As of right now I would like to ask if there's a way to hook up in homebridge 5031RDTSL temperature sensors? I've got a few of those installed.

    2) I've also got several 100mm exhaust fans in bathrooms which are currently scheduled to switch on/off via wiser and a connected to a relay switch - should I add them just as a simple switch type accessory?
    As per some posts below I've understood that the fan type requires a fan controller.

    3) Finnally - shutter controls. Once again, does it require strictly having a shutter relay?
    I've got several shutter blinds with somfy motors which stop if there's an obstacle (they don't have a pre-defined stop position, always work till they can't move any further) and they are also connected to a relay switch.
     
    MadDude, Dec 10, 2017
  14. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hi
    What do you want to do with the temps sensors?
    Just display temp?
    I'd raise it on anthony's Homebridge github page.

    I've got an exhaust fan in my office on a CBus relay output with the accessory type as switch.
    That works great.
    Also a couple of Daikin split AC's with interface cards and CBus low voltage relay switching them on or off.
    Switch accessory is good for that job too.
    Home app is pretty smart so you can say "turn off all the lights in the office" but still keep the AC and exhaust fan going.
    Or "turn off office" and it will turn off everything in the room.

    You should explain the shutter operation a bit more eg how do you open and close.
    Two CBus group addresses?
     
    DarylMc, Dec 10, 2017
  15. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hi MadDude
    If you just wanted an action to occur at a certain temp.
    If you can assign a CBus group address to that, assign that group address to a switch then that should work nice too.
     
    DarylMc, Dec 11, 2017
  16. ievolve

    MadDude

    Joined:
    Aug 17, 2015
    Messages:
    16
    Likes Received:
    1
    Location:
    EU
    In regards to the temp sensonrs - raised a ticket @github, thanks for the advice.
    I am surprpised that no one has asked for this up till now, am I the only one using them?:eek:
    In my system all these sensors are being polled every minute and based on their readings wiser switches off/on relay channels to open/close radiator valves.
    Heating control is basically one last thing that keeps me from moving from wiser to homebridge completely.

    In regards to the exhaust fans, noted, thank you for the explanation.

    As for the shutters - yes, each shutter group (e.g. several shutters in a room wired to a single relay channel) have two group adresses, one for opening and one for closing.
    So the main question is if I can group them up in home app for single click "all shutters close" with a slight delay between channel toggling on a relay (to avoid current jumps, since they consume quite a lot when motor starts moving)

    -Max.
     
    MadDude, Dec 11, 2017
  17. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hi Max
    Not even slightly familiar with a home that needs heat to live in :)
    I think CBus is going to handle a task like that better.
    Nothing to stop you assigning a group address and operating it with Home app though.
     
    DarylMc, Dec 11, 2017
  18. ievolve

    Ben77006

    Joined:
    Dec 17, 2017
    Messages:
    8
    Likes Received:
    0
    Hi Everyone! I am new to raspberry pi, and cbus in fact, having it only installed a few days ago, I have managed to follow many guides on setting up homebridge and cgate, before I go any further I want to add that I am not using 5500CN2, but a 5500PCU, meaning instead of the connection being an ethernet cable, it's a USB, I am successfuly able to Telnet from my Windows to the cgate on the pi, I have loaded my project to the pi, but when I 'net open 254', the pi does not connect even though it is connected through USB, I am unsure why this is happening and it would be greatly appreciated if someone could help!

    Also just another question, I read on page 13 someone couldn't get past the loading 0 when running cgate off of a different device and remote connecting to it. I tried to do the same as what I wrote above was not working, so I set up cgate on my windows where it was working perfectly through USB, I added the pi to the remote 'access' file, 'remote xxx.xxx.xxx.xxx Program', changed the address in the config.json, but I am not able to get the pi to talk to it, like I said earlier, similar to the post on page 13, it gets to
    'cbus;client Opening connection to C-Gate... +0ms'
    'Loading 0 accessories...'
    Then after about 2 minutes it times out:
    'cbus:client C-Gate socket error: Error: connect ETIMEOUT xxx.xxx.xxx.xxx:20023 +2m
    'cbus:client C-Gate connection could not be opened; exiting. +2ms

    (Also the x's are just in place of my address)

    I'm not sure here also what is going wrong, and I'm really eager to get this set up, i've beeing reading this forum for nearly a year. To be quite honest, if someone can help me out with either one of these 2 issues, I would be extremely greatful!

    -Ben
     
    Ben77006, Dec 17, 2017
  19. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I can't see how that could work unless you have a usb driver on the pi for the PCI.
    If someone has done that I've never heard of it.
     
    DarylMc, Dec 17, 2017
  20. ievolve

    Ben77006

    Joined:
    Dec 17, 2017
    Messages:
    8
    Likes Received:
    0
    Thanks for your reply DarylMc! 2 more quetions, can you get a USB driver on the pi for the PCI?-(Probably a silly question), and 2 is it possible to run cgate on my windows and then get my pi to connect to it? If so how?, because as I said I am having trouble with that also?
     
    Ben77006, Dec 17, 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.