Platform : OS/X running a Virtual Machine, Linux Ubuntu, * 2023.12.3
Supervisor2023.11.6
My bash script runs fine in terminal - basically, it runs FFMpeg to grab a still image from each of 6 RTSP cameras, and dumps them into media/cameras. I can see the images fine after capture. It waits 5 minutes, and then grabs new images, overwriting.
I have tried various methods to make this run automatically. I first set it up in crontab, but it is not running.
Then I tried to set it up as a service in configuration.yaml, via methods Iâve read about online â 'shell.command" and command_line." I donât get an error on the config.
But when I try to add an automation, zero luck with anything. I donât actually seem to have any entity define to call up for the action when trying to configure an automation.
Any thoughts on what I am doing wrong?
I have screenshots but canât seem to post them,.
Which terminal? Are you sshâd into Linux Ubuntu or to the terminal add-on within Home Assistant? If it is Linux Ubuntu and you are running HA in a docker container then HA does not have direct access to run scripts outside of the docker container. You would need to run ssh in HA to execute commands on the host OS (Ubuntu). For example:
- id: 'my_host_script_id'
alias: Run my_host_script on host every 5 minutes
trigger:
- platform: time_pattern
minutes: '/5'
seconds: 0
action:
- service: shell_command.my_host_script
PS:
No problem, just click on the âUploadâ button in the editor to upload a .jpg for example. Do not use this for code but use the âPreformatted textâ button instead to post code.
I should mention the script is within HA. I do have a version that can run on OS/X, sending it over to same-machine-HA via SMB, ssh or sftp but that just seemed like an extra step.
Could be an indentation issue. Yaml is very picky about how the code is formatted. Looks like âactionâ is not correctly indented. Can you please post your code using âpreformatted textâ.
Are the 2 HAâs on the same network? It shouldnât be a problem as far as I know but Iâm not sure. What happens if those scripts run in parallel? Could this be an issue?
I have to give up here. No more ideas. Iâd recommend that you post a new question and ask why a shell_command could behave differenty on two identical HA instances.