ilcato / homebridge-Fibaro-HC2

Homebridge plugin for Fibaro Home Center 2 (and Home Center Lite ...)
Apache License 2.0
67 stars 27 forks source link

homebridge for fibaro doesnt get connected when the homecenter lite controller restarts #191

Open allwyn007 opened 4 years ago

allwyn007 commented 4 years ago

my home bridge gets disconnected with fibaro hcl controller whenever the controller restarts... please suggests a way that whenver fibaro homecenter lite restart after 5 minutes homebridge(raspberry pi)should also restart

ilcato commented 4 years ago

There's no "state" between homebridge and hc, so it shouldn't care if hc/hcl restart. By the way how often do you need to restart hc ?

allwyn007 commented 4 years ago

once power goes off, both hc and homebridge(raspberry pi) gets off. once power comeback fibaro needs atleast 2-3 minutes to get started at the same time homebridge starts and is not able to get connected with hc. so i have to restart the homebridge whenever there is power outage and then only its get connected with hc and thus works with homekit..

ilcato commented 4 years ago

I can suggest to insert a 5 minutes delay in your homebridge startup script. What are you using for the homebridge management?

allwyn007 commented 4 years ago

docker

ilcato commented 4 years ago

how are you starting it?

allwyn007 commented 4 years ago

Start Homebridge Run this command to start Homebridge docker run -d --restart=always --net=host \ --name=homebridge \ -v /storage/homebridge:/homebridge \ -e HOMEBRIDGE_CONFIG_UI=1 \ -e HOMEBRIDGE_CONFIG_UI_PORT=8581 \ oznu/homebridge:raspberry-pi

allwyn007 commented 4 years ago

Homebridge Starts on Boot Open /storage/.config/autostart.sh for editing in nano: nano /storage/.config/autostart.sh

allwyn007 commented 4 years ago

@ilcato can you please suggest script.. i am new to coding

ilcato commented 4 years ago

show me the /storage/.config/autostart.sh file

allwyn007 commented 4 years ago

docker restart homebridge

allwyn007 commented 4 years ago

this command is added to the bottom of the line /storage/.config/autostart.sh file

ilcato commented 4 years ago

insert sleep 300 before it

allwyn007 commented 4 years ago

so the command will be 'sleep 300 docker restart homebridge'

allwyn007 commented 4 years ago

sleep 300 && docker restart homebridge & is this command okay!?

ilcato commented 4 years ago

No: sleep 300 docker restart homebridge

allwyn007 commented 4 years ago

i tried to add but it says no such file or directory

ilcato commented 4 years ago

In wich operating system are you running the script?

allwyn007 commented 4 years ago

raspbian

allwyn007 commented 4 years ago

p

ilcato commented 4 years ago

Try with sudo before the nano command

allwyn007 commented 4 years ago

i tried still it says same

allwyn007 commented 4 years ago

https://github.com/oznu/docker-homebridge/wiki/Homebridge-on-LibreELEC

i followed the above to setup homebridge

ilcato commented 4 years ago

Did you try the approach described in the last 2 pages?

allwyn007 commented 4 years ago

in which last 2 pages?

ilcato commented 4 years ago

You posted another to a pdf page before the previous one

allwyn007 commented 4 years ago

yes i tried that but that was not working

ilcato commented 4 years ago

Please execute: ls /storage/.config/autostart.sh

allwyn007 commented 4 years ago

it says la command not found

ilcato commented 4 years ago

Sorry ls

allwyn007 commented 4 years ago

it says like this ls: cannot access '/storage/.config/autostart.sh': No such file or directory

ilcato commented 4 years ago

But you previously said that it contains: docker restart homebridge

allwyn007 commented 4 years ago

i thought so but now iam trying to nano its not showing... is it possible to create again

ilcato commented 4 years ago

You must create the .config Folder before with mkdir /storage/.config

allwyn007 commented 4 years ago

it says like this mkdir: cannot create directory ‘/storage/.config’: Permission denied

allwyn007 commented 4 years ago

i tried with sudo its created

ilcato commented 4 years ago

use sudo mkdir /storage/.config

allwyn007 commented 4 years ago

its created ... can you tell me the next step

ilcato commented 4 years ago

sudo nano /storage/.config/autostart.sh

allwyn007 commented 4 years ago

i did it and i pasted the sleep 300 docker restart homebridge but still the problem exists

allwyn007 commented 4 years ago

i mean the homebridge is not getting restarted

allwyn007 commented 4 years ago

with respect to 300

ilcato commented 4 years ago

Did you put th 2 commands into 2 different lines?

allwyn007 commented 4 years ago

yes... still not working

ilcato commented 3 years ago

Did you restart the raspbian machine ?