Hi,
I’m using the Garbage Collection integration and its working well for the normal recurring frequencies. Now I’m trying to get it working for the manual frequency where I can load the dates from a text file. I’m following the instructions on the git page to setup the command line sensor like this:
Here’s the import_yard_waste_dates.sh file (copied from git but just updated the file name):
#!/bin/bash
new_dates=$(for x in $(cat /shell/yard_waste_dates.txt); do
if [[ $(date -d $x +"%y%m%d") -ge $(date +"%y%m%d") ]]; then
echo $x
fi
done)
echo "$new_dates" | head -n20
I see the following error in the logs:
ERROR (SyncWorker_0) [homeassistant.components.command_line] Command failed: sh /shell/import_yard_waste_dates.sh
I can’t find much about how to setup a command line sensor with the SH command. How can I figure out why this is failing?
I’m not sure if any of this matters, but I’m running HA OS in a Proxmox VM.
I tried moving the script and txt file to the Config folder and seeing the same issue. Is there some special permissions needed to run these scripts? Thanks.
No I hadn’t tried it. I’m pretty new to this and didn’t know how to debug this further, and this was the command also provided within the Garbage Collection integration. I’ll replace sh with bash and if that doesn’t work, try to find how I can test it independently of the command line sensor.
Thanks for the feedback.