Newbie, how to add an external component?

Hello,
My HA is now installed and running and I’ve created a Windy Iframe that is working perfectly from my raspberry PI touchscreen. Question, how can I add components ? I’ve been looking at some video but this is more for advanced users. Where can I find a guide starting from the basics ?
Thx
yA

What kind of components? The ones built into HA?

Yes, I’m trying for example to connect to two Hikvision cameras.

if trying to add stream, you’d find the appropriate component from here


and add to your configuration .yaml

Ok I’ve found using a generic entry. What is the idle toggle ?
Now I would like to add a button for an external script stopping the Cisco Switch POE for a specific port. I’ve created the script. I only need to launch it.

you’d use a template switch.


or a shell command

Hello again, I’ve tried the shell command but I get nothing more in the current entities list ?

if you have a command that you type in your terminal and it shuts down your switch. Then the way to fire that command from HA is to put it in a shell_command.

Ok but how to recall it because i can’t see it anywhere ?

you need to add it to your configuration.yaml file.

Already done but this is where I’m blocked. Nothing new in entities.

I have some…

Mine look like

command_is: /bin/bash /config/script.sh

I think your path might be wrong… ~ is the home folder and that isn’t (likely) the location of the script, particularly if you’re using hassio. Have you checked the logs?

Thanks for the tip, I’m Moving on :slight_smile:
Now I get this

2019-05-12 11:31:55 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: /bin/bash /usr/share/hassio/homeassistant/scripts/quota_axel.sh, return code: 127

The scripts folder is for python scripts, not bash scripts I believe. It should show as a shell_command, not a script.

I’ve done a mix with scripts.yaml. Remove.
My HA is running on Ubuntu 18.04 and the script is using expect but I Don’t see shell_command in folder entities.

I’m using debian/docker/hass.io myself…

Try a console in the home assistant container and executing the shell command in exactly the same format as your shell command in config. Does it work there? If not it won’t work in HA either. (Easiest way to run a console in the HA container is by using Portainer)

I’m stupid, the HA is running in docker and of course the path is not the same. Another issue is coming from my script using expect.

Two solutions, find how to install expect in docker or install HA in a dedicated VM.

I screwed around for days working out what commands I could use in the stripped down shell in the home assistant container… yeah it’s bloody limiting.

Or use an ssh session to the host, and run commands there.

You don’t install things in a running docker image. You can build FROM the docker image and add things you need but you don’t install stuff in a docker image.

The problem there is that a shell command doesn’t run from the ssh addon. It only runs with what’s available in the Home Assistant container.