anthonywebb / homebridge-cbus

CBus plugin for homebridge
MIT License
35 stars 20 forks source link

Homebridge-cbus install issues and DALI Question #51

Closed stedoh closed 7 years ago

stedoh commented 7 years ago

Hi I have recently installed Homebridge and the homebridge-cbus plugin and I am unable to get it to work. This is very new to me so I would suggest I am doing some thing wrong.

When I try and run homebridge it returns the following error:

C:\Users\lucy>cd C:\Users\lucy\AppData\Roaming\npm\node_modules\homebridge\bin

C:\Users\lucy\AppData\Roaming\npm\node_modules\homebridge\bin>node homebridge
[5/9/2017, 9:11:09 PM] ====================
[5/9/2017, 9:11:09 PM] ERROR LOADING PLUGIN homebridge-cbus:
[5/9/2017, 9:11:09 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\lucy\AppData\Roaming\npm\node_modules\homebr
idge-cbus\lib\cgate-client.js:14:19)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
[5/9/2017, 9:11:09 PM] ====================
[5/9/2017, 9:11:09 PM] Loaded plugin: homebridge-http
[5/9/2017, 9:11:09 PM] Registering accessory 'homebridge-http.Http'
[5/9/2017, 9:11:09 PM] ---
[5/9/2017, 9:11:09 PM] Loaded config.json with 0 accessories and 1 platforms.
[5/9/2017, 9:11:09 PM] ---
[5/9/2017, 9:11:09 PM] Loading 1 platforms...
C:\Users\lucy\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 p
lugin.
    at API.platform (C:\Users\lucy\AppData\Roaming\npm\node_modules\homebridge\l
ib\api.js:128:13)
    at Server._loadPlatforms (C:\Users\lucy\AppData\Roaming\npm\node_modules\hom
ebridge\lib\server.js:284:45)
    at Server.run (C:\Users\lucy\AppData\Roaming\npm\node_modules\homebridge\lib
\server.js:80:36)
    at module.exports (C:\Users\lucy\AppData\Roaming\npm\node_modules\homebridge
\lib\cli.js:40:10)
    at Object.<anonymous> (C:\Users\lucy\AppData\Roaming\npm\node_modules\homebr
idge\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)

I am attempting to install on a window 10 computer which is also running toolkit and is connected via Ethernet to a CNI

Any help would be much appreciated and I might be able to keep some hair!

Also I have installed Dali Lighting through my place which interface with the CBus via a CBUS to Dali Gateway. I therefore have a "DALI" Application. I note this is not in the Applications list Wiki. will this be an issue?

simonhac commented 7 years ago

I am attempting to install on a window 10 computer

