MQTT Alarm Control Panel for Raspberry Pi and Android

I bought this USB powered speaker from Amazon, but I think there are probably better options. It works but I had to be sure my power adapter was a higher voltage for the RPi (used an old iphone adapter, the larger one). Here https://www.amazon.com/AYL-Guarantee-Rechargeable-Expandable-Smartphones/dp/B007OYAVLI/ref=sr_1_fkmr1_1?ie=UTF8&qid=1528320790&sr=8-1-fkmr1&keywords=usb+powered+speakers+ayl

Seems all I needed to do was add a username / password to my MQTT broker and get that setup, worked fine when I tried it with cloudmqtt which lead me to testing it with credentials.

Odd because your mqtt broker setup in HASS didn’t have a username or password set. I don’t have one set on my HASS mqtt broker nor do I use a username or password in the mqtt settings of the alarm application. Never had issues.

This Control Panel is AMAZING. Have not had any issues so far with it (at least nothing that this thread hasn’t solved yet). You did an outstanding job!!

Any news on the new Day/night theme and the screen dimming issue updates?

For the Pi I am testing the features now and working out bugs. Hopefully this week I will release an update for the Pi.

1 Like

Awesome news on the new features. I would like to also say this has been an awesome addition to my system and makes using the alarm easy for my family.

Side note for anyone installing this setup into the 7" touchscreen case you cannot rotate the screen with Android things, you will need to first mount the sd card into your pc and add the following line to

/boot/config.txt

lcd_rotate=2

I have used this case to wall mount my panel but couldn’t fit it the wall cavity unless the screen was orientated upside down.

I would also like to request a feature add for ‘panic mode’ an additional or secondary code that can be set in the settings menu say underneath where we set our main code. This panic code will be able to disarm the system but it sends a different mqtt topic and if subscribed to this topic we can set automations around disarming the system as normal but silently notifying police or neighbors etc.

There is already a feature request on GitHub for a silent / panic mode. Take a look there and add to the request if needed. The next Android Things version does have the ability to rotate the screen portrait or horizontal using the application settings. I tested it on the 7” RPi Touchscreen. But thanks for the suggestion.

1 Like

I release v1.4.9 for Android Things today. Unfortunately OTA (over the air) updates will not be available for previous versions since this version now uses the v1.0.1 Android Things official release and previous versions used Android Things development. You will need to burn a new copy of the application to your SD card. Here is a list of updates:

Updated to Android Things v1.0.1
Support for portrait mode
Support for night mode based on start/end times
Updated screen dimming due to changes in Android Things v1.0.1
Added screen support for 240 dpi devices (RPi 7" Screen) due to changes with Android Things v1.0.1

1 Like

Thanks for the update! The screen dimming issue appears to be fixed for me now so that’s nice :slight_smile: I am getting intermittent errors about not being able to reach the (cloud)MQTT broker. Most of the time the message just flashes and is immediately gone. Other times, it doesn’t go away and the panel fails to update the alarm state anymore. Only way to fix it is to powercycle the panel and then it’ll work again for a while.

Has anything changed in regards to the connection of the MQTT broker? I’m using an SSL connected MQTT broker at cloudmqtt.com.

I have not changed the mqtt part of the application. But for SSL wouldn’t you need to load the certificate in order to connect unless your just using password and username.

You shouldn’t need to power cycle the device to reset the mqtt connection. It resent anytime you go to the settings and return, Since it’s intermittent it sounds a lot like connection issues between the cloud mqtt and the application. I run mine behind the firewall connected to HASS and mqtt in the local network. I have no connection issues with the latest version.

OK, I am seeing some connection error now that is intermittent. I will track it down and issue a new update shortly.

I pushed out a new build but there is no guarantee this will resolve your issues. Besides for a temporary HASS outage, I couldn’t reproduce your issue. I did see one problem with the code I was injecting into the MQTT service that may cause issues, but again, I couldn’t reproduce any for certain. Give the update a try and see if it helps. This should be an OTA update.

I’ll update and see if that fixes my issue. I’ll also look into running a local MQTT broker. Might make things easier anyway.

The good news is that the OTA update process worked. The bad news is that it didn’t resolve the issue. I’ve swapped out the cloudmqtt for a locally installed mosquitto broker and right now I’m not getting any errors. I’ll see if it stays that way for the next 24 hours.

There is no way for the RPi to load a security certificate (not easily). So if you are using SSL with cloudmqtt that requires a cert, its not going to work. It should work with username/password but then again you may be having issues with clientId or something odd. I just couldn’t say.

SSL-encrypted connection to cloudmqtt from the alarmpanel (and from Hass) works as expected. It’s username/password-based but it serves its purpose of not sending MQTT messages unencrypted over the internet. Right now, the local mosquitto broker is running unencrypted since its not exposed to the internet so I see no need to generate SSL certificates for it.

Alas… even with the local, unencrypted mosquitto MQTT broker I’m getting intermittent errors and failures to update the alarm status over MQTT. I think I’ll downgrade for now. Is there any type of debugging logs to help assess where this is coming from?

So it seems to work for a while, then it starts failing intermittently? That’s really odd but I don’t think you can do much to diagnose the issue. You could install Android Studio and then use the ADB tool to connect to the device and see the logs. I still need to reproduce the issue, so what I will do is download the production version from Github and then install on a fresh SD card and see if I can reproduce it. It could be something with Android Things or WiFi connectivity. I want to rule out its the application.