i´ve done this:
Add to configuration.yaml: python_script:
Create folder /python_scripts
Create a file hello_world.py in the folder and give it this content…
And get this
ERROR (MainThread) [homeassistant.loader] Unable to find component python_script
17-06-27 22:59:38 ERROR (MainThread) [homeassistant.setup] Setup failed for python_script: Component not found.
# Set up python scripts entered by jp
python_script:
and my directory structure…not sure about ownership, I log in as “pi”, I have changed the python_scripts ownership to pi and homeassistant, no difference
-rwxrwxr-- 1 pi pi 125 Jun 1 09:16 hello_world.py
pi@hassbian:/home/homeassistant/conf/python_scripts $ ls -l /home/homeassistant/conf
total 184
-rw-r--r-- 1 pi pi 105667 Jun 1 09:49 access.log
-rw-r--r-- 1 pi root 47682 Jun 1 10:32 appdaemon.log
-rwxr-xr-x 1 pi pi 930 May 27 21:40 appdaemon.yaml
-rw-r--r-- 1 root root 380 May 8 13:55 appdaemon.yaml.save
drwxr-xr-x 2 pi pi 4096 Jun 1 09:29 apps
drwxr-xr-x 5 pi pi 4096 May 8 16:25 compiled
drwxr-xr-x 2 root root 4096 May 29 12:29 dashboards
-rw-r--r-- 1 pi pi 0 May 24 17:18 error.log
drwxr-xr-x 2 homeassistant homeassistant 4096 Jun 1 09:16 python_scripts
HA Version
Error message
2018-06-01 10:32:00 WARNING (Thread-15) [homeassistant.components.python_script] Folder python_scripts not found in configuration folder
2018-06-01 10:32:00 ERROR (MainThread) [homeassistant.setup] Setup failed for python_script: Component failed to initialize.
What is your HA configuration folder? Should be shown directly under that version information.
As you can see, in my case it’s /home/homeassistant/.homeassistant. If it’s the same for you, then you need to put it at /home/homeassistant/.homeassistant/python_scripts. E.g.:
pi@raspberrypi:~ $ ls -ld /home/homeassistant/.homeassistant/python_scripts/
drwxr-xr-x 2 homeassistant homeassistant 4096 May 17 13:59 /home/homeassistant/.homeassistant/python_scripts/
That did it for me…what is confusing is the instructions that say “Create folder /python_scripts” and I put it under the “conf” folder in the “homeassistant” directory. pi@hassbian:/home/homeassistant/conf/python_scripts
Thanks much!!
I think you tried to say it says "Create folder <config>/python_scripts". But, yes, when I first started, I saw <config> mentioned in several places without defining what that meant. I eventually did find it stated more explicitly somewhere, but it took a while and that was a bit frustrating.
FWIW, my installation doesn’t have a conf folder:
pi@raspberrypi:~ $ ls -la /home/homeassistant/
total 52
drwxr-xr-x 5 homeassistant homeassistant 4096 Apr 9 08:44 .
drwxr-xr-x 4 root root 4096 Mar 15 21:15 ..
-rw------- 1 homeassistant homeassistant 6342 May 21 12:37 .bash_history
-rw-r--r-- 1 homeassistant homeassistant 220 May 15 2017 .bash_logout
-rw-r--r-- 1 homeassistant homeassistant 3523 Mar 13 16:55 .bashrc
drwx------ 3 homeassistant homeassistant 4096 Mar 15 21:22 .cache
drwxr-xr-x 11 homeassistant homeassistant 4096 Jun 1 13:27 .homeassistant
drwxr-xr-x 2 homeassistant homeassistant 4096 Mar 15 22:25 .nano
-rw-r--r-- 1 homeassistant homeassistant 675 May 15 2017 .profile
-rw------- 1 homeassistant homeassistant 332 Mar 29 16:01 .python_history
-rw------- 1 homeassistant homeassistant 1024 Mar 18 22:22 .rnd
-rw-r--r-- 1 homeassistant homeassistant 66 Mar 18 22:52 .selected_editor
But then I don’t use Hass.io, appdaemon or hadashboard.
PS, the more I think about this, I believe there are two sets of “users”, one is the casual user that just wants to use the components available without customization. These users have access to the /home/homeassistant/ directory where they have the /conf/, /apps/, /compiled/ and /dashboard/ directories and they do not know about the ./homeassistant/ because it is “hidden” and available to more knowledgeable linux users and developers. Anyway, this is all a bit confusing and I am sure it causes a lot of grief for noobs like me.