anthonywebb / homebridge-cbus

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

Bellpress type functionality #101

Open DaveGraham123456 opened 4 years ago

DaveGraham123456 commented 4 years ago

Hi everyone,

I can't tell you how fantastic getting the C-bus all working has been. @Greiginsydney and his instructions building this has been amazing.

Anyway. I have a relay in which I use to trigger a bell press to open my garage door. No power, just a bellpress button press.

How do I reflect that in the json file? I currently have it in the light applicaton.

Any tips?

DarylMc commented 4 years ago

https://github.com/anthonywebb/homebridge-cbus#registering-accessories

DarylMc commented 4 years ago

Set it up as a switch type and use the active duration setting. If you follow that link you will see an example in the config.

JasonY00 commented 4 years ago

Hi Dave,

this is all you need:

            {
                "type": "switch",
                "id": 162,
                "name": "Garage Door",
                "activeDuration": "2s",
                "enabled": true
            },

Where the ID is the number of your Group Address in the Lighting Application for your Garage Door relay channel.

Cheers

Jason

DaveGraham123456 commented 4 years ago

Hi @JasonY00 and @DarylMc

I finally got some time to try this. I carefully updated my json file and rebooted my Pi

Well, that was it. nothing responding. I was able to SSH, further edit the file, no matter what I do it doesn't work. I reverted everything and still nothing. I ran up toolkit and found the CNI is not the issue as I was able to open the network etc.

I ran the logging from Greig in Sydney's instructions. (this is my setup)

sudo journalctl -u homebridge.service -f

Hombridge service won't start. Any tips? or I am wiping and starting again?

Jul 21 21:14:30 cbus-pi systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE Jul 21 21:14:30 cbus-pi systemd[1]: homebridge.service: Failed with result 'exit-code'. Jul 21 21:14:40 cbus-pi systemd[1]: homebridge.service: Service RestartSec=10s expired, scheduling restart. Jul 21 21:14:40 cbus-pi systemd[1]: homebridge.service: Scheduled restart job, restart counter is at 4. Jul 21 21:14:40 cbus-pi systemd[1]: Stopped Node.js HomeKit Server. Jul 21 21:14:40 cbus-pi systemd[1]: Started Node.js HomeKit Server. Jul 21 21:14:41 cbus-pi homebridge[672]: [7/21/2020, 9:14:41 PM] There was a problem reading your config.json file. Jul 21 21:14:41 cbus-pi homebridge[672]: [7/21/2020, 9:14:41 PM] Please try pasting your config.json file here to validate it: http://jsonlint.com Jul 21 21:14:41 cbus-pi homebridge[672]: [7/21/2020, 9:14:41 PM] Jul 21 21:14:42 cbus-pi homebridge[672]: SyntaxError: Unexpected token : in JSON at position 11 Jul 21 21:14:42 cbus-pi homebridge[672]: at JSON.parse () Jul 21 21:14:42 cbus-pi homebridge[672]: at Function._loadConfig (/usr/lib/node_modules/homebridge/src/server.ts:218:21) Jul 21 21:14:42 cbus-pi homebridge[672]: at new Server (/usr/lib/node_modules/homebridge/src/server.ts:120:44) Jul 21 21:14:42 cbus-pi homebridge[672]: at cli (/usr/lib/node_modules/homebridge/src/cli.ts:54:18) Jul 21 21:14:42 cbus-pi homebridge[672]: at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22) Jul 21 21:14:42 cbus-pi homebridge[672]: at Module._compile (internal/modules/cjs/loader.js:1138:30) Jul 21 21:14:42 cbus-pi homebridge[672]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) Jul 21 21:14:42 cbus-pi homebridge[672]: at Module.load (internal/modules/cjs/loader.js:986:32) Jul 21 21:14:42 cbus-pi homebridge[672]: at Function.Module._load (internal/modules/cjs/loader.js:879:14) Jul 21 21:14:42 cbus-pi homebridge[672]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) Jul 21 21:14:42 cbus-pi systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE Jul 21 21:14:42 cbus-pi systemd[1]: homebridge.service: Failed with result 'exit-code'

DaveGraham123456 commented 4 years ago

I now see a glaring issue

Jul 21 21:14:41 cbus-pi homebridge[672]: [7/21/2020, 9:14:41 PM] There was a problem reading your config.json file. Jul 21 21:14:41 cbus-pi homebridge[672]: [7/21/2020, 9:14:41 PM] Please try pasting your config.json file here to validate it: http://jsonlint.com Jul 21 21:14:41 cbus-pi homebridge[672]: [7/21/2020, 9:14:41 PM] Jul 21 21:14:42 cbus-pi homebridge[672]: SyntaxError: Unexpected token : in JSON at position 11

I will go look into this now.

DaveGraham123456 commented 4 years ago

Yep, f$%^ curly bracket missing. god dammit.... fixed now

JasonY00 commented 4 years ago

Hi Dave,

Glad it worked. Remember if using the homebridge-config-UI (ie. the web interface) There is an option at the top right to backup your configuration. If you destroy the config file, just do a restore from the same drop down menu and you are back in business.

You also don't need to restart your pi when you make a change to the config.json file. If you have the homebridge-config-UI installed, just hit the restart button on the homebridge webpage. I didn't use the automated install, so I don't know if the homebridge-config-UI is installed. If it isn't, then do yourself a favour and install it. Then you can manage your homebridge installation from any device on your network from the comfort of your chair.

I also sent you a message regarding the temp sensor support.

Cheers

Jason