anthonywebb / homebridge-cbus

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

Issue communicating from homebridge to CBUS #102

Closed AF0013 closed 3 years ago

AF0013 commented 3 years ago

Hi everyone I have been able to connect setup homebridge CBUS to a point where i can see logs from devices on the network (ie: turning lights on and off physically and seeing it logged on the UI) however , when i try to add an accessory there is no response from the light when i toggle it.

These are some screenshots of my homebridge logs. Any help on this issue would be greatly appreciated, i feel like im so close to "hey siri, turn on the bathroom lights" and very excited. Thanks

Capture Homebridge logs 1

Capture Homebridge logs 2

AF0013 commented 3 years ago

I have not, im running home bridge cbus and cgate on a windows PC, though this should make no difference. How do I do this?

On 28 Jul 2020, at 9:35 pm, DarylMc notifications@github.com wrote:

Have you copied the project xml to the tag folder on the pi?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anthonywebb/homebridge-cbus/issues/102#issuecomment-664988792, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQNWAVAZKPELM7RITLYKV63R52ZY5ANCNFSM4PKMCAPQ.

DarylMc commented 3 years ago

It seems from you log that the project xml cannot be found

DarylMc commented 3 years ago

You need to load and start the project in CGate

DarylMc commented 3 years ago

If your project is already on the windows pc it is located in the CGate tag folder. To load it you could test with toolkit to open your project and connect to the CBus network. Or configure the CGate config file to load and start your project automatically. If you are doing this on windows it is best to set up CGate to run in a window not as a service. Maybe you know all this and I didn’t have a close look at your problem but I hope this might help you out till tomorrow.

JasonY00 commented 3 years ago

Daryl is on the money above. If toolkit is running and you can view the cbus logs from your network then homebridge should also work just fine. If both cgate and homebridge are on the same machine then there are no network access issues that would cause this problem as both are localhost (127.0.0.1).

I run my cgate/homebridge on a Windows 10 machine with two instances as I have more than 149 cbus accessories. It is very stable. I also run my cgate as a window and not a service but either way is fine. A service will be more reliable as it will automatically startup in the event of a reboot but you don't get a live "log" to watch for debugging that a window will give you.

To set the default project when starting c-gate find the following two entries in your C-GateConfig.txt configuration file under the ...\CGate2\config\ directory and put in your project name of FOWLER

NOTE: I have changed the hashes in the config file to $ here as the hashes are marked up by the editor as headings!!!

$$$$ project.default: $ Name of the default project $ Default Value: $ Scope: global $ Effective on: restart $$$ project.default= FOWLER

AND...

$$$$ project.start: $ Space-separated list of projects to start on server startup $ Default Value: $ Scope: global $ Effective on: restart $$$ project.start= FOWLER

your FOWLER.xml tag database file should be in the ...\C-Gate2\tag\ directory

Make sure that you also have your project defined in the homebridge config.json file:

        "client_application": 56,
        "client_cbusname": "FOWLER",
        "client_controlport": 20023,
        "client_debug": true,
        "client_ip_address": "127.0.0.1",
        "client_network": 254,
        "name": "CBus",
        "platform": "homebridge-cbus.CBus",
        "platform_export": "my-platform.json"

From your screenshots, I think you are nearly there. Homebridge is logging your cbus messages from the network but doesn't know what to do with them. You can see that your lighting group 131 is being asked for its status but then there is a tag error.

If Daryl's suggestion doesn't fix your problem, then perhaps post a snippet from the cbus portion of your config.json file or us to look at.

Also make sure you install the homebridge-configUI-X plugin so that you can manage the whole homebridge install over a web browser on any device on your network!

It will also provide you with a web interface to test your homebrige-cbus connection before you pair it to your phone/ipad. It also helps you work out if a connection problem is homebridge or device centric. Plus lots of other stuff....

Cheers

Jason

AF0013 commented 3 years ago

Awesome! Thanks for such quick replies. My project XML file was in the tag folder, and once I followed @JasonY00 's instructions, I can now add and interact with my lights! I am now having some difficulty adding my homebridge to Homekit. This is obviously a question for the wider home bridge community, rather than this forum, but if you have any advice it would be appreciated. Is there any settings that I need to change to allow for this connection that jump to mind? Thanks Alex

DarylMc commented 3 years ago

If you can’t see the bridge to add to your Home on the iPhone try resetting by deleting the persist folder. https://github.com/homebridge/homebridge#my-ios-app-cant-find-homebridge

AF0013 commented 3 years ago

Thanks @DarylMc, I did this, nothing changed, went to there vet with the dog, came back and it just... worked?? I don't know what happened but i'm so excited. Ive been trying to do this on and off for about 2 years and it finally works :). Thanks for all your help. Now to add the remaining 130 accessories

JasonY00 commented 3 years ago

Sometimes it can take a little while for the data to sync especially the first time. So always be patient and be prepared to leave it for a little while. Daryl mentioned deleting files in the .persist directory. This often works very well. If you install the homebridge-config-UI-X you can also do this and other troubleshooting maintenance via the homebridge webpage so you don't have to muck around with Windows Explorer or DOS command line. You can also backup/restore and easily edit your config.json file from here. Good plugins also have a web interface that you can "fill out" and it will made the changes to your config-json file for you that are syntactically correct. Looking through the file for a misplaced { or ; is extremely frustrating,

IF YOU HAVE MORE THAN ONE ACTIVE NETWORK INTERFACE on the machine (i.e. ethernet and wifi) sometimes its worth adding the following:

{ "mdns": { "interface": "aaa.bbb.ccc.ddd" },

where aaa.bbb.ccc.ddd is the IP address of the network interface that you want homebridge to communicate on. Add this right at the top of your config.json file after the first "{" before the:

"bridge": {
    "name": "HomeBridge",
    "username": "AA:BB:CC:DD:EE:FF",
    "port": 12345,
    "pin": "123-45-678"

section.

Remember, maximum of 149 accessories per homebridge instance. At 150 it will not start at all! You will have to add another instance but this is not difficult. Now you have to find what else you can find a plug in for to control with siri. I suggest adding the homebridge-gsh plugin for Google Home support and there is a homnebridge-alexa plugin for Alexa support if you want them. Look in the cbus forums under voice control. IP Cameras are great, a little fiddly but well worth the effort. Use the homebridge-camera-ffmpeg plugin. It is well supported and kept up to date.

Congratulations and enjoy!

It's only the beginning...

Cheers

Jason

AF0013 commented 3 years ago

I think I have 151 devices on the network, however I cannot foresee needing to all all of these, so I should be fine with one instance. Yes! The Homebridge UI is great, the PC is in the server rack while I sit in the kitchen and fill in my config file to add all the accessories via my MacBook. Very handy. Ill have a look at the camera-ffmpeg plugin, as we have a number of cameras which I look at regularly to check what's going on around the house, so it'd be great to have these within the HomeKit APP.

JasonY00 commented 3 years ago
  1. You will find more... :-)

If you hit any brick walls, you can contact me on jasonandrewyoung@gmail.com if you need help. My win10 server is also rackmounted and I have played around with a few cameras and several plugins. If it saves you time and mistakes. Always happy to assist.

Cheers

Jason