pponce/homebridge-script2

Accessory shows "No Response" in home app.

Closed this issue · 8 comments

The accessory works fine in the home bridge, turning on and off as expected, and executing the scripts. However, my home app on my iPhone just shows "No Response" from both switches I've created.

When you say works fine on your home bridge. Do you mean the scripts execute as expected when you run them local on the raspberry pi?

If that is the case: test you scripts running as the homebridge user. The scripts when executed by homebridge are run as the same user initiates and runs homebridge itself. So you need to test the scripts as that user.

99.9% of the issues from users are due to permissions error or not using the full path to executables in the scripts. See many of the closed issues for examples.

No, forgive me for not being clear. I mean that when I use the Homebridge web-ui to turn the switches on or off, they execute the scripts as expected and update their state. But on my phone, I can't see their states or interact with them at all.
Also, that reply was QUICK, thanks!

Ah ok. I still recommend running the scripts as the homebridge user manually on the device running homebridge.
Config ui - x may perhaps have root access or have some other permissions setting that does not work for regular plugins.

sudo -u [username-of-homebridge-user] scriptname

run that and make sure the script works when running as that user.
If it does then something else is going on. If it doesn’t than that is your issue.

As for speed. I just happened to catch the email.. 😄

Interesting, I assumed the UI would use the homebridge user, my mistake. That does seem to be the issue. Now I just need to figure out how to give permissions. I was "very clever" and put my scripts in the bin folder so I could call them from anywhere.

EDIT:
Alright, permissions assigned, I can now run all of the scripts as the homebridge user. The problem persists, though, the home app shows the switches as "No Response", and I can't flip them from anywhere but the web-ui.

Can you check your environment variables as the homebridge user. Or make sure when you call the executables call them with the full path with the scripts.
I’ve seen that issue crop up before. If that is not it. I’m not really sure... that solved it for almost everyone in the past. It really is just executing those scripts as the homebridge user...

I feel I should mention that my scripts are written in python, not bash. It just occurred to me that all the examples are .sh files. As far as checking the environment variables is concerned, I'll admit to being very over my head looking at this console 😆

Okay, figured it out! There was just a long delay in the state scripts, and the app was timing out before it could update the states of the switches. Closing the issue, and thank you for the help!

Ah. Thanks for documenting the issue.