Code Monkey home page Code Monkey logo

homebridge-cbus's People

Contributors

anthonywebb avatar craigsdell avatar dependabot[bot] avatar devbobo avatar jamespickup avatar jasony00 avatar philpearson avatar simonhac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-cbus's Issues

Help with CBUS and homekit Integration

Hi Guys,

Can you please assist and let me know whether i have this setup correctly? I am having troubles setting up accessories, can you assist. Should the username and port be the details of my CNI?

MacBook-Pro-3:~ peterconstantopedos$ homebridge
[6/25/2017, 1:56:46 PM] Loaded plugin: homebridge-cbus
[6/25/2017, 1:56:46 PM] Registering platform 'homebridge-cbus.CBus'
[6/25/2017, 1:56:46 PM] ---
[6/25/2017, 1:56:46 PM] Loaded config.json with 0 accessories and 1 platforms.
[6/25/2017, 1:56:46 PM] ---
[6/25/2017, 1:56:46 PM] Loading 1 platforms...
[6/25/2017, 1:56:46 PM] [CBus] Initializing homebridge-cbus.CBus platform...
cbus:client Opening connection to C-Gate… +0ms
[6/25/2017, 1:56:47 PM] Loading 0 accessories...
cbus:client C-Gate connection open. +14ms

This is what my config.json looks like,
{
"bridge": {
"name": "My Home",
"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": "192.168.1.61",
"client_controlport": 10010,
"client_contolport": 10010,
"client_cbusname": "101SPARK",
"client_network": 254,
"client_application": 56,
"client_debug": true,

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

 "accessories": [
    { "type": "dimmer", "id": 27, "name": "light" },
    { "type": "light", "network": "254", "id": 40, "name": "Outside Light" }
  ]
}

],
"accessories": []
}

Cbus config.json.

Hi I have installed cbus plugin in homebridge and how can I config.json. File and what next can u plz explain step by step I am not that expert thanks.

Allowing for accessories with the same name?

@simonhac originally when I had 2 accessories with the same name, for instance a "Fan", an error would be thrown. I fixed that limitation in this commit:
44f19f7

It looks like we lost that fix in this commit:
098ee24

I guess that we should decide whether we should force each accessory to have a unique name, or not. Does anyone have an opinion on this issue?

Dimmer to On does not ramp brightness to 100

Only when the dimmer function is ramped up to 100 then down to 0 does the press on for the broup result in the brightness going to 100. If turned on from off the brightness in homebridge does not display/is not registered

problem using homebridge service with homebridge-cbus and cgate on PI3

@simonhac @anthonywebb
my pi3 project and the image I uploaded has a problem.
To start CGate I used initd
http://addictedtopi.tumblr.com/post/96351714013/installing-c-gate-on-a-raspberry-pi

To start Homebridge I used systemd
https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi#running-homebridge-on-bootup-systemd

On reboot it seems Homebridge has trouble talking to CGate.
It works fine at setup of Homebridge systemd because CGate is already running.
On reboot Homebridge has control but does not show changes originating from the CBus network.
Restarting Homebridge service fixes it.
I think I need to delay the start of Homebridge service to make sure CGate is loaded and synced.
Could you please help point me to how to do that.
Maybe if Homebridge shut down because CGate wasn't ready could work too.

Error Loading Plugin

Hi Anthony,

I'm new to Homebridge/cbus and keen to get it working for my cbus install at home. Very pleased to find a control solution for my cbus.

I've managed to get Homebridge working and started to control my wemo switches. But not having any luck with getting the cbus plugin working. It's probably just my config.

[3/2/2017, 1:05:43 AM] ====================
[3/2/2017, 1:05:44 AM] ERROR LOADING PLUGIN homebridge-cbus:
[3/2/2017, 1:05:44 AM] SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/usr/local/lib/node_modules/homebridge-cbus/lib/cgate-client.js:14:19)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

I'm trying to connect to a remote laptop with toolkit running connected via usb to a PAC. I've updated the access text file with the homebridge server ip address.

Any ideas on what I'm doing wrong?

file:///home/pi/.homebridge/config.json

Homebridge shutting down at startup

I just tried a new install on pi3 with Jessie Lite
Homebridge connects to CGate then shuts down.
Any ideas?
Thanks

Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

    ┌────────────┐
    │ 031-45-154 │
    └────────────┘

  cbus:client sent command '[100] dbgetxml //OFFICE' +62ms
[5/3/2017, 1:50:40 PM] Homebridge is running on port 51826.
  cbus:client rx snippet 343 'Begin XML snippet' +21ms
  cbus:client rx snippet 347 '<?xml version="1.0" encoding="utf-8"?>' +1ms
  cbus:client rx snippet 347 '<Installation><OID>a513d610-11dd-1035-9156-ed18f01c1456</OID><DBVersion>2.3</DBVersion><Version>1.0…' +1ms
  cbus:client rx response { commandId: 100, code: 344, matched: false, processed: false, type: 'response', raw: '[100] 344 End XML snippet' } +12ms
  cbus:client matched request '[100] dbgetxml //OFFICE' with response '[100] 344 End XML snippet' (0 pending requests) +3ms
pi@raspberrypi:~ $ npm test
npm ERR! Linux 4.9.24-v7+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "test"
npm ERR! node v7.9.0
npm ERR! npm  v4.2.0
npm ERR! path /home/pi/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /home/pi/.npm/_logs/2017-05-03T03_51_58_134Z-debug.log

dimming memory or toggle

@simonhac @anthonywebb
It seems the Homebridge-CBus dimmer is a memory dimmer.
It's a small matter but is there any way to make it toggle?

By the way thanks again for all the work done on this project.
It has enabled me to get Homebridge-CBus running and I have a lot of confidence it is solid.
I've done a complete rebuild at least 10 times to check, double check and learn some stuff.
Made an image of a part build which makes it a lot easier.
Now I just want to let it all run for a while.

I also have Clipsal Homegate software running on a Windows PC using remote CGate on the PI3 as well.
Well done to everyone involved.

Bell Press Function

Hello guys

just wondering if there is any way to enable the lighting group to act as a bell press or timer? i need something like this to be able to control shutter relays and also integration to my alarm system,

currently these groups are set as a lighting group however when turned on they turn off after a second. is there any way to specify this in the config.json file?

thanks

Auto-discover available groups and devices

thought i'd start a discussion around how auto-discovery should be handled.

there are two ways i can think of to find out about devices that aren't configured:

  • monitor cbus network traffic and look for changes made to group addresses that we don't already know about
  • suck out the contents of the c-gate database with DBGET or DBGETXML commands. from a quick look, i think we could build a list of all group addresses (with their tag names) and use the metadata of the associated unit devices to determine/guess the type of accessory.

on my network both of these methods would identify many group addresses that i don't want exposed to homebridge. so perhaps the auto-discovery should only build up a list of candidates, and then require manual intervention to expose to homebridge.

initially, the candidates could be dumped into a JSON file. eventually perhaps we could have a simple web UI that allows management of the accessory database -- add, remove, rename, show/hide accessories.

going further, it would certainly be useful to me to build out the accessory database with statistics such as:

  • last change time, level (plus history)
  • originator of last change
  • affected units
  • etc.

thoughts?

Blinds not stopping

Can anyone confirm that their blinds/shutter control can stop during movement?
I've deployed this at a friends house who is now saying that they cannot stop the blinds midway. The only control they have is fully open or close.
Control from the cbus button panel works fine.

iOS 11 - no worky

I installed iOS11 on a couple of my devices, and, although all my iOS10 devices are still working fine, the iOS11 devices are saying "no response"

I am in the process of updating to the latest homebridge (0.4.28) to see if this helps. Will update this thread as I know more.

Can you clarify how you get the data to fill in the accessory array?

I'm amazed that I've gotten this far. I've got a ubuntu vm running cgate and homebridge. I've added my wemo switches to homebridge and can see them in home kit. Now trying to setup the homebridge-cbus platform has me stumped on how you come up with the values for the accessories array. The following is the error message I'm getting on homebridge after it has a successful connection to cgate.

Message:GET //toledo/254/56/23 level

Message:GET //toledo/254/56/22 level

CBusStatusPacket {
  raw: '401 Bad object or device ID.',
  channel: 'controlStream',
  type: 'unknown',
  source: 'cbus' }
CBusStatusPacket {
  raw: '401 Bad object or device ID.',
  channel: 'controlStream',
  type: 'unknown',
  source: 'cbus' }

Add unit testing

@anthonywebb i am refactoring some code in order to prepare for issue #13. i'd like to include some unit tests. i've written hundreds of unit tests in java, but never in JS.

i was going to have a crack at mocha.js, but have been convinced to invest my time in tape instead.

