Hi,
Im having problem with setting up the binary ping sensor, get this error when loading it:
2017-05-10 14:29:01 INFO (MainThread) [homeassistant.loader] Loaded binary_sensor.ping from homeassistant.components.binary_sensor.ping
2017-05-10 14:29:01 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.ping
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/binary_sensor/ping.py", line 93, in update
self.ping.update()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/binary_sensor/ping.py", line 142, in update
self.data = self.ping()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/binary_sensor/ping.py", line 117, in ping
self._ping_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
FileNotFoundError: [Errno 2] No such file or directory: 'ping'
status = sp.call(ping_cmd, stdout=sp.DEVNULL)
FileNotFoundError: [Errno 2] No such file or directory: 'ping'
I am recently seeing lots of Tracebacks in my logs related to FileNotFoundError: [Errno 2] No such file or directory: 'ping' as well.
I’m running home-assistant 0.63.2 on a Mac Mini. Ping is on my machine. Its parent directory is in my PATH. I seem to be running hass as the same user that has access to the binary.
I am experiencing exactly this issue. Running on a Mac Mini and /sbin is also in my $PATH and I am running hass as this very user. Very strange indeed. Did you find a work-around for this? Thanks!
Edit the ~/Library/LaunchAgents/org.homeassistant.plist file to include any missing paths (/sbin, /bin for examples) and then load the modified plist file:
I’ve been digging into this problem too.
What I can tell you is that the macos install script copies the plist from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/scripts/macos/launchd.plist into the launchd system.
The plist includes $PATH in its path statement, and it looks like it assumes that the users path will get included in the process path. My testing shows that this is not the case. Thus, the only items in the home assistant path are those items that are hard-coded into the plist.
You can resolve this, just as rynam0 has identified by modifying the plist. The only problem with this approach is that every time home assistant gets upgraded, or if you re-run the macOS install script, you’ll have to do it again.
I resolved this by replacing the launchctl plist in my update script with a copy that has /sbin in the path.