I want to run a bash script that deletes email from gmail.
# Clear Out Gmail Alarm Notifications
shell_command:
test_shell: /config/delete-gmail-email.sh
But it won’t run.
The delete-gmail-email.sh script runs fine from the ssh addon (I set the addon to install the expects package)
What I really want to do is have a lovelace entity button that can execute this script at will…
The shell command just immediately spews an error when I try and call the service:
Wed Feb 20 2019 16:16:07 GMT+1100 (Australian Eastern Daylight Time)
Error handling message: {'type': 'call_service', 'domain': 'shell_command', 'service': 'test_shell', 'service_data': {}, 'id': 16}
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/decorators.py", line 17, in _handle_async_response
await func(hass, connection, msg)
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 147, in handle_call_service
connection.context(msg))
File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1130, in async_call
self._execute_service(handler, service_call))
File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1152, in _execute_service
await handler.func(service_call)
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/shell_command/__init__.py", line 89, in async_service_handler
cmd, process.returncode)
File "/usr/local/lib/python3.7/logging/__init__.py", line 1418, in exception
self.error(msg, *args, exc_info=exc_info, **kwargs)
File "/usr/local/lib/python3.7/logging/__init__.py", line 1412, in error
self._log(ERROR, msg, args, **kwargs)
File "/usr/local/lib/python3.7/logging/__init__.py", line 1519, in _log
self.handle(record)
File "/usr/local/lib/python3.7/logging/__init__.py", line 1529, in handle
self.callHandlers(record)
File "/usr/local/lib/python3.7/logging/__init__.py", line 1591, in callHandlers
hdlr.handle(record)
File "/usr/local/lib/python3.7/logging/__init__.py", line 905, in handle
self.emit(record)
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/system_log/__init__.py", line 168, in emit
_figure_out_source(record, stack, self.hass))
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/system_log/__init__.py", line 99, in __init__
self.root_cause = str(traceback.extract_tb(tb)[-1])
IndexError: list index out of range