Open martinjgreenn opened 3 years ago
I think you'll find that network is an integer value, not a string.
Try "network": 254
Sorry that was me trying to fix it. Changing to an integer doesn't fix. Whether an integer, string or network not specified, results are the same. (I notice it's not a required field + it's already got the network ID in the netid)
Indeed if I remove the accessories section entirely, it produces the same error.
Can you define the network under the platform definition with:
"client_network": 254,
and remove it from your accessory definition.
You should also add the default application and control ports here. See the example config file.
the error looks like it’s saying that the c-bus group address “1” is not a number (NaN). The code that’s creating the CBusNetID says that it is creating an ID that has a valid network and application address but an invalid group address. //HOME/254/56/NaN = “Invalid CBus Group Address”. It has successfully constructed the rest of the CBus ID for the get command i.e. “get 254/56/1” which is what it wants to do first to find what state the accessory is in.
Perhaps also delete and retype the accessory line just in case.
Hope this helps
Cheers
Jason
@martinjgreenn try this one jsonformatter.txt
@martinjgreenn For platform export it appears you don't have a valid path. For example on my raspberry pi it is
"platform_export": "/home/pi/my-platform.json",
@martinjgreenn Just in case you didn't know there is a very easy semi automated setup for raspberry pi here https://github.com/greiginsydney/Homebridge-cbus-installer
ok I imported Daryl's config and discovered c-gate had lost my project. Reimported and it errors again:
ERROR failed to load C-Gate database: Error: badly formed netid: '//HOME/254/56/NaN' at Function.CBusNetId.parse (/usr/local/lib/node_modules/homebridge-cbus/lib/cbus-netid.js:152:9) at CGateDatabase.getNetworkEntity (/usr/local/lib/node_modules/homebridge-cbus/lib/cgate-database.js:341:21) at /usr/local/lib/node_modules/homebridge-cbus/lib/cgate-database.js:281:25 at arrayEach (/usr/local/lib/node_modules/homebridge-cbus/node_modules/lodash/lodash.js:530:11) at Function.forEach (/usr/local/lib/node_modules/homebridge-cbus/node_modules/lodash/lodash.js:9410:14) at /usr/local/lib/node_modules/homebridge-cbus/lib/cgate-database.js:279:6 at /usr/local/lib/node_modules/homebridge-cbus/node_modules/lodash/lodash.js:4967:15 at baseForOwn (/usr/local/lib/node_modules/homebridge-cbus/node_modules/lodash/lodash.js:3032:24) at /usr/local/lib/node_modules/homebridge-cbus/node_modules/lodash/lodash.js:4936:18 at Function.forEach (/usr/local/lib/node_modules/homebridge-cbus/node_modules/lodash/lodash.js:9410:14) [4/27/2021, 11:54:11 AM] [HB Supervisor] Homebridge Process Ended. Code: 1, Signal: null
Update: repointing it at c-gate on my laptop and it works. Which is curious - I can see the tree and devices via telnet on linux machine. I might have a look at greginsydney's installer see if there's anything I'm missing as far as c-gate.
Thanks for help btw!
@martinjgreenn
Not sure but here are a few things to consider. To get cgate to load and open the project you need to edit the cgate config file located in the cgate folder. Scroll down and add your project name in these two places. eg project.default=HOME project.start=HOME Check your project file eg HOME.xml is in the tag folder of the cgate directory where you are running cgate. Check no other instances of CGate on another PC are simultaneously connecting to your CNI . Restart CGate or reboot if you made any changes
Just to be safe, I would also copy your c-gate database back over from your laptop and overwrite the one you have on your CentOS. It may be corrupt. Have a look at the HOME.XML file and see if there is anything strange about the entry relating to your CBUS GA 1 entry. Make sure you do what DarylMC says above and ensure that your project.default and project.start entries are updated.
Your error:
ERROR failed to load C-Gate database: Error: badly formed netid: '//HOME/254/56/NaN'
at Function.CBusNetId.parse (/usr/local/lib/node_modules/homebridge-cbus/lib/cbus-netid.js:152:9)
is from this module:
CBusNetId.parse = function (netIdString) {
const NETID_REGEX = /^\/\/([A-Z0-9_]{1,8})(?:\/(\d{1,3})(?:\/(p|\d{1,3})(?:\/(\d{1,3}))?)?)?\/?(\d{1,3})?$/;
let components = netIdString.match(NETID_REGEX);
if (!components) {
throw new Error(`badly formed netid: '${netIdString}'`);
}
return new CBusNetId(components[1], components[2], components[3], components[4], components[5]);
};
It is not seeing what it is expecting (an integer) for the C-Bus Group Address after the match command and it is all falling over after that. This command is cutting up the CBus response into separate components of Database, Network, Application, Group Address and Channel (for measurement devices such as Temp Sensors). It is failing on components[4] which is the group address.
Probably more than you needed to know, but whatever the cause, this is the outcome.
Cheers
Jason
I have homebridge and homebridge-cbus installed on CentOS 8. C-Gate is installed and I have verified I can connect on 127.0.0.1 20023:
Config is:
However when I restart Homebridge it crashes with: [4/27/2021, 8:09:26 AM] [HB Supervisor] Starting Homebridge with extra flags: -I [4/27/2021, 8:09:26 AM] [HB Supervisor] Started Homebridge v1.3.4 with PID: 55186 Initializing HAP-NodeJS v0.9.4... [4/27/2021, 8:09:26 AM] Loaded config.json with 0 accessories and 2 platforms. [4/27/2021, 8:09:26 AM] Loaded 0 cached accessories from cachedAccessories. [4/27/2021, 8:09:26 AM] --- [4/27/2021, 8:09:27 AM] Loaded plugin: homebridge-cbus@1.1.0 [4/27/2021, 8:09:27 AM] Registering platform 'homebridge-cbus.CBus' [4/27/2021, 8:09:27 AM] --- [4/27/2021, 8:09:27 AM] Loaded plugin: homebridge-config-ui-x@4.41.0 [4/27/2021, 8:09:27 AM] Registering platform 'homebridge-config-ui-x.config' [4/27/2021, 8:09:27 AM] --- [4/27/2021, 8:09:27 AM] Loaded plugin: homebridge-nest@4.5.3 [4/27/2021, 8:09:27 AM] Registering platform 'homebridge-nest.Nest' [4/27/2021, 8:09:27 AM] --- [4/27/2021, 8:09:27 AM] Loading 2 platforms... [4/27/2021, 8:09:27 AM] [Config] Initializing config platform... [4/27/2021, 8:09:27 AM] [Config] Running in Service Mode [4/27/2021, 8:09:27 AM] [CBus] Initializing homebridge-cbus.CBus platform... 2021-04-26T22:09:27.114Z cbus:platform Loading the accessories list… 2021-04-26T22:09:27.116Z cbus:platform Registering the accessories list… [4/27/2021, 8:09:27 AM] Initializing platform accessory 'Dining Lights'... Preparing Advertiser for 'Homebridge 44D3 4936' using bonjour-hap backend! Setup Payload: X-HM://00250DHESDLEH Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
It seems to be passing an invalid network address to C-Gate?