Closed MtSamsonite closed 7 years ago
@MtSamsonite If it is the CBus 8 channel extra low voltage relay it has a fairly slow response time. Do you have the garage door working off a regular CBus key input?
@DarylMc
It is the 8 channel extra low voltage relay. I do appreciate it may be slow, but in this instance their is not even a command being sent from homebridge on the second or any subsequent activation via homekit.
I do have a Cbus key input also configured, and plan on trying to configure the accessory to use the key input in place of the relay as I understand you are likely suggesting. Only issue is the accessory is in another application group, hopefully simply adding the application group parameter to this accessory in config.json to specify an alternative application group is all that is required.
I will give this a go tonight and report back.
Thanks for your input
Mike
I just tried bell press and it does seem to have a problem. On the first press it works fine. One the second press no on command is seen on the CBus network and button does not time out. Another press sees command "off" on cbus network. For me next on command works fine. Also if phone goes to sleep between on presses or home app is closed it seems to work correctly.
@DarylMc
Thank you for testing and confirming the fault. Sometimes with these types of projects you can never be sure if its something wrong with your set-up or a fault in the software. Greatly appreciate you replicating the error.
Mike
@anthonywebb @simonhac Hello I had a look at the switch accessory.js file but could not quite understand how it all works. Just to try help I will mention as best I can what is happening at least for me.
Open Home app and bell press function works fine first time. It activates the relay, indicates on, times out at one second and indicates off on phone as expected. Next press it indicates on but there is no command seen on Homebridge or CGate and it doesn't time out. Next press the phone indicates off and the command is seen on Homebridge and CGate. Next press it works correctly again.
If the app is closed and reopened the Homebridge requests the status of the CBus network. It works fine every time for the first use in that case.
@DarylMc Thanks Daryl for investigating a little further. I have noticed you contribute significantly to a lot of the C-bus forums.
Its actually a friends house I was assisting with I don't have C-Bus myself though I am considering it given I have now had to learn toolkit and piced to assist my friend.
I no longer require the bell press as we connected a push switch on the garage door rails and connected it to a aux input module so we could tell when it was closed. I then used another group address as the switch with some logic that checks the door status and toggles the relay to close/open the door. This logic runs on my friends PAC module. This enables us to simply use a on/off switch in homebridge which accurately represents the door state at all times (eg: on=open and off=closed). (the logic will retry toggling the door up to 4 times as it reverses direction in the situation it was interrupted with a uhf key or button connected directly to the garage door. If it fails it puts the switch back to prior position so the state remains accurate)
I will leave the issue open for the developers as they may wish to investigate for other users. If this is not the correct protocol and I should be closing the issue if it no longer concerns me, please let me know.
Mike
@MtSamsonite Nice work. That sounds impressive and a much better setup. Did you run through recovery settings and check response from mains power cycle?
Leave the issue open until we hear from @simonhac or @anthonywebb
@DarylMc
To be totally honest we haven't I think we should be ok but will check. Appreciate the advice.
I think the logic should correct any state discrepancies on first scan but you have me questioning that now as I consider the mix of scenarios. It seems I'm not finished with it yet.
I will leave the issue open as advised
Mike
Probably most importantly check the recovery settings for the relay though it probably is alright. It wouldn't hurt to test it all in a power recovery scenario. I'd like to see the logic you made because it sounds like you put a bit of thought into it and I am about to help someone set up a garage door.
@DarylMc Daryl, I did it on my friends pc via teamviewer so don't have the code here, I have asked him to email me the code so I can share with you but essentially the garage door setup is as follows (written in pseudo code as I dont have the correct syntax in front of me)
Set up garage door relay to group "garage relay" Set up garage door push switch to aux input module - bistable switch =on/off activates group "garage door status" Setup group "Dummy Switch" ( I assigned this to a spare relay port, c-bus should also work with an virtual group address, but I had read homebridge-cbus needs to be attached to a real c-bus unit, not sure how accurate this is as I haven't tested yet using a group not attached to an actual unit).
Code something like this
@DarylMc Seems my line breaks for sample code above did not work when commenting. Hope you can make sense of the above.
Mike
@MtSamsonite Send me a PM on CBus forum and I will give you all my contact details. I'm thinking of going to new Wiser product release this week if I can find out some more details when and where.
@DarylMc @MtSamsonite Thanks for your work on this guys. How good is this homebridge-cbus now! I see you mentioned Wiser. I happened to be looking through npmjs yesterday and saw this: paulw11/homebridge-wiser Tried it out - it works but limited device types etc at the moment. I'm sticking with this addon as it is far superior and I've used and still use a bunch of Anthony's great code over the years.
@rbhr I think Homebridge CBus is pretty good too. A real credit to the folks who made it.
I've figured out what the issue is and submitted a potential fix. Hopefully will get merged soon.
I'm just trying to give it a go now
@PhilPearson That's great it worked and no other problems noted at this stage. I wish I understood a bit more about it. On my pi3 sudo nano /usr/lib/node_modules/homebridge-cbus/accessories/switch-accessory.js added the line 71 from your fix and rebooted.
Thanks very much.
@MtSamsonite I just found while making a Homebridge-CBus pi3 image for someone a bit of a problem. I made an image for someone else's Home. They had a different IP address for the CNI so it wasn't actually connected to my CNI when I booted up the pi. I was able to add all the accessories on my phone and operate them on the phone interface. It occurred to me that if the CNI goes down due to power failure or whatever reason the Home app will not reflect status correctly. I tested it here with my own project and found that to be the case. You can see that is a bad thing especially for remote access control. Just wanted you and everyone else to be aware.
@MtSamsonite @anthonywebb @simonhac I just made a new image and noticed this is fixed now. Well done. I think the issue can be closed.
@anthonywebb @simonhac @DarylMc
Thank you for the update. Closing this issue now.
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