has anyone had an experience running homebridge-cbus under windows 10? (it certainly hasn't been tested by me, though i can't see any reason why it couldn't be made to work.)

generally weird errors in the first few lines of one of the core files, like cgate-client.js ends up being a result of have an 'old' version of node in your path... but that's as far as my windows troubleshooting can extend, sorry.

Also I have installed Dali Lighting through my place which interface with the CBus via a CBUS to Dali Gateway. I therefore have a "DALI" Application. I note this is not in the Applications list Wiki. will this be an issue?

nope. shouldn't be a problem at all.

anthonywebb commented 7 years ago

Can you try: node --version

I have a windows 10 machine I can try to duplicate the issue from. Maybe include your config file as well so we can ensure that is correct as well.

Sent from my iPhone

On May 9, 2017, at 5:59 AM, simonhac notifications@github.com wrote:

I am attempting to install on a window 10 computer

has anyone had an experience running homebridge-cbus under windows 10? (it certainly hasn't been tested by me, though i can't see any reason why it couldn't be made to work.)

generally weird errors in the first few lines of one of the core files, like cgate-client.js ends up being a result of have an 'old' version of node in your path... but that's as far as my windows troubleshooting can extend, sorry.

Also I have installed Dali Lighting through my place which interface with the CBus via a CBUS to Dali Gateway. I therefore have a "DALI" Application. I note this is not in the Applications list Wiki. will this be an issue?

nope. shouldn't be a problem at all.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

stedoh commented 7 years ago

Node Version is v5.0.0

Config file:

{
     "bridge": {
        "name": "HomeBridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },

    "description": "My home homeKit API configuration file",

        "platforms": [
    {
      "platform": "homebridge-cbus.CBus",
      "name": "CBus",
      "client_ip_address": "10.120.120.125",
      "client_controlport": 10001,
      "client_cbusname": "12POLACK",
      "client_network": 254,
      "client_application": 56,
      "client_debug": true,

      "platform_export": "my-platform.json",

      "accessories": [
        { "type": "DALI", "id": 194, "name": "RUMPUS REAR" },
        { "type": "DALI", "id": 195, "name": "RUMPUS CENTRE" },
        { "type": "DALI", "id": 196, "name": "RUMPUS REAR" }

      ]
    }
  ],
  "accessories": [ ]
}
simonhac commented 7 years ago

v5.0.0 is now quite old. please update to latest (LTS) and try again.

stedoh commented 7 years ago

ok so updated node js and reloaded homebridge and cbus plugin.... I was following and older instruction of how to install home bridge and so used the versions noted in the instructions.

now I believe home bridge is almost running, just not connecting to c-gate. I think it is still reverting to port 20023, when CNI is 10001

Following error is occurring:

C:\Users\lucy>cd C:\Users\lucy\AppData\Roaming\npm\node_modules\homebridge\bin

C:\Users\lucy\AppData\Roaming\npm\node_modules\homebridge\bin>node homebridge
[5/11/2017, 8:32:35 PM] Loaded plugin: homebridge-cbus
[5/11/2017, 8:32:35 PM] Registering platform 'homebridge-cbus.CBus'
[5/11/2017, 8:32:35 PM] ---
[5/11/2017, 8:32:35 PM] Loaded plugin: homebridge-http
[5/11/2017, 8:32:35 PM] Registering accessory 'homebridge-http.Http'
[5/11/2017, 8:32:35 PM] ---
[5/11/2017, 8:32:35 PM] Loaded config.json with 0 accessories and 1 platforms.
[5/11/2017, 8:32:35 PM] ---
[5/11/2017, 8:32:35 PM] Loading 1 platforms...
[5/11/2017, 8:32:35 PM] [CBus] Initializing homebridge-cbus.CBus platform...
  cbus:client Opening connection to C-Gate… +0ms
[5/11/2017, 8:32:35 PM] Loading 0 accessories...
  cbus:client C-Gate socket error: Error: connect ECONNREFUSED 10.120.120.125:20
023 +1s
  cbus:client C-Gate connection could not be opened; exiting. +0ms

I have change the port to 10001 (See copy of config.json file above)

any help?

DarylMc commented 7 years ago

The IP address required here is where CGate is running. If CGate is running on your PC probably 127.0.0.1 Port is correct 20023 I'm sure CGate wont like a number at the start of a project name. From CGate manual - "The name of a project. Generally project names shall not start with a number, and will be 8 or less uppercase characters. E.g. HOME or CIS."

simonhac commented 7 years ago

homebridge-cbus can't connect directly to the CNI, but connects to cgate (almost always port 20023) which itself connects to the CNI.

if homebridge is running on a different machine you'll have to set up to access file in the cgate config to permit remote access.

@stedoh, make sure you can make a remote connection to cgate using cbus toolkit and the same IP address and port setting as you are using in config.json -- if you can't get that working then homebridge won't work.

simonhac commented 7 years ago

I was following and older instruction of how to install home bridge and so used the versions noted in the instructions.

@stedoh where did you find those instructions? we should let them know they are out of date.

DarylMc commented 7 years ago

If you look at Stedoh's config.json accessories "type": "DALI" I think that should be "dimmer" If his CBus network is set up for DALI lights to use CBus DALI application I believe the application number will be 95. So I see at the start of the config.json cbus lighting application 56 is specified. Then I look at anthonys example for a security application { "type": "security", "application": 208, "id": 1, "name": "Entry Zone" },

Therefore I presume application 56 is set as default and if you want another application it needs to be specified. So I think stedoh needs something like this { "type": "dimmer", "application": 95, "id": 194, "name": "RUMPUS REAR" },

simonhac commented 7 years ago

If you look at Stedoh's config.json accessories "type": "DALI" I think that should be "dimmer"

yes, good pickup -- DALI is not an accessory type.

Therefore I presume application 56 is set as default and if you want another application it needs to be specified. So I think stedoh needs something like this { "type": "dimmer", "application": 95, "id": 194, "name": "RUMPUS REAR" },

yes, you are right @DarylMc, if you want to use an application other than the default, it needs to be specified.

simonhac commented 7 years ago

how are you going with this @stedoh? sorted?

stedoh commented 7 years ago

sorry gents been very busy!

Thank you al for your help .... as per the last comment my understanding of the "applications" and "type" was a little squewd! I was using my CBUS type and application names.

I also had the ip address for Cgate wrong I was using my CNI IP.....

plugged those in and it works like a dream!

playing around with the automation now ...

thanks again for your help

DarylMc commented 7 years ago

@stedoh Well done. Could you please point to the instructions you used for setting it up on a Windows PC? Even though I have CGate and Homebridge running on PI3 I would like to consider running it at a site which already has a PC running Clipsal HomeGate software. Thanks