do you have any strong feelings here?

Bell Press working only once

Firstly a huge thank you to the developers for this plugin.

I have added around 40 C-Bus devices to homebridge and all are working well with the exception of my garage door. The garage door is using a low voltage relay and requires a bell press. I have configured the garage door in config.json as a switch with a duration of 1 second.

When homebridge is fired up I see the current state of all my devices. When I press "on" in home app for the garage door switch I see the cbus message for on and then a subsequent off after 1 second appear on the homebridge console. The garage door immediately opens/closes depending on prior position.

The issue I have is it only works the once (first time) when I try to turn it on again, I see no messages relayed to cbus. There is literally no output logged to the homebridge console on any subsequent presses.

The group address I am using in the config.json is the relay address.

Does this function only work with an actual c-bus switch type or should this be working in my situation where I am using a switch function to control a low voltage relay?

Not sure if I need to change something in C-Bus or my config.json or if this an error within the homebridge plugin.

Any advice is appreciated.

Mike

Capturing changes on a remote network?

Hey Guys,

Is there a trick to getting homebridge to correctly capture activity on a remote network?

I have two networks here at home (254 and 253) separated by a Bridge.

I'm normally resident on 254 and I can initiate changes into dimmers on 253 AOK from local switches + Homebridge, but if a change is made to a group on 253 from a switch on 254, or by a switch on 253 to 253, it's not reflected in HomeBridge/Home - and thus the two fall out of sync.

If I monitor the network (Telnet:C-gate 20025) I'm seeing the changes being reflected back into 254 from 253 (as per the Bridge setting of "Send to adjacent network"):

Greig turns light 253/16 on / off from its switch in network 253:

lighting ramp //19P/253/56/16 153 0 #sourceunit=65 OID=fe65e5c0-063c-1035-b3dc-f0ba9991de2c
lighting ramp //19P/254/56/16 153 0 #sourceunit=-1 OID=186be5b0-0641-1035-b498-f0ba9991de2c
lighting off //19P/253/56/16  #sourceunit=65 OID=fe65e5c0-063c-1035-b3dc-f0ba9991de2c
lighting off //19P/254/56/16  #sourceunit=-1 OID=186be5b0-0641-1035-b498-f0ba9991de2c

(Source unit 65 is the address of the KEY2 unit in the bathroom on network 253, controlling the dimmer on 253/56/16).

I have my Groups all duplicated between networks (which I believe to be the correct config) and config.json edited to reflect to network 253 for the units on the remote network:

{ "type": "dimmer", "id": 16, "network": "253", "name": "B1 LX", "enabled": true },

I've also tried deleting Group 16 from 254 without success.

Any ideas?

TypeError terminates homebridge-cbus on start up

Hi

I'm new to homebridge, homebridge-cbus and CGate.

When I go to start homebridge, I get an error but I don't understand what it means or how to fix it.

The output is as follows.

Matthews-iMac:/ Matt$ homebridge
[3/11/2017, 9:22:20 PM] Loaded plugin: homebridge-cbus
[3/11/2017, 9:22:20 PM] Registering platform 'homebridge-cbus.CBus'
[3/11/2017, 9:22:20 PM] ---
[3/11/2017, 9:22:20 PM] Loaded config.json with 0 accessories and 1 platforms.
[3/11/2017, 9:22:20 PM] ---
[3/11/2017, 9:22:20 PM] Loading 1 platforms...
[3/11/2017, 9:22:20 PM] [CBus] Initializing homebridge-cbus.CBus platform...
cbus:client Opening connection to C-Gate… +0ms
[3/11/2017, 9:22:20 PM] Loading 0 accessories...
cbus:client C-Gate connection open. +4ms
cbus:client Connected to C-Gate server v2.10.6 (build 3145), syntax v1.0 +2ms
cbus:client Configuring C-Gate session… +0ms
cbus:client C-Gate session estabished and configured at 20023:127.0.0.1 +1ms
cbuslatform Loading the accessories list… +0ms
/usr/local/lib/node_modules/homebridge-cbus/index.js:186
for (let config of this.config.accessories) {
^

TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
at CBusPlatform._createAccessories (/usr/local/lib/node_modules/homebridge-cbus/index.js:186:30)
at CBusPlatform.<anonymous> (/usr/local/lib/node_modules/homebridge-cbus/index.js:166:28)
at Carrier.<anonymous> (/usr/local/lib/node_modules/homebridge-cbus/lib/cgate-client.js:195:6)
at emitOne (events.js:96:13)
at Carrier.emit (events.js:188:7)
at /usr/local/lib/node_modules/homebridge-cbus/node_modules/carrier/lib/carrier.js:24:12
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
Matthews-iMac:/ Matt$

My config.json is as follows:

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

"description": "HomeKit API config file.",


"platforms": [
{
"platform": "homebridge-cbus.CBus",
"name": "CBus",
"client_ip_address": "127.0.0.1",
"client_controlport": 20023,
"client_cbusname": "SWINN",
"client_network": 254,
"client_application": 56,
"client_debug": true,

"accesories": [
{ "type": "light", "network": "254", "application": "56", "id": 53, "name": "Study" }
]

}
],
"accessories": [ ]
}

Finally, for completeness, here is a snippet from the CGate logs that appears to show a successful request from homebridge-cbus to CGate and provision of accessories data by CGate to homebridge-cbus.

20170312-214659 803 cmd5 - Host:/127.0.0.1 opened command interface from port: 49962
20170312-214659 899 sys Debug: New Command Context: cc013 = AccessContext Session /127.0.0.1#6
20170312-214659 766 cmd5 - Response: 201 Service ready: Clipsal C-Gate Version: v2.10.6 (build 3145) #cmd-syntax=1.0
20170312-214659 761 cmd5 - Command: [99] events e7s0c0
20170312-214659 766 cmd5 - Response: [99] 200 OK.
20170312-214659 761 cmd5 - Command: [100] dbgetxml //SWINN/254
20170312-214659 766 cmd5 - Response: [100] 343-Begin XML snippet
20170312-214659 766 cmd5 - Response: [100] 344 End XML snippet
20170312-214659 804 cmd5 - Host:/127.0.0.1 closed command interface from port: 49962

Would really appreciate your help to solve this one.

Best wishes

Matt

Ability to set time on dimmer devices

Hi there,

I would love to see the timer feature available for dimmers, not just switches

Thanks again for all the time invested. This plug-in seriously kicks ass!!

Homebridge-cbus install issues and DALI Question

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?

Latest NPM install dosn't include shutter accessory

Not sure what I am doing wrong but I am installing ver 5.3 through NPM but can't get it to install the shutter accessory or update the index etc.
Have uninstalled, re installed & tried updating all with the same results.
Any help would be appreciated.
thanks,

ERROR LOADING PLUGIN homebridge-cbus

On a rasberry pi 3 I have cgate and homebridge and homebridge-cbus running.
Ive upgraded to your latest version of Homebridge-cbus

Now when I run Home bridge I get this error:

====================
[4/25/2017, 10:17:39 AM] ERROR LOADING PLUGIN homebridge-cbus:
[4/25/2017, 10:17:39 AM] SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/usr/local/lib/node_modules/homebridge-cbus/lib/cgate-client.js:14:19)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
[4/25/2017, 10:17:39 AM] ====================

any ideas what I have done wrong?

Update Problem

Hi all,

I have had Homebridge working great for a while and suddenly tonight the IOS device said it was connected but was not. I thought I would upgrade to version 0.5.8 from 0.5.3 however, I now get this error following the homekit code when I start homebridge. Cgate still running fine. Any help appreciated.

Thanks
Glen

cbus:client sent command '[100] dbgetxml //HOMEKITM/254' +354ms
[3/14/2017, 9:57:06 PM] Homebridge is running on port 34574.
cbus:client rx snippet 343 'Begin XML snippet' +28ms
cbus:client rx snippet 347 '' +1ms
cbus:client rx snippet 347 '8ef36500-eada-1034-ad90-a347dd1d27a0HKN

254</Address…' +30ms
cbus:client rx response { commandId: 100, code: 344, matched: false, processed: false, type: 'response', raw: '[100] 344 End XML snippet' } +18ms
cbus:client matched response '[100] 344 End XML snippet' to request '[100] dbgetxml //HOMEKITM/254' (0 pending requests) +3ms
cbus:client rx unparsable line: '[100] 344 End XML snippet', exception: TypeError: Cannot read property 'address' of undefined +994ms

Multiple Instances of Homebridge getting mixed up

Hi all,

First of all can a I say a huge thank you to all who have contributed to Homebridge for Cbus, It is amazing and I have had lots of fun getting it working.

