Basic Information Required

Apologies for this fundamental question but I am struggling to develop my knowledge of HA. I am a newbie with HA and Raspberry Pi and IT in general but in lockdown trying to get my head around all the complexities has made time fly by. I have HA running on a RPi 4 with 64Gb micro SSD. I have some smart lights, motion detectors and a couple of IP cameras all working fine but whenever I want to do something a little more clever I keep coming up against the very limited commands available in terminal. I cannot install anything at the command line I just get the message ‘bash command not found’. If I look at Supervisor/system I have three modules Core, Supervisor and Host but I don’t understand the relevance. Do I have a bad install, partial install or am I missing something fundamental ?

You are missing something fundamental.

Home Assistant OS is a locked down minimal OS intended to be an “appliance like” system. Easy to maintain, not very configurable.

One of the advanced installation methods may be more suited to your needs.

1 Like

Better would be to know what you are actually trying to do thru the command line?

I have had my HA system running on a NUC over Debian for three years and (almost) never need to interact with anything related to HA via the terminal.

1 Like

Basically trying to install other progs such as Python. I find commands such as sudo and apt-get but none of them work in HA. I haven’t found anywhere that explains to an absolute beginner such as me what the different install options are. To me Docker and container are more to do with unloading ships than HA. I bought two Pis to play with and after getting my head around ssh I wanted to use command_line to get the temp of the second pi and display it on Lovelace. I can see the result in terminal on HA but cannot get it to report in Lovelace. I thought that might be simple enough but after hours of trying I’m still no further forward. HA is hard to understand as a rank beginner.

Check out the command line sensor:

Once you create that sensor it will be available to do anything you want that can be done with any other entity including view it in lovelace.

And as far as I understand things Python has to be already installed.

HA runs in Python.

If HA runs in Python then it suggests that Python must be installed. If I type > Python --version I get > bash : python: command not found.

I have been using command line sensor or attempting to. I can get a response in terminal to the input: > ssh [email protected] /opt/vc/bin/vcgencmd measure_temp which gives me the temp in C.

if I try putting that in config.yaml as:
platform: command_line
name: GPU Temperature
command: “ssh [email protected] ‘/opt/vc/bin/vcgencmd measure_temp’”
unit_of_measurement: “C”
value_template: ‘{{ value | multiply(0.001) | round(1) }}’

I get an error in the log file: * Command failed: ssh [email protected] ‘/opt/vc/bin/vcgencmd measure_temp’

I have tried with/without quotes etc but get nowhere.

I appreciate any input mate.

Sorry Tom I missed you reply, thanks for that. Do you mean I should have installed HA after installation of an operating system and python etc ? I just followed the initial instructions for installing on a raspberry pi.

The HA Getting Started guides are geared directly at the absolute beginner, who doesn’t (yet) have the knowledge to worry about more advanced install options, OS implementations or commands.

I guess what I’m trying to say is that you shouldn’t need to learn how to install anything at the OS level, or even use SSH, beyond what’s available and in the documentation. As with your example of getting CPU temperature, above, you’ll see that there are native HA ways to do almost anything a typical user would need. You just need to ask specific questions and you’ll find the folks here very helpful.

In summary, stop looking at documentation for other systems, and stick with what’s available out of the box with HA, first. If you want to move on to the role of Senior Operating Systems Programmer (one of my favorite past job titles) there are paths to that with HA. But learn to walk before you try to run.

This used to work when I was using a pi3:

- platform: command_line
  name: GPU Temperature
  command: "/opt/vc/bin/vcgencmd measure_temp"
  unit_of_measurement: "°C"
  value_template: '{{ value | multiply(0.001) | round(1) }}'

It was never any different than the CPU temperature though as it was connected to the same heatsink.

For maximum flexibility (and also breakability!), I recommend Home Assistant Core which you set up manually in a Python virtualenv. You are then free to do whatever else you want with the system, but you have to be comfortable administering a Linux system already.

I ran this for a couple of years on a Banana Pi M1 very successfully, with lots of other things running independently on the same machine.

I’m now running HA in a Docker container on my Synology NAS, which is also pretty configurable. I have things like Mosquitto running as separate containers; and I can SSH into the HA config filesystem and make changes as needed there.

Sorry, I forgot that HA does run in python but it must only be running inside the docker container itself that runs HA.

So the answer to your question is that, yes, you should have installed HA in a different way than flashing HAOS onto an SD card.

Your best bet to get what you want (full control over the OS and HA with add-ons) is to install the HA Supervised version.

I can’t find any official install guides for that method (maybe there isn’t any…?) but there are a couple from the “community guides” section depending on how you want to install it.

Here’s one: