Noob Hass.io on Raspberry Pi Advice on Offer (local scripts)

I have sacrificed many hours trying to make things work in HA, my advice may pertain to more the the Pi, but it is all I know. I’ve even paid someone to help me, because I couldn’t make the most basic things work. Switches with local commands, automations with shell commands, sensors with commands, etc. It may be self evident to most, but if you have a number of bash or python scripts you want to execute with the above, there are VERY strict rules to have them work. Even when it comes to temporary files (forget /tmp or /var/tmp).

The environment that HA runs and executes in is very limited. Your scripts can’t use temp files outside the HAhome directory, your scripts can’t execute basic things like the ‘touch’ command for example and many others that are in every users default path, even if you use the full path, it doesn’t matter. Also those scripts need to live in HAhome as well.

Luckily the curl exe is available to HA. So I suggest you install a lightweight webserver like lighttpd (yes, not as secure, I don’t care) and create a python executable that acts as your proxy execution mechanism that will then have access to the bounty of system commands in the OS and your custom scripts. For commands that run a long time, I created a perl listening daemon that the aformentioned python script can hand its execution duties in order to release the curl command.

There are many very savvy people that use this tool, but the time I spent down primrose paths of threads that went nowhere seemed like days. I started with rolling my own UI but I needed the Wyze integration for my home alarm system and that brought me to HA. I appreciate all the work that has gone into perfecting HA and making it the tool kit it is today. Thank you.

What’s the purpose of this post?

It would be helpful to post your actual issue, the code you got that is not working, the errors you get, the goal you want to achieve etc.

I am not sure why the purpose is not clear to you. I spent many hours trying to figure out why basic commands don’t work, not coming across any post that says, in this Pi docker environment you can’t just execute anything available in the OS. As I said, that might be self-evident to many, however if you object to this post, flag it for removal. I don’t give 2 shytes.