But yeah, the problem with that is that the script returns immediately, so if you want to use the result of the ffmpeg just after, it will likely fail.
Yes but command line sensor polls which is not what I want. But I tried to just duplicate the shell_command as custom_component with a modified timeout and it seems work well, so that is what I going to use instead.
I am trying to replicate what you have commented in your post, but I am not succeeding.
I always get the same timeout error in the log and I can’t get my scripts to run completely.
Logger: homeassistant.components.shell_command
Source: components/shell_command/__init__.py:83
Integration: Shell Command (documentation, issues)
First occurred: 20:20:46 (1 occurrences)
Last logged: 20:20:46
Timed out running command: `bash /config/Shell_Scripts/camara_shell_scripts.sh {{ state_attr("camera.camara", "access_token") }} `, after: 60s
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/subprocess.py", line 198, in communicate
await self.wait()
File "/usr/local/lib/python3.9/asyncio/subprocess.py", line 135, in wait
return await self._transport._wait()
File "/usr/local/lib/python3.9/asyncio/base_subprocess.py", line 235, in _wait
return await waiter
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/tasks.py", line 490, in wait_for
return fut.result()
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/shell_command/__init__.py", line 83, in async_service_handler
stdout_data, stderr_data = await asyncio.wait_for(
File "/usr/local/lib/python3.9/asyncio/tasks.py", line 492, in wait_for
raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
I have copied the folder as you indicate, but I can’t get HA to recognize the new time values for shell_commands
Well the way I did it, instead of trying to override shell_command and not being sure which version is used, which I think is what is happening here, I just duplicated the shell_command as x_shell_command.
So I copy all the files from the source shell_command like you did to this folder:
FWIW, I created a full replacement for the command-line sensor/service.
Besides allowing to set the timeout, it also allows to disable polling altogether, so relying on homeassistant.update_entity and eases a bit the hassle of using SSH to run the command on the host rather than inside the HA docker container.
By any chance you don’t know how to send a CURL command from the Shell?
It is the only thing I need to implement in the script I have, that by CURL change the status of an input boolean to know that the script is completed and the automation goes to the next step.
Best.
P.D. Nothing, I’ve got it too, I’m going to implement it in the script and see if it all works.