[Solved] Can't install custom component

I am trying to install this:
https://github.com/sean6541/tuya-homeassistant

so I put the file tuya.py into:
/home/homeassistant/.homeassistant/custom_components/switch

and in my configurator.yaml:

  - platform: tuya
    host: 192.168.188.74
    local_key: 123456
    device_id: 123456
    switches:
      switch1:
        friendly_name: presa 1
        id: 1

but I get:

2018-05-07 23:19:27 ERROR (MainThread) [homeassistant.components] Platform not found: switch.tuya
2018-05-07 23:20:22 ERROR (Thread-12) [homeassistant.loader] Unable to find component switch.tuya

I am really lost! :sweat:

Just make sure tuya.py has the right owner/permissions. If you are using virtualenv, the file should be owned by homeassistant

1 Like

thank @arsaboo I think it’s correct:

pi@raspberrypi:/home/homeassistant/.homeassistant/custom_components/switch $ ls -la
total 16
drwxr-xr-x 2 homeassistant homeassistant 4096 May 7 23:20 .
drwxr-xr-x 3 homeassistant homeassistant 4096 May 7 23:15 …
-rwxr-xr-x 1 homeassistant homeassistant 4129 May 7 23:18 tuya.py

Check the ownership and permissions of the custom_components and switch directories as well.

Never mind. That’s what . and … are! LOL! And they look ok, too.

FWIW, and I don’t think this should matter, but all my *.py files under custom_components (and its subfolders) do not have execute privilege. They’re all '-rw-r--r--'.

My bad!
I needed to restart the service from the command line instead to use the restart from the web console! :grinning:

1 Like

What do you mean with web console? The homeassistant web interface? The SSH plugin you can access via the web interface?

And the command line is connecting your keyboard directly to the raspberry pi and typing the restart command in there?