Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homebridge-Garage-Door-Switch #3

Closed
PeterGurneyuk opened this issue Mar 17, 2021 · 7 comments · Fixed by #4
Closed

Homebridge-Garage-Door-Switch #3

PeterGurneyuk opened this issue Mar 17, 2021 · 7 comments · Fixed by #4

Comments

@PeterGurneyuk
Copy link

I am running Homebridge in docker on a QNAP. Homebridge-Garage-Door-Switch has been installed with Homebridge-Http-Switch to mimic the door status.
Every part of the system works fine except I can not call the open or closed scripts.
The scripts work as a stand-alone and power the door, but I can not trigger them from the plugin.
{
"accessory": "EzzGarageDoorSwitch",
"name": "Garage Door",
"open": "open_command.sh && echo OPENING",
"close": "close_command.sh && echo CLOSING",
"state": "bash get_garage_status.sh",
"pollStateTime": 15,
"debug": true,
"httpPort": 8965
}
I am guessing I can not find the right path and/or do I need to prefix with "sh" ?
Currently they are in the homebridge directory with config.json etc.
They do run from the terminal or via putty, just not from within EzzGarageDoorSwitch.
What am I doing wrong ?

@ezzizzle
Copy link
Owner

A couple of things to check/try.

  • Are you seeing anything in the Homebridge logs when you try to open and close the door? The log message should be prefixed with ERROR Opening Door
  • Try putting the full path to the open and close scripts and see if that helps
  • If the scripts are executable you shouldn't need to prefix with sh

I have noticed there could be an issue with newer versions of Homebridge where the command isn't being executed. I'm testing a fix now and will push out a new version shortly.

@PeterGurneyuk
Copy link
Author

PeterGurneyuk commented Mar 17, 2021 via email

@ezzizzle
Copy link
Owner

I just made an update to a new version that will hopefully resolve the issue. Do you want to give this a try and see if it fixes your issue?

@PeterGurneyuk
Copy link
Author

button2

Still no success, tried various versions of path and file name (open_command.sh contains "echo batch file ran")

A snip of the log file:-
[3/18/2021, 4:08:14 PM] [Garage Door] Transitioning to 1
[3/18/2021, 4:08:14 PM] [Garage Door] ERROR Closing Door: Error: Command failed: ./close_command.sh && echo CLOSING
/bin/sh: ./close_command.sh: not found

[3/18/2021, 4:08:18 PM] [Garage Door] Transitioning to 1
[3/18/2021, 4:08:18 PM] [Garage Door] ERROR Closing Door: Error: Command failed: ./close_command.sh && echo CLOSING
/bin/sh: ./close_command.sh: not found

[3/18/2021, 4:08:21 PM] [Garage Door] currentReportedState: 0 CurrentTargetState: 0 actualState: 1
[3/18/2021, 4:08:21 PM] [Garage Door] Transitioning to 1
[3/18/2021, 4:08:21 PM] [Garage Door] No context set, ignoring command
[3/18/2021, 4:08:25 PM] [Garage Door] Transitioning to 0
[3/18/2021, 4:08:25 PM] [Garage Door] ERROR Opening Door: Error: Command failed: ./open_command.sh && echo OPENING
/bin/sh: ./open_command.sh: not found

Using Homebridge Terminal:
/homebridge # ./open_command.sh
batch file ran
/homebridge #

Using Putty:
[/share/Container/homebridge] # open_command.sh
-sh: open_command.sh: command not found

[/share/Container/homebridge] # ./open_command.sh
batch file ran
[/share/Container/homebridge] #

Permissions:
-rwxrwxrwx 1 abc users 197 Mar 18 16:07 open_command.sh

@ezzizzle
Copy link
Owner

Ok so that error message you're getting now is definitely about file paths. It looks like the full path to your command within the container would be /homebridge/open_command.sh. Putting that in your confit definitely doesn't work?

@PeterGurneyuk
Copy link
Author

I have recreated the two batch files, I was concerned that they may have been contaminated by notepad++ (windows).
With the /homebridge/open_command.sh location. the system is now working.
Thank you for your prompt support, I am truly grateful.

@ezzizzle
Copy link
Owner

All good, glad it's working for you and someone's using the plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants