General thoughts on (getting started with) HA (hassbian)

Thanks, stevemann. Others have recommended I switch to hass.io but the reason I went with hassbian is that I couldn’t get hass.io to install. I tried several times. It kept giving me a message (don’t remember what it was) then restarting. Endless loop.

I used the image file for an SD card. Nothing to install.

Yep, same here. It resulted in the endless loop I mentioned. I thought maybe there was a problem with the disk image so I redownloaded, reimaged, and tried again. Same result. So I went with hassbian.

I like hassbian because I have more control. It’s like the difference between an Iphone and the way Android used to be before they locked it down too. You can tinker more with hassbian. hassio is more plug & play to a degree.

Here are the instructions I used to install mosquiito in hasssbian (from my instruction cheat sheet):

        $ sudo apt-get install mosquitto 
        $ sudo apt-get install mosquitto-clients 

        Edit the config file:

        $ sudo nano /etc/mosquitto/mosquitto.conf 

        Add the following:

        allow_anonymous false
        password_file /etc/mosquitto/pwfile
        listener 1883 

        comment out the existing line:

        # include_dir /etc/mosquitto/conf.d

        - save

        Create a username:

        $ sudo mosquitto_passwd -c /etc/mosquitto/pwfile <username>

        It will then ask for a password 


        there are two ways to test that it's working...:

        the first is using the RPi itself- 

        Open two instances of putty logged in to the hassbian Pi
        
        In one instance put in the following:

        $ mosquitto_sub -d -u <username> -P <password> -t "dev/test" 

        This will subscribe to the topic “dev/test” and listen until you stop it witch ctrl-c

        In the other put in:

        mosquitto_pub -d -u <username> -P <password> -t "dev/test" -m "Hello world"

        this will publish the words “hello worldf to the topic “dev/test”

        you should see those words appear in the listener

        you can test it in HA frontend by opening the services area, select mqtt, select publish then fill in the desired phrase:

        {
          “topic”: “dev/test”,
          “payload”: “hello world”
        }

        Then click call service

        You see those words pop up again in the listener

        To access the MQTT server from outside your network set up your router to open port 1883
        
        Or you can download and install MQTTFx on a windows machine - 

        Open MQTTFx, connect to the broker at the IP of your Pi, subscribe to all topics (#), publish to any topic from either HA service or by publishing in MQTTFx. 

        if you subscribe to all topics in the listener on your Pi, you will see the published output there too.

if there is any other questions I might be able to answer let me know. I’ll do my best…

pi@home-assistant:~ $ mosquitto_sub -d -u NotActualUser -P NotMyActualPassword -t “dev/test”
Client mosqsub|11666-home-assi sending CONNECT
Client mosqsub|11666-home-assi received CONNACK (5)
Connection Refused: not authorised.
Client mosqsub|11666-home-assi sending DISCONNECT

I definitely have the right password. No caps lock issue, etc.

I just tried the same subscribe command (copy & paste from above) putting my credentials and it worked for me.

The only thing I can think of is that it’s a username or password issue.

I guess as a quick double check that the service is running OK:

$ systemctl status mosquitto.service

I got it working, finity! It turns out that I had already setup mosquitto (although not completely). When I got to the step of setting the username and password, it didn’t overwrite what I had created the first time. Fortunatrely, I stumbled upon a not in Lastpass where I had documented the mosquitto login credentials I initially used. When I went back and tried mosquitto_sub -d … it worked! Thanks so much for your help!

I guess I spoke too soon. The subscribe worked, but when I publish “Hello World” in a second window, it doesn’t show up in the sub window. All I get is:
Client mosqsub|18467-home-assi sending PINGREQ
Client mosqsub|18467-home-assi received PINGRESP
Client mosqsub|18467-home-assi sending PINGREQ
Client mosqsub|18467-home-assi received PINGRESP
Client mosqsub|18467-home-assi sending PINGREQ
Client mosqsub|18467-home-assi received PINGRESP
Client mosqsub|18467-home-assi sending PINGREQ
Client mosqsub|18467-home-assi received PINGRESP
Client mosqsub|18467-home-assi sending PINGREQ
Client mosqsub|18467-home-assi received PINGRESP
Client mosqsub|18467-home-assi sending PINGREQ
Client mosqsub|18467-home-assi received PINGRESP

And once again, even the simplest damn thing JUST. DOESN’T. WORK.

Since I have multipl Raspberry Pis sitting around, I think it’s time to try OpenHAB on one of them. SO frustrated.

According to the documentation on the WiFi Hub, it doesn’t do presence detection with that component?

I think you misunderstood (although the way I wrote that, I can see how you would). I wouldn’t expect it to since I don’t take my OnHub router with me everywhere I go. All I was saying is that I’d really like to get presence detection working so I thought I’d start by trying to get ANYTHING working. Since most of my devices aren’t listed under “Available Components” (lucky me), I started with (what I assumed would be a very simple) one that was.

Only NOTHING is simple in HA. (Or at least that’s how it seems to me.)

I don’t know about that.

Most of the components just require a single line added, at most 3. A restart and it’s running.

I don’t know why you’re having so many issues, but your frustrations are definitely noted, as you’ve made it abundantly clear.

I think I mentioned somewhere else that the check config doesn’t always catch errors.

If your sytem becomes unresponsive after a change look at the home-assistant.log file in your configuration directory. most of the time it will tell you what the error is. most of the time (…most…) it’s actually human readable to a degree and a lot of times if it’s a syntax issue it will tell you what line the problem can be found on.

as far as MQTT:

What did you see when you ran the publish command in the sending session?

EDIT:

Have you looked at the cookbook examples I mentioned?

They will give you an idea about how the yaml syntax is supposed to go.

FYI after installing hass.io it goes through a ~20 minute period of updating and setting up. You can’t hook up a monitor and expect to see an interface like linux, it is only accessible accross your network via the IP & Port. It’s super easy, you just need to be patient during the 20 minute period where it sets up.

And as a note: that amount of time depends on your internet connection speed. With my crappy internet, a docker image download can take upwards of an hour.

1 Like

Just those PINGREQ / PINGRESP lines I posted above.

Yeah, I saw that in the docs. I gave it a couple hours. And when it didn’t boot up, I unplugged it and tried again with a monitor attached. That’s how I saw the message endless loop/restart.

what do you mean it didn’t boot up? Where did you see this message? There is no interface to view it unless you have a monitor attached. And at that point it just shows a home assistant icon and nothing else.

I mean the web interface didn’t become available. When I tried to navigate to the appropriate URL to see the web interface, it wasn’t there. (“This site can’t be reached. [IP] refused to connect.”)
After waiting a long time, I unplugged it and moved it to a spot where I could attach a monitor - which is when I saw the error message/reboot loop

IIRC, it didn’t even get to that point.