Apple homekit integration!

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

  1. ievolve

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    49
    Likes Received:
    1
    Hmmm not good.

    I stopped homebridge and ran it with "homebridge -I" and got the below:
    pi@raspberrypi:~ $ sudo systemctl stop homebridge
    Warning: Stopping homebridge.service, but it can still be activated by:
    homebridge.timer
    pi@raspberrypi:~ $ homebridge -I
    [8/9/2020, 3:34:18 PM] config.json (/home/pi/.homebridge/config.json) not found.
    [8/9/2020, 3:34:20 PM] Loaded plugin: [email protected]
    [8/9/2020, 3:34:20 PM] Registering platform 'homebridge-cbus.CBus'
    [8/9/2020, 3:34:20 PM] ---
    [8/9/2020, 3:34:20 PM] Loaded plugin: [email protected]
    [8/9/2020, 3:34:20 PM] Registering platform 'homebridge-config-ui-x.config'
    [8/9/2020, 3:34:20 PM] ---
    [8/9/2020, 3:34:21 PM] Loaded plugin: [email protected]
    homebridge API version: 2.6
    [8/9/2020, 3:34:21 PM] Registering platform 'homebridge-mqtt.mqtt'
    [8/9/2020, 3:34:21 PM] ---
    Setup Payload:
    X-HM://0023ISYWYHNCH

    Now cbus through Homekit doesn't work - No Response.

    it says config.json not found but that's because it's in /var/lib/homebridge/config.json

    Will copying my config/json to this other folder fix this?
     
    Robert, Aug 9, 2020
  2. ievolve

    JasonY00

    Joined:
    Aug 30, 2012
    Messages:
    138
    Likes Received:
    31
    Location:
    Sydney
    hmmm. Not sure how you set your homebridge up. Perhaps go back to where you were before and I will think about it...
     
    JasonY00, Aug 9, 2020
  3. ievolve

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    49
    Likes Received:
    1
    Don't know how to go back


    pi@raspberrypi:~ $ sudo journalctl -u homebridge.service -f
    -- Logs begin at Sun 2020-08-09 16:01:11 AEST. --
    Aug 09 17:16:55 raspberrypi homebridge[3766]: at cli (/usr/lib/node_modules/homebridge/src/cli.ts:54:18)
    Aug 09 17:16:55 raspberrypi homebridge[3766]: at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
    Aug 09 17:16:55 raspberrypi homebridge[3766]: at Module._compile (internal/modules/cjs/loader.js:778:30)
    Aug 09 17:16:55 raspberrypi homebridge[3766]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    Aug 09 17:16:55 raspberrypi homebridge[3766]: at Module.load (internal/modules/cjs/loader.js:653:32)
    Aug 09 17:16:55 raspberrypi homebridge[3766]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    Aug 09 17:16:55 raspberrypi homebridge[3766]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    Aug 09 17:16:55 raspberrypi systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
    Aug 09 17:16:55 raspberrypi systemd[1]: homebridge.service: Failed with result 'exit-code'.
    Aug 09 17:16:57 raspberrypi systemd[1]: Stopped Node.js HomeKit Server.

    Cgate is running but get the above when I run what Darryl suggested before to troubleshoot. Doesn't sound positive but don't know what to do with it.

    Thanks,
    Rob
     
    Robert, Aug 9, 2020
  4. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,319
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hello Rob
    I think you have just mucked up your config file.
    Quick question, how did you create the initial config file?
    Did you use Greig’s script to do it?

    Starting from scratch would not be a terrible idea.
    Greig has just finished some updates to his setup script for Homebridge UI and CBus.
    The instructions look great and you could be one of the first to test.
    https://github.com/greiginsydney/Homebridge-cbus-installer/blob/master/SETUP.md
     
    DarylMc, Aug 9, 2020
  5. ievolve

    JasonY00

    Joined:
    Aug 30, 2012
    Messages:
    138
    Likes Received:
    31
    Location:
    Sydney
    Sorry for the late reply Rob,

    Firstly, a reboot may make it all ok again.

    Secondly, /var/lib/homebridge is where the config.json file should be. If you copy the file, from your /home/pi/.homebridge directory then it may need to have its owner changed to homebridge:homebridge with the chown command. Its privileges will need to be 644.

    Have you had this homebridge installed for sometime? I noticed that you also have the mqtt plugin installed. Is this configured for anything? I agree with Daryl that running Greig's install (you may not need to run all of it) may be useful to solve and update your install. Just keep a copy of your config.json file from the /home/pi/.homebridge folder. If you are really keen, then you can blow it all away and start again.

    If you originally installed homebridge without the -g option with npm, this may be why your file is under the pi user instead of the homebridge folder hierarchy.

    the -I option for homebridge is necessary for the config-ui-x to display your accessories on the web interface. It means insecure mode and allows a plugin to query the HAP server for the state of the accessories. It is also necessary for the homebridge-gsh (google) plugin (and others) to function properly.

    With my pi installs, I do a full raspbian install of the OS with the GUI. You can then VLC into it and you have chromium on the pi, a file manager that can browse your windows network amongst other functionality beyond the basic install. I didn't use the homebridge raspbian image. I also have other things running on the pi which is why I do a full install.

    I go here first: https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Raspbian to get the homebridge and UI installed

    and then use Greig's installation instructions from Step 10 here: https://github.com/greiginsydney/Homebridge-cbus-installer/blob/master/SETUP.md

    However, I use VLC to get to the pi over ethernet and open homebridge locally in chromium with http://127.0.0.1:8581 (8581 is the default port). I can then do the rest of the configuration actions over VLC in the local pi console.

    Apologies if I assisted you in breaking your install. I think, however, that you may have to do a bit of command line fiddling to get the full functionality of the config-ui-x and other plugins to work anyway. Not sure of your level of unix command line experience so will leave it up to you to decide how to go about it.

    Let us know how you go.

    Cheers

    Jason
     
    JasonY00, Aug 10, 2020
    Robert likes this.
  6. ievolve

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    49
    Likes Received:
    1
    Done and have it working as before I tried to do some enhancements! I have the UI version running but other than being able to edit in the browser, not sure what additional features it has.

    My json file is here:
    /var/lib/homebridge
    So hopefully it's all as it should be

    mqtt is installed as I want to add some zigbee devices. I have Homeassistant installed as well, I was initially going to use that as the interface for the different smart devices but I'm not that excited by it's UI.

    Thanks for you help,
    Rob
     
    Robert, Sep 27, 2020
  7. ievolve

    JasonY00

    Joined:
    Aug 30, 2012
    Messages:
    138
    Likes Received:
    31
    Location:
    Sydney
    Great news Rob,

    The Homebridge UI has lots of functionality. Just have a look around. Upgrading homebridge and the plugins is now very easy and you will be informed of updates when you log on. Editing the config file is also easier with a .json syntax checker built in with backup and restore functionality...the list goes on. Have a good look around. I wouldn't be without it now...
    Cheers

    Jason
     
    JasonY00, Oct 1, 2020
    chromus likes this.
  8. ievolve

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    49
    Likes Received:
    1
    Last edited: Oct 3, 2020
    Robert, Oct 3, 2020
  9. ievolve

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    49
    Likes Received:
    1
    Tried
    Broker: homebridge
    Port: 1883
    Username and password, my Rpi log in. Is there a homebridge log in?
     
    Robert, Oct 3, 2020
  10. ievolve

    JasonY00

    Joined:
    Aug 30, 2012
    Messages:
    138
    Likes Received:
    31
    Location:
    Sydney
    Hi Robert,

    I am not familiar with what the Homebridge MQTT settings are for Home Assistant as I do not use home assiatant, so I cannot help you there except...

    I did, however, find this website that may help you along with your issue. It appears that you use the username/password combination that you choose when you set up home assistant:

    https://github.com/gilhaz/HomeAssistant_SmarthThings_Homebridge/blob/master/README.md

    Cheers

    Jason
     
    JasonY00, Oct 6, 2020
  11. ievolve

    Ks04

    Joined:
    Dec 28, 2019
    Messages:
    113
    Likes Received:
    10
    Let me know if you work this - I was hoping to be able to bring my devices from Homebridge into homeassistant - but couldn't get them to talk... at this stage I have resorted to a MQTT-Cbus integration for Home Assistant but not loving this.

    I have managed to get the GUI for Home Assistant into a nice spot though... will share once done.
     
    Ks04, Oct 7, 2020
    Mr Mark likes this.
  12. ievolve

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    49
    Likes Received:
    1
    No luck so far but haven't had much time to try other things. Will report back with any progress.
     
    Robert, Oct 24, 2020
  13. ievolve

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    49
    Likes Received:
    1
    Homekit stopped working after the house power was reset...not happy

    Don't know why it didn't just come up again after the restart, just seems to be in a loop

    [12/25/2020, 22:57:14] [HB Supervisor] Restarting Homebridge...
    [12/25/2020, 22:57:14] [HB Supervisor] Starting Homebridge with extra flags: -I
    [12/25/2020, 22:57:14] [HB Supervisor] Started Homebridge v1.2.3 with PID: 30218
    [12/25/2020, 22:57:15] Loaded config.json with 0 accessories and 2 platforms.
    [12/25/2020, 22:57:15] ---
    [12/25/2020, 22:57:17] Loaded plugin: [email protected]
    [12/25/2020, 22:57:17] Registering platform 'homebridge-cbus.CBus'
    [12/25/2020, 22:57:17] ---
    [12/25/2020, 22:57:17] Loaded plugin: [email protected]
    [12/25/2020, 22:57:17] Registering platform 'homebridge-config-ui-x.config'
    [12/25/2020, 22:57:17] ---
    [12/25/2020, 22:57:17] Loaded plugin: [email protected]
    homebridge API version: 2.6
    [12/25/2020, 22:57:17] Registering platform 'homebridge-mqtt.mqtt'
    [12/25/2020, 22:57:17] ---
    [12/25/2020, 22:57:17] Loading 2 platforms...
    [12/25/2020, 22:57:17] [Config] Initializing config platform...
    [12/25/2020, 22:57:17] [Config] Running in Service Mode
    [12/25/2020, 22:57:17] [CBus] Initializing homebridge-cbus.CBus platform...
    2020-12-25T11:57:17.888Z cbus:client Opening connection to C-Gate…
    2020-12-25T11:57:17.900Z cbus:client C-Gate socket error: Error: connect ECONNREFUSED 127.0.0.1:20023
    2020-12-25T11:57:17.901Z cbus:client C-Gate connection could not be opened; exiting.
    [12/25/2020, 22:57:17] [HB Supervisor] Homebridge Process Ended. Code: 0, Signal: null
    [12/25/2020, 22:57:22] [HB Supervisor] Restarting Homebridge...

    Any ideas on what's gone wrong?

    Thanks,
    Rob
     
    Robert, Dec 25, 2020
  14. ievolve

    JimNoble

    Joined:
    Jan 8, 2017
    Messages:
    5
    Likes Received:
    0
    Location:
    Hertfordshire, UK
    Looks like you have a problem with the cgate process. Check the process is running and can communicate with the c-bus network ok.

    HTH,

    James
     
    JimNoble, Dec 25, 2020
  15. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,319
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I’d check the CBus interface too.
    It looks to me CGate can’t find the CBus network
     
    DarylMc, Dec 25, 2020
    Robert likes this.
  16. ievolve

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    49
    Likes Received:
    1
    Can't Telnet in to check if Cgate is running, does that make sense? What isn't running on my Pi?
     
    Robert, Dec 28, 2020
  17. ievolve

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,319
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Restart the raspberry pi if you haven't already.
    Don't just restart Homebridge because that will not restart CGate.
    You can restart the raspberry pi in the browser GUI "restart server".
    Or do the following in a terminal.
    You can use the terminal in the Homebridge UI.
    sudo reboot.

    Install tenet on the raspberry pi
    sudo apt install telnet

    Connect to CGate with Telnet
    telnet 127.0.0.1 20023

    If CGate responds it is running
    To quit telnet and go back to the terminal prompt type the following
    CTRL ]
    quit
     
    DarylMc, Dec 28, 2020
    Robert likes this.
  18. ievolve

    Robert

    Joined:
    Jun 10, 2018
    Messages:
    49
    Likes Received:
    1
    Thank you! No idea why I didn't try restarting again...should be the first thing I try
     
    Robert, Dec 29, 2020
  19. ievolve

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    I have found on odd occasions things just don’t resync on Rasbian and a reboot of the hardware solves it all. It’s been suggested elsewhere that the database “named pipes” fall over.

    I haven’t had time to go thru the logs to look into this.
     
    chromus, Dec 29, 2020
  20. ievolve

    iTitanium

    Joined:
    Dec 30, 2020
    Messages:
    5
    Likes Received:
    0
    Hi all, long time follower, first time seeking assistance as I can normally find what I need to get me by however...

    I have long used the homebridge-wiser plugin (https://github.com/paulw11/homebridge-wiser) allow HomeKit to talk to wiser to allow c-bus control however I can only see items I have added to wiser and does not see motion sensors unless I create a virtual button.

    I am thinking of changing my setup but would like some feedback if it is possible first, I would like to remove my wiser from the equation, create an instance of C-Gate running on my Mac Mini which is connected to my CNI and then use C-Bus for Homebridge plugin (https://github.com/anthonywebb/homebridge-cbus) connect to the c-gate instance. If this is possible?

    I then believe I will also be able to remotely connect to C-gate on the Mac Mini via a windows machine running c-bus toolkit to make any changes to the c-bus network configuration if required.

    I have heard of people running both c-gate and homebridge simultaneously on their Mac Mini I believe.

    Any feedback much appreciated
     
    iTitanium, Dec 30, 2020
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.