Homebridge UI raspberry pi image

Discussion in 'Voice Control' started by DarylMc, Jul 9, 2020.

  1. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    For anyone interested I am working with CBus forum member Greig to test a raspberry pi setup with Homebridge UI prebuilt image, Homebridge-CBus plug-in, CGate server and Greig’s script to automate the whole setup somewhat.

    Homebridge UI seems to have a good user base and support so I think moving forward it might make installing and maintaining a Homebridge system simpler for users.
    Specifically users new to Linux.
    https://github.com/homebridge/homebridge-raspbian-image/wiki/Getting-Started
    The web based user interface looks good, has useful tools and provides some handy information.

    Greig created a script which installs everything needed for Homebridge-CBus and CGate on top of Raspbian Buster Lite.
    This works well in my experience and added some automation to the process of adding CBus groups to the config file.
    I’ve used it a few times and it really speeds up an install.
    https://github.com/greiginsydney/Homebridge-cbus-installer

    I’ve asked Greig to adapt a configuration to run on top of the prebuilt raspberry pi Homebridge UI image.
    At the moment I am compiling a list of steps for Greig and testing on a raspberry pi4 connected to a small test CBus network.
    I am using a CBus 5500PC RS232 interface connected to Moxa 5150A device server to provide the Ethernet interface for CBus.
    It is running now and I’ve uploaded some files and info to OneDrive if anyone is interested.
    https://1drv.ms/f/s!AminzOc-NC4UhbMqiSbBszZtz4E4pg
     
    Last edited: Jul 9, 2020
    DarylMc, Jul 9, 2020
    #1
    Ian likes this.
    1. Advertisements

  2. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    I did notice a problem with the CBus network toggled accessories not being updated in the Home app on the phone.
    Restarting Homebridge service without rebooting seemed to fix.
    Suspect I need to add a delay to Homebridge service start as per my previous Homebridge setups.
     
    Last edited: Jul 9, 2020
    DarylMc, Jul 9, 2020
    #2
    1. Advertisements

  3. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    I’ve added a timer to delay the Homebridge service start after reboot.
    Testing it now.
     
    DarylMc, Jul 9, 2020
    #3
    Mr Mark likes this.
  4. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    Made some changes and updated spreadsheet.
    Wiped SD and start from beginning.
    Testing now.
     
    DarylMc, Jul 10, 2020
    #4
    chromus likes this.
  5. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    If anyone wants to have a look at Greig's new script you can do so by selecting the v2 branch on GitHub.
    https://github.com/greiginsydney/Homebridge-cbus-installer/blob/v2/SETUP.md

    svn export https://github.com/greiginsydney/Homebridge-cbus-installer/branches/v2/code/ ~ --force

    Preliminary instructions here
    Between this and the prompts you can probably figure it out.
    https://github.com/greiginsydney/Homebridge-cbus-installer/blob/v2/SETUP.md
    The way the script can help create the config file and add accessories is a really nice touch compared to doing it all manually.

    The Homebridge UI setup has some nice features for adding and configuring plugins.
    I think there is a lot of scope for further development of Anthony's Homebridge CBus plugin to allow more configuration within the UI.
    Perhaps also adding CGate as a part of the hb-config tool.
    https://github.com/homebridge/homebridge-raspbian-image/wiki#useful-commands
     
    DarylMc, Jul 18, 2020
    #5
  6. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    I have tested a raspberrypi 4 following Greig’s script on a small CBus test network.
    It has been running for more than 4 weeks and I haven’t noticed any issues.
    I went through the setup process and all the instructions a few times.
    It seems all good to me.
    It is in the master branch now and here is the link.
    https://github.com/greiginsydney/Homebridge-cbus-installer

    For anyone with basic Linux skills process to setup a home from scratch is very fast.
    Nice work @greig
     
    DarylMc, Aug 25, 2020
    #6
  7. DarylMc

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    348
    Likes Received:
    44
    Location:
    Perth
    That’s good to hear.

    While it’s no big deal to do the long way for those of us who are experienced and had your guidance to get us started, automation takes silly human error out of the process.

    Now that guy on eBay selling a Pi3 and free software for $800 against the GNU will have his business model cut off at the knees.
     
    chromus, Aug 25, 2020
    #7
  8. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    Either that or Greig just helped him get it done much easier :)
     
    DarylMc, Aug 25, 2020
    #8
  9. DarylMc

    Ambro

    Joined:
    Nov 23, 2010
    Messages:
    101
    Likes Received:
    1
    Location:
    Adelaide
    Hello all,

    It's been a while but I decided to get a new pi and try the newer version of homebridge. The old version works fine but its always good to stretch my brain again.

    In saying this I've managed to get up to Part 36 of Greigs guide and I believe that my CNI isn't communicating to the CBUS network, log image as shown:

    upload_2020-9-8_17-6-57.png

    I'm using a usb CNI and plugging it into a usb port in the pi. I've tryed all usb ports but none seem to fire up.

    Any ideas how to get it up and running?
     
    Ambro, Sep 8, 2020
    #9
  10. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    Hi Ambro
    Did you ever have Homebridge and CGate running on a raspberry pi with the CBus USB PC interface?
    I’ve never seen that.
    I normally use Ethernet on a CNI or an RS232 PC interface with a serial device server.
     
    DarylMc, Sep 8, 2020
    #10
  11. DarylMc

    Ambro

    Joined:
    Nov 23, 2010
    Messages:
    101
    Likes Received:
    1
    Location:
    Adelaide
    Yes - thats how my old pi is set up. So I gather you plug your rs232 via the moxa into the network port and the pi talks to the ip network via wifi?
     
    Ambro, Sep 8, 2020
    #11
  12. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    Sorry I’m not quite sure what you are saying.
    For anything other than testing I would use the wired LAN on the raspberry pi in preference to wifi.
     
    DarylMc, Sep 8, 2020
    #12
  13. DarylMc

    impact

    Joined:
    Feb 10, 2008
    Messages:
    106
    Likes Received:
    11
    Thought I would give this a try and play around a little..... Frustrated now!

    It kind of works - close but no cigar.

    I am using a 5500SHAC as my CNI - it has the ip address 192.168.1.69 I can connect to it via web browser, and toolkit sees it as a cni - connects to it on port 10001.

    The raspberry PI is connected via ethernet - its on 192.168.161 - I can use the browser to see homebridge, and I can successfully SSH to it.

    Fairly large CBUS Network here... lots of relays and dimmers... I was able to see the Homebridge connect to CGate - and it was reporting errors of not understanding group 42 amongst others - so I thought for my test I would edit the json file and limit it to just one group - a downlight where I am sitting.....

    The logfile in Homebridge appears to be seeing traffic occuring on the CBUS - as someone walks past a PIR I see messages in the homegate logfile as;
    2020-09-13T01:10:17.010Z cbus:client rx event { time: '20200913-111017', code: 754, processed: false, message: '//LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f State=new Previous=sync Reason=Interface Closed', type: 'event', raw: '#e# 20200913-111017 754 //LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f State=new Previous=sync Reason=Interface Closed' }

    I guess thats okay - as the PIR that triggered this is not defined in homebridge.... BUT if I try to turn on that downlight - the logfile shows....

    2020-09-13T01:15:01.324Z cbus:client sent command '[123] get //LOWER/254/56/30 level # getOn'
    2020-09-13T01:15:01.324Z cbus:client sent command '[124] get //LOWER/254/56/30 level # getBrightness'
    2020-09-13T01:15:01.326Z cbus:client rx response { commandId: 123, code: 300, matched: false, processed: true, netId: CBusNetId { project: 'LOWER', network: 254, application: 56, group: 30 }, level: 0, type: 'response', raw: '[123] 300 //LOWER/254/56/30: level=0' }
    2020-09-13T01:15:01.327Z cbus:client matched request '[123] get //LOWER/254/56/30 level # getOn' with response '[123] 300 //LOWER/254/56/30: level=0' (1 pending requests)
    2020-09-13T01:15:01.332Z cbus:client rx response { commandId: 124, code: 300, matched: false, processed: true, netId: CBusNetId { project: 'LOWER', network: 254, application: 56, group: 30 }, level: 0, type: 'response', raw: '[124] 300 //LOWER/254/56/30: level=0' }
    2020-09-13T01:15:01.332Z cbus:client matched request '[124] get //LOWER/254/56/30 level # getBrightness' with response '[124] 300 //LOWER/254/56/30: level=0' (0 pending requests)
    2020-09-13T01:15:02.218Z cbus:client rx event { time: '20200913-111502', code: 755, processed: false, message: '//LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f InterfaceState=opening, TargetState=running', type: 'event', raw: '#e# 20200913-111502 755 //LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f InterfaceState=opening, TargetState=running' }
    2020-09-13T01:15:02.223Z cbus:client rx event { time: '20200913-111502', code: 911, processed: false, message: "//LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f Can't open: C-Bus interface (port failure (Connection refused (Connection refused))):192.168.1.69:10001", type: 'event', raw: "#e# 20200913-111502 911 //LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f Can't open: C-Bus interface (port failure (Connection refused (Connection refused))):192.168.1.69:10001" }
    2020-09-13T01:15:02.224Z cbus:client rx event { time: '20200913-111502', code: 755, processed: false, message: '//LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f InterfaceState=closing, TargetState=closed', type: 'event', raw: '#e# 20200913-111502 755 //LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f InterfaceState=closing, TargetState=closed' }
    2020-09-13T01:15:02.225Z cbus:client rx event { time: '20200913-111502', code: 754, processed: false, message: '//LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f State=sync Previous=new Reason=closing network', type: 'event', raw: '#e# 20200913-111502 754 //LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f State=sync Previous=new Reason=closing network' }
    2020-09-13T01:15:02.227Z cbus:client rx event { time: '20200913-111502', code: 755, processed: false, message: '//LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f InterfaceState=streamsclosed, TargetState=closed', type: 'event', raw: '#e# 20200913-111502 755 //LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f InterfaceState=streamsclosed, TargetState=closed' }
    2020-09-13T01:15:02.228Z cbus:client rx event { time: '20200913-111502', code: 755, processed: false, message: '//LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f InterfaceState=closed, TargetState=closed', type: 'event', raw: '#e# 20200913-111502 755 //LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f InterfaceState=closed, TargetState=closed' }
    2020-09-13T01:15:02.230Z cbus:client rx event { time: '20200913-111502', code: 754, processed: false, message: '//LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f State=new Previous=sync Reason=Interface Closed', type: 'event', raw: '#e# 20200913-111502 754 //LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f State=new Previous=sync Reason=Interface Closed' }
    2020-09-13T01:15:02.582Z cbus:client sent command '[125] ramp //LOWER/254/56/30 100% # setBrightness'
    2020-09-13T01:15:02.584Z cbus:client rx response { commandId: 125, code: 408, matched: false, processed: false, type: 'response', raw: '[125] 408 Operation failed: //LOWER/254/56/30' }
    2020-09-13T01:15:02.584Z cbus:client matched request '[125] ramp //LOWER/254/56/30 100% # setBrightness' with response '[125] 408 Operation failed: //LOWER/254/56/30' (0 pending requests)
    2020-09-13T01:15:02.600Z cbus:client sent command '[126] get //LOWER/254/56/30 level # getBrightness'
    2020-09-13T01:15:02.601Z cbus:client rx response { commandId: 126, code: 300, matched: false, processed: true, netId: CBusNetId { project: 'LOWER', network: 254, application: 56, group: 30 }, level: 0, type: 'response', raw: '[126] 300 //LOWER/254/56/30: level=0' }
    2020-09-13T01:15:02.602Z cbus:client matched request '[126] get //LOWER/254/56/30 level # getBrightness' with response '[126] 300 //LOWER/254/56/30: level=0' (0 pending requests)
    2020-09-13T01:15:02.627Z cbus:client sent command '[127] get //LOWER/254/56/30 level # getOn'
    2020-09-13T01:15:02.628Z cbus:client rx response { commandId: 127, code: 300, matched: false, processed: true, netId: CBusNetId { project: 'LOWER', network: 254, application: 56, group: 30 }, level: 0, type: 'response', raw: '[127] 300 //LOWER/254/56/30: level=0' }
    2020-09-13T01:15:02.629Z cbus:client matched request '[127] get //LOWER/254/56/30 level # getOn' with response '[127] 300 //LOWER/254/56/30: level=0' (0 pending requests)
    2020-09-13T01:15:04.139Z cbus:client sent command '[128] get //LOWER/254/56/30 level # getOn'
    2020-09-13T01:15:04.139Z cbus:client sent command '[129] get //LOWER/254/56/30 level # getBrightness'
    2020-09-13T01:15:04.141Z cbus:client rx response { commandId: 128, code: 300, matched: false, processed: true, netId: CBusNetId { project: 'LOWER', network: 254, application: 56, group: 30 }, level: 0, type: 'response', raw: '[128] 300 //LOWER/254/56/30: level=0' }
    2020-09-13T01:15:04.141Z cbus:client matched request '[128] get //LOWER/254/56/30 level # getOn' with response '[128] 300 //LOWER/254/56/30: level=0' (1 pending requests)
    2020-09-13T01:15:04.144Z cbus:client rx response { commandId: 129, code: 300, matched: false, processed: true, netId: CBusNetId { project: 'LOWER', network: 254, application: 56, group: 30 }, level: 0, type: 'response', raw: '[129] 300 //LOWER/254/56/30: level=0' }
    2020-09-13T01:15:04.144Z cbus:client matched request '[129] get //LOWER/254/56/30 level # getBrightness' with response '[129] 300 //LOWER/254/56/30: level=0' (0 pending requests)
    2020-09-13T01:15:04.160Z cbus:client sent command '[130] get //LOWER/254/56/30 level # getOn'
    2020-09-13T01:15:04.161Z cbus:client sent command '[131] get //LOWER/254/56/30 level # getBrightness'
    2020-09-13T01:15:04.163Z cbus:client rx response { commandId: 130, code: 300, matched: false, processed: true, netId: CBusNetId { project: 'LOWER', network: 254, application: 56, group: 30 }, level: 0, type: 'response', raw: '[130] 300 //LOWER/254/56/30: level=0' }
    2020-09-13T01:15:04.163Z cbus:client matched request '[130] get //LOWER/254/56/30 level # getOn' with response '[130] 300 //LOWER/254/56/30: level=0' (1 pending requests)
    2020-09-13T01:15:04.165Z cbus:client rx response { commandId: 131, code: 300, matched: false, processed: true, netId: CBusNetId { project: 'LOWER', network: 254, application: 56, group: 30 }, level: 0, type: 'response', raw: '[131] 300 //LOWER/254/56/30: level=0' }
    2020-09-13T01:15:04.165Z cbus:client matched request '[131] get //LOWER/254/56/30 level # getBrightness' with response '[131] 300 //LOWER/254/56/30: level=0' (0 pending requests)
    2020-09-13T01:15:04.374Z cbus:client sent command '[132] get //LOWER/254/56/30 level # getOn'
    2020-09-13T01:15:04.374Z cbus:client sent command '[133] get //LOWER/254/56/30 level # getBrightness'
    2020-09-13T01:15:04.376Z cbus:client rx response { commandId: 132, code: 300, matched: false, processed: true, netId: CBusNetId { project: 'LOWER', network: 254, application: 56, group: 30 }, level: 0, type: 'response', raw: '[132] 300 //LOWER/254/56/30: level=0' }
    2020-09-13T01:15:04.376Z cbus:client matched request '[132] get //LOWER/254/56/30 level # getOn' with response '[132] 300 //LOWER/254/56/30: level=0' (1 pending requests)
    2020-09-13T01:15:04.379Z cbus:client rx response { commandId: 133, code: 300, matched: false, processed: true, netId: CBusNetId { project: 'LOWER', network: 254, application: 56, group: 30 }, level: 0, type: 'response', raw: '[133] 300 //LOWER/254/56/30: level=0' }
    2020-09-13T01:15:04.379Z cbus:client matched request '[133] get //LOWER/254/56/30 level # getBrightness' with response '[133] 300 //LOWER/254/56/30: level=0' (0 pending requests)

    WOW that was a mouthful for just one button press.... But in the middle of it all - I do see a;
    Can't open: C-Bus interface (port failure (Connection refused (Connection refused))):192.168.1.69:10001", type: 'event', raw: "#e# 20200913-111502 911 //LOWER/254 05dd9370-d78b-1038-a02f-f6696c3aad3f Can't open: C-Bus interface (port failure (Connection refused (Connection refused))):192.168.1.69:10001"


    But why am I seeing some messages, that port works in Toolkit, yet when it trys to send something gets a connection refused ?

    Only did the install yesterday - everything updated to latest versions on a Raspberry Pi 4 - somewhat now not knowing what to do next ?
     
    impact, Sep 13, 2020
    #13
  14. DarylMc

    impact

    Joined:
    Feb 10, 2008
    Messages:
    106
    Likes Received:
    11
    Oh ignore my post above - murpheys law... solved it minutes after posting the last message.....

    I think I had a window on my PC running Cgate - it was connected to the SHAC.... So of course only one connection allowed..... hahaha

    Rebooted everything, and I was able to successfully turn my light on and off from homebridge.... now to get Google Voice working!
     
    impact, Sep 13, 2020
    #14
  15. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    Hi
    It looks like CGate is running and connecting to the CBus network but then dropping for some reason.
    I’ve never used the SHAC but I’d check that something else isn’t try to connect to the CBus Network interface.
    Toolkit?
    CGate service on a PC?
    I believe SHAC has multiple interfaces so make sure you are on top of how to use them.
     
    DarylMc, Sep 13, 2020
    #15
  16. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    Well done.
     
    DarylMc, Sep 13, 2020
    #16
  17. DarylMc

    impact

    Joined:
    Feb 10, 2008
    Messages:
    106
    Likes Received:
    11
    All works now - well just my pilot - only one set of downlights for the trial...

    Google Voice was an easy installation... Those scripts and instructions are a god send... They work well, could not have done it without them! BIG KUDOS to DarylMC and Greig for putting this all together - it was almost foolproof !!! Wow to think I wanted voice control for years, had a spare raspberry Pi put aside for months for this... Kept putting it off and off - it took only hours to get it running!!! I even bought a POE hat for the raspberry pi months ago and it also sat around gathering dust - ALL GOOD NOW!

    I noticed saying TURN DOWNLIGHTS ON on the phone would get interpreted as a dimming request... but on a google home device it worked well... TURN DOWNLIGHTS ON FULL worked fine on the phone - just need to learn google language I guess...

    And I need to learn homebridge too - as ideally it would be nice to say Turn all lights off or something similar when going to bed...
     
    impact, Sep 14, 2020
    #17
    Mr Mark likes this.
  18. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    Click the + sign in the Home app on your phone and create a scene "goodnight" to turn all your lights off.

    There is a lot of people who provided instructions to setup various parts.
    https://blog.addictedtopi.com/2017/05/21/installing-c-gate-on-a-raspberry-pi/
    @ievolve Anthony Webb wrote the Homebridge CBus plugin way back in 2016.
    @greig script makes it all very fast to setup.
     
    DarylMc, Sep 14, 2020
    #18
    Mr Mark likes this.
  19. DarylMc

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    348
    Likes Received:
    44
    Location:
    Perth
    Fwiw SHAC doesn’t always play nicely as a CNI. One clients install I have to remote into every so often and re save the cbus settings tab to get it to sync to Homebridge.
     
    chromus, Sep 15, 2020
    #19
  20. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,175
    Likes Received:
    28
    Location:
    Brisbane, QLD, Australia
    Well that doesn’t sound good.
    Have you spoken to tech support?
     
    DarylMc, Sep 15, 2020
    #20
    1. Advertisements

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.