I am not sure if this is a Homekit issue or a Hombridge. I have two Homebridge setups at two different houses, both using a PI for cgate and Homebridge. They both work great and I have just set them up to be available remotely through an AppleTV and an Ipad. I have used different ITunes accounts and have made one a guest on the home Ipad. Therefore I have two instances on my device for the two places, one direct and the other remote (Guest). I setup the second house with an imaged PI of the first house and then just re-configured for the local setup and I used a different pin to avoid confusion. I have also turned off Home Switching.

I have noticed 2 issues that I was hoping someone might understand. The first is that if I am at home and have wifi on, the remote instance only recognises about 1/3 of the devices and the rest are "no response". If I turn off Wifi and use 4G they come back up fine instantly.

Second issue - Having gone from one house to the other, I am now finding that the guest version is getting labels and status mixed up with the local house, ie a room in the home is showing up in the labels for the guest account. Switching still works back as it should.

I can work around it but thought someone might have an idea.

Thanks Glen

Recover from failed socket connection

The other day, for some reason the socket between cgate-client.js and my cgate server failed. When that happens, the client will log errors, but we dont yet have any way to recover/recycle the connection again. This would be a nice addition.

I am attaching some screenshots of what my logs look like when I did hit that failed socket. Once the socket was failed anything I would try to do over that socket was failing and being logged.

screen shot 2017-01-12 at 10 04 47 am
screen shot 2017-01-12 at 10 05 18 am

Add new "indicator" or "status" type?

I was wondering if it would be possible to add a new device type that simply indicates the condition/level of a cbus group address (GA), with no option to change the status itself.

In my setup I have a security panel interfaced through the cbus network (via a minicentral board), and I am exporting the arming state to cbus groups (e.g. cbus GA 1 = "System Armed").

In homebridge, I can setup a light type and the status displays correctly (as a light), but this also permits me to (accidentally) alter the state of the GA, which is undesirable (i.e. I can change the apparent status to disarmed, even though the system remains armed). If I setup a motion or security type device in homebridge, then it seems that the status is only updated (in Home.app) when it changes, which may not occur for a while after a homebridge restart.

Reinstate logging switch

i carelessly removed the debugging switch when i was working on #16.

i'd like to keep the option of richer logging but allow users a level of control over the verbosity.

for unit tests i've started to use the debug library (32.5M downloads over last month), but looks like homebridge uses its own internal debug library. should we stick with that?

the plugin cannot be loaded

I have a question when I installed the home bridge- bus on to raspberry pi it seemed every ok but when I run home bridge display cannot load that plugin I don't know why. I use raspberry pi 3 and 5500cn to connect to cbus. Are there something wrong with it

Adding 2nd network to config.json for CBUS/Homekit

I would like to know whether i can just add a line to config.josn in regards to network? i have the normal network 254 but i also have a wireless network 250. When i add the address of the output i would like to control on network 250 it does not come up in homekit as its not in network 254 which is configured in home kit. Now the simple thing would be to add the group 50 which is on my wireless network to my network 254, But is there a way to add another network line to config.json? Can this be done? i have about 3-4 groups on wireless network that need to be controlled.

Ensure C-Bus network is open before sending any other commands

@simonhac cleaned out my install and decided to try a fresh install as a new user would.

I specified an export file, and upon running homebridge this was in the logs:

cbus:client sent command '[100] dbgetxml //WEBB/254' +22ms
[4/1/2017, 2:36:50 PM] Homebridge is running on port 51826.
cbus:client rx response { commandId: 100,
cbus:client code: 440,
cbus:client matched: false,
cbus:client processed: false,
cbus:client type: 'response',
cbus:client raw: '[100] 440 There is no tag database to perform this operation on' }

Are you aware of any additional work that needs to be done in cgate to make this feature work? It think I have the latest version of cgate running on windows.

Timer to delay Homebridge service start with CGate service and Homebridge on Pi3

Just for information.
Pi3 with Homebridge and CGate running as services at boot.

I had some trouble with Homebridge entering a semi unresponsive state after pi reboot and believe it was due to CGate not fully synced when Homebridge service starts.

I have made a timer to delay the start of Homebridge service and it works great but I just wanted to attach this info from CGate manual with estimates for the sync times.

This should give a rough idea of CGate sync times and the delay required for different sized networks.

Sync Stages
A sync proceeds through several stages.
These are indicated in the log as SyncSubState values.
As a guideline:

Gateway initialisation (1 second)
Unit presence; and (1 second)
Unit duplicate check (15 seconds per 25 units)
Unit Identification (15 seconds per 25 units)
Bridge sync (1 second)
Unit sync (30 seconds per 25 units)
Application sync (1 second per application)

help with my-platform.json

Could someone please describe in a bit more detail how to set up my-platform.json
I did get it going once but now I can't seem to figure out how to do it.
In my case homebridge is now running as a service with systemd.

Guess the type of the accessory from the database

currently, when we suck down the group list via dbgetxml and stash into config.json we don't know the type of each group (unless it has been explicitly registered), and therefore just use the accessory type unknown.

there's no way to ask a group what type it is, but we can work out which unit/s is/are controlled by the group.

by looking at the unitType of the unit/s controlled by the group, we can make a pretty good guess of each accessory's type. if we are not 100% sure, we'll leave it as unknown.

Small bug fix for Project names with digits

Hi Anthony,
thanks so much for your bus homebridge plugin, it's so much fun to use siri to control the lights at home ! There is a small bug in function CBusStatusPacket in cgate-client.js

If the network name has digits, which mine does, the group number is not correctly decoded for a lighting message. This results in home kit getting out of sync with cubs, as it homebridge-cbus thinks things are in a different state to what they really are. The fix is easy:

In lines 312-313 in cgate-client.js change
var temp = array[2].match(/\d+/g);
this.group = temp[2];
->
var temp = array[2].split("/");
this.group = temp[3];

i.e instead of using a regex to extract each of the numbers in the address parameter into the temp array, it splits the address at '/' separators. The forth element ([3]) is the group number, following the standard bus address syntax //PROJ/NET/APPLICATION/GROUP
NB the initial // was already stripped by the previous regexp.

Without this change, the array containing the status of the items gets mixed up with group id and application id, resulting in the confusion in the status array.

C-Bus network starting with a numeral is rejected as illegal

If I'm reading this correctly, homebridge-cbus doesn't like my network as its name starts with a numeral.

The network is called "19P" and has been running here for many years successfully - so appears to be valid from a C-Bus perspective.

I changed it to "HOME" in the config.json file, restarted homebridge and we made it past that point, then failed due to the absence of a Tags file (as you'd expect given I'd made up the new network name).

[4/14/2017, 9:34:15 PM] Loaded plugin: homebridge-cbus [4/14/2017, 9:34:15 PM] Registering platform 'homebridge-cbus.CBus' [4/14/2017, 9:34:15 PM] --- [4/14/2017, 9:34:15 PM] Loaded config.json with 0 accessories and 1 platforms. [4/14/2017, 9:34:15 PM] --- [4/14/2017, 9:34:15 PM] Loading 1 platforms... [4/14/2017, 9:34:15 PM] [CBus] Initializing homebridge-cbus.CBus platform... C:\Users\greig\AppData\Roaming\npm\node_modules\homebridge-cbus\index.js:89 throw new Error(illegal client_cbusname: ${config.client_cbusname}`);
^

Error: illegal client_cbusname: 19P
at new CBusPlatform (C:\Users\greig\AppData\Roaming\npm\node_modules\homebridge-cbus\index.js:89:9)
at Server._loadPlatforms (C:\Users\greig\AppData\Roaming\npm\node_modules\homebridge\lib\server.js:294:32)
at Server.run (C:\Users\greig\AppData\Roaming\npm\node_modules\homebridge\lib\server.js:80:36)
at module.exports (C:\Users\greig\AppData\Roaming\npm\node_modules\homebridge\lib\cli.js:40:10)
at Object. (C:\Users\greig\AppData\Roaming\npm\node_modules\homebridge\bin\homebridge:17:22)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)`

TypeError terminates process soon after startup

I am running homebridge-cbus for the first time, so perhaps i've done something wrong, however when i start up, the process soon terminates with a TypeError

full log:

$ homebridge
[1/8/2017, 9:18:51 PM] Loaded plugin: homebridge-cbus
[1/8/2017, 9:18:51 PM] Registering platform 'homebridge-cbus.CBus'
[1/8/2017, 9:18:51 PM] ---
[1/8/2017, 9:18:51 PM] Loaded config.json with 0 accessories and 1 platforms.
[1/8/2017, 9:18:51 PM] ---
[1/8/2017, 9:18:51 PM] Loading 1 platforms...
[1/8/2017, 9:18:51 PM] [CBus] Initializing homebridge-cbus.CBus platform...
[1/8/2017, 9:18:51 PM] [CBus] Connecting to the local CBus server...
[1/8/2017, 9:18:51 PM] Loading 0 accessories...
[1/8/2017, 9:18:51 PM] [CBus] CBus Client is listening to CGate on 127.0.0.1... Debug: true
[1/8/2017, 9:18:51 PM] [CBus] Registering the accessories list...
[1/8/2017, 9:18:51 PM] [CBus] Initializing platform accessory 'Kitchen Nook'...
[1/8/2017, 9:18:51 PM] [CBus] Initializing platform accessory 'Kitchen Pendant'...
[1/8/2017, 9:18:51 PM] [CBus] Initializing platform accessory 'Kitchen Sink'...
[1/8/2017, 9:18:51 PM] [CBus] Initializing platform accessory 'Pantry PIR'...
[1/8/2017, 9:18:51 PM] [CBus] Initializing platform accessory 'Scullery PIR'...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ 031-45-154 │     
    └────────────┘     
                       
[1/8/2017, 9:18:51 PM] Homebridge is running on port 51826.
CBusStatusPacket {
  raw: '201 Service ready: Clipsal C-Gate Version: v2.10.6 (build 3145) #cmd-syntax=1.0',
  channel: 'controlStream',
  type: 'unknown',
  source: 'cbus' }
/usr/local/lib/node_modules/homebridge-cbus/cgate-client.js:313
        this.group = temp[2];
                         ^

TypeError: Cannot read property '2' of null
    at new CBusStatusPacket (/usr/local/lib/node_modules/homebridge-cbus/cgate-client.js:313:26)
    at CBusClient._resolveReceivedMessage (/usr/local/lib/node_modules/homebridge-cbus/cgate-client.js:253:23)
    at CBusClient._socketReceivedMessageEvent (/usr/local/lib/node_modules/homebridge-cbus/cgate-client.js:200:10)
    at Carrier.<anonymous> (/usr/local/lib/node_modules/homebridge-cbus/cgate-client.js:112:14)
    at emitOne (events.js:96:13)
    at Carrier.emit (events.js:188:7)
    at /usr/local/lib/node_modules/homebridge-cbus/node_modules/carrier/lib/carrier.js:24:12
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

for completeness, my config.json file is:

{
  "bridge": {
    "name": "Kinkora",
    "username": "CC:22:3D:E3:CE:30",
    "port": 51826,
    "pin": "031-45-154"
  },
 
  "description": "This is the My home HomeKit API configuration file.",
 
  "platforms": [
    {
      "platform": "homebridge-cbus.CBus",
      "name": "CBus",
      "client_ip_address": "127.0.0.1",
      "client_controlport": 20023,
      "client_eventport": 20024,
      "client_statusport": 20025,
      "client_cbusname": "SHAC",
      "client_network": 254,
      "client_application": 56,
      "client_debug": true,
      "accessories":
      [
        { "type": "dimmer", "id": "28", "name": "Kitchen Pendant" },
        { "type": "dimmer", "id": "26", "name": "Kitchen Sink" },
        { "type": "light", "id": "27", "name": "Kitchen Nook" },
        { "type": "motion", "id": "110", "name": "Scullery PIR" },
        { "type": "motion", "id": "148", "name": "Pantry PIR" }
      ]
    }
  ],
  "accessories": [ ]
}

Support for blinds/shades/shutter/curtain/window-coverings

i have a number of blinds and would love to control them via homekit.

my newer blinds are wired with shutter relays and i also have a number that use 2 relays from a 12 channel relay.

if anyone is already working on this, please let me know. otherwise i'll bone up on HomeKit and node and have a crack at it.

any recommendations for documentation on HomeKit so i can see how it handles blinds? (i trust that the repo for HomeBridge is my best source for documentation on the HomeBridge architecture.)

Scenes

Is it possible to have cbus scenes show up? maybe as a switch?

CLI tool for generating config.json file

it should be pretty straightforward (and mightily helpful for noobs) to create a CLI tool that asks the user as few questions as possible, tests the connection and then creates / modifies config.json automagically.

  • ask the user if cgate is operating on the local machine, if not,
    • ask for client_ip_address, default to 127.0.0.1
    • ask for client_controlport, default to 20023
  • open client connection and download the project list (a great test of the connection details)
  • ask the user which project to load, default to the first running project, set client_cbusname accordingly, then load and open it, and download accessories
  • (no need to ask for default client_network, default to 254)
  • (no need to ask for default client_application, default to 56)
  • ask for location of homebridge folder, provide default (~/.homebridge on mac/linux, but where on windoze?)
  • if config.json doesn't exist, create it
  • if config.json doesn't include a homebridge-cbus platform section, create one
  • ask if user would like all found accessories to be added to config file, if yes, auto-add everything using the inferred accessory type, advising the user to verif config.json, and hand-edit if necessary.

before making any changes to config.json:

  • do all work on a temporary file
  • ask use whether they want to actually replace the old config.json file, keeping a timestamped backup

Add Lock Mechanism accessory

Hi

This is a request for new accessory types.

In my cbus network, I have certain addresses configured as on/off or bell press that integrate with relays on my alarm panel to trigger door strikes (front door, front gate) or driveway gates. These are exposed through homebridge as switches. This means that, for Siri control, I have to ask "Turn the front door on". Is it possible to expose these devices as a door, lock, gate etc in homebridge so that I could ask Siri "Unlock the front door" or "Close the gates" etc?

Also, I have relays set up for irrigation - master and several zones. These are presently exposed via homebridge as switches. I am wondering whether they can be exposed as an irrigation device (not sure what HomeKit supports in this respect).

BTW, new addition of ramp rate for dimmers is great.

All the best

Matt

Allow for arbitrary code/command execution?

This is a little bit off in the weeds, and a lot more technical than most people would use, but hear me out.

My wife is not very technically minded. She prefers physical interfaces to using apps and software to do things. She told me that I could have a sonos audio system if she could turn it off and on witha switch on the wall.

I solved her problem by creating a new virtual "lighting device" on my network, and tying the button on the light switch to that virtual device.

What I had was code that would listen for on/off events of that virtual device, and turn on and off the sonos. Bingo, she had a switch on the wall that could turn on and off the music.

I am wondering if this project needs to have a similar construct. One that can listen for traffic on predefined (in the config) devices, and do stuff (make http calls, email, sms, etc) What it is is essentially a callback to your own code/commands anytime a devices level changes.

I see this being exposed in the config as an array of "rules" along with a set of "commands" that are to execute if the "expression" is true. For example:

Turn the music on when a button on the wall is pressed

{
    "id":"1",
    "name":"Music On",
    "expression":"id=='95' && level==100",
    "commands":[
        {"type":"url","url":"http://music.restapi/on"},
     ]
}

Turn off the music and the lights off (after 30 seconds) when button on the wall is pressed

{
    "id":"1",
    "name":"Music On",
    "expression":"id=='95' && level==0",
    "commands":[
        {"type":"url","url":"http://music.restapi/off"},
        {"type":"delay","delay":30},
        {"type":"lighting","group":"53","level":0,"delay":0,"timeout":0}
     ]
}

Would this be of interest to anyone else?

Virtual Groups

thanks @xrsprint -- one question: does C-Gate know about the group? ie. can you see it in the database with the C-Bus Toolkit?

i think this could be easy to fix. can i ask you to please write this up as a separate issue and i'll look into it?

Hello Simon,

yes it is seen in toolkit, and operates identical to any other group, the only diffrence is the group is not assigned to a relay or dimmer

cheers

no remote access when using iPad as home hub

Just posting for reference
Remote access to home stopped working for me recently.
Probably because I've created and deleted so many homes in the course of testing.
I use iPad as home hub.

The solution was to disable and enable icloud on devices.

Lock mechanism accessory

Hey guys,

How do you go about adding lock mechanism as an accessory "type" in config.json? Im currently using a shutter relay in which i have only used the open contact terminal. i have set the failsafe relay on shutter relay to 5 sec so when i tell siri to unlock, 5 sec later it relocks the strike, so in regards to unlocking and locking its fine. The issue i have is when i tell her to unlock it again i have to command to lock the door so the state of the shutter switch on homekit changes to closed prior to asking to unlock., or i manually push the shutter button so it changes state to closed then ask her to unlock.

hope this makes sense,

Thanks in advance

Pete

Ramping dim levels

Hi it would be great if we could ramp lights up and down on time schedules.

Morning alarm ramping lights upto a level over a time frame in minutes/seconds I use eve app in ios which allows time schedules for groups. As per you comment on the cbus forum adding a second accessory but with a rampduration attribute for use in scene controls

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.