MQTT Alarm Control Panel for Raspberry Pi and Android

Hi, @thanksmister. Do you want a translation to Portuguese (pt-pt)?

Absolutely. I need the Google Play store listing and the strings.xml file from GitHub translated if you would. Thanks so much. https://github.com/thanksmister/android-mqtt-alarm-panel/blob/master/app/src/main/res/values/strings.xml

I’m already translating the strings.xml file. Do you have the Play Store listing on a file?

No, but I can provide the text if you send me an email to [email protected]. Otherwise grab the text from the store listing https://play.google.com/store/apps/details?id=com.thanksmister.iot.mqtt.alarmpanel

MQTT Alarm Control Panel


A MQTT Alarm Control Panel for Home Assistant and home automation platforms.


<b>MQTT Alarm Control Panel</b>

MQTT Alarm Control Panel is an alarm control panel for use with home automation platforms that support MQTT messaging.  The application was originally built for <b>Home Assistant's<b><a href="https://home-assistant.io/components/alarm_control_panel.manual_mqtt/">MQTT Manual Control Panel</a></b>. However, the application can be used with any home automation platform that supports the MQTT messaging protocol.

The alarm control panel acts as an interface for your home alarm system and allows for two way communication using MQTT.  You can set the alarm state to away or home, or disarm the alarm using a code.  Your home automation system controls the sensors or automation that triggers the siren or notifies users of possible intrusion. 

The alarm control panel has some other nice features such as a weather forecast, a screensaver mode, capture and send images on alarm deactivation, and the ability to load home automation web page.  The alarm panel is open source and available on GitHub, there is also a version that runs on a Raspberry Pi. 

The alarm panel is designed to be used as a dedicated device which runs continuously in full-screen mode.  Therefore, it operates in the landscape position for the best user experience. 

For the complete setup instructions and additional information,  please visit the <a href="https://thanksmister.com/android-mqtt-alarm-panel/">Project Home Page</a>. 

<a href="https://home-assistant.io">Home Assistant</a>
<a href="https://home-assistant.io/components/alarm_control_panel.manual_mqtt/">Home Assistant's MQTT Manual Alarm Control Panel</a>
<a href="https://thanksmister.com/android-mqtt-alarm-panel/">Project's Home Page</a>
<a href="https://github.com/thanksmister/androidthings-mqtt-alarm-panel">Raspberry Pi Version</a>
Support: [email protected]
1 Like

I’ve installed the 1.4.5.1 beta and I noticed two things:
when enabling the camera, the fields to mailgun data become available but the telegram fields stay greyed out. After swiping back and forth and entering some other data, you can suddently enter telegram data.

Upon entering the timezone location, the screen blanks out entirely and stays white. Rebooting the device doesn’t help. I had to rewrite the disk image to the SD card and try again. I had this happen on both my alarm panels. It was an upgrade from 1.4.1 to 1.4.5 and 1.4.3 to 1.4.5. Things seem ok now though.

Is there any way to verify and/or force an OTA check and update? Via ADB perhaps?

As far as I know there is no way to force an OTA. There is a new version with some fixes and updates. v1.4.6.1… you can try restarting the device to get the update. Check the last page of the settings to see current version. I will take a look at the camera settings page.

this is very cool. i’m having an issue with the android app though.

if i open the app, clicking to arm the alarm works fine. i get the pending time countdown, home assistant updates to ‘pending’ and then to 'armed…" as expected.

if i click again and enter my code to disarm, the alarm gets disarmed correctly in home assistant, but the UI in the app never changes to “disarmed.” it stays as “arm away/home” or keeps showing the countdown if i clicked during the pending state.

in other words, it doesn’t seem like the app is responding to any mqtt topics.

does that make sense, and do you have any idea what might be wrong?

everything seems to look fine with mosquitto_sub on my broker.

thanks!

EDIT:

got it working! it appears the mqtt topics have to be “home/alarm/set” and “home/alarm.” is that correct? i had mine as “homeassistant/alarm/set” and “homeassistant/alarm” in the app and home assistant, and it wasn’t working.

not a big deal, but it that intentional?

Yeah I was going to suggest pasting your home assistant setup because it has to be the same on as the MQTT Manual Alarm control panel documentation. It is intentional, check the MQTT Manual Control panel component docs on Home Assitant (https://home-assistant.io/components/alarm_control_panel.manual_mqtt/). “home/alarm/set” and “home/alarm" are default values, you can change them in both the panel and the HASS component, but you need to be sure they are the same for both. So if you want to use “homeassistant/alarm/set” and “homeassistant/alarm”, use the same in the control panel application settings.

@thanksmister When does the Portuguese version come out?

i had them set the same in home assistant and the app, so that’s what’s puzzling me.

here’s relevant code for good order. (and they match in the app)

platform: manual_mqtt
name: "house alarm"
pending_time: 90
trigger_time: 60
delay_time: 5
state_topic: homeassistant/alarm
command_topic: homeassistant/alarm/set
code: !secret house_alarm_code

when i listen to homeassistant/alarm and homeassistant/alarm/set on my mqtt broker i see all the relevant commands and state changes from the app AND from home assistant. so it seems like the app isn’t listening to homeassistant/alarm even if that’s what’s set.

not a big deal since i changed them to “home/…” and it works but maybe it points to an issue.

Ah, ok, then its probably a bug on my part. I will take a look at make sure the changes are being propagated through the application and not only the defaults. Thanks…

Hi, I first tried this today and I want to start by saying Thank you.Really nice implementation.

To make it feel even more like a classic alarm panel and possibly increase the WAF even more, I’d like to change the “look and feel” just a little bit by hiding all other elements and just show the current view.

I want to accomplish this:

I am not entirely new to coding, but I’m new to Android coding. I downloaded the code, but I can’t find where the panel layouts are. Can you point me in the right direction?

A few suggestions:
• Full screen mode (like above)
• Today I need to kill the app to reload (sometimes needed if Home Assistant has been restarted). It would be nice to reload the app without having to kill it. Like a swipe from the top or something.
• If the screen has been shut off, the app needs “one click” to get in sync with HA. If I just click the screen it updates, but it would be nice if it for example triggered on “screen wake” and updated itself. It only occur when the screen has been off, not while using the built in screensaver.
• Camera motion detector to wake screen. I have used that in another “kiosk mode app” and it works great. The screen is usually black, but just wave your hand in front of the phone and it wakes up. Perfect fit for a dedicated “alarm key pad” phone/tablet.
• Settings in tabs instead perhaps. Or a save option in each screen. I need to press back like 9 times to get out to the main screen. Or am I doing something wrong?

Again - thank you very much!

@boneheadfraggle . Thanks for the feedback. Updating the layout is complicated as I have several different layouts based on the device resolution. The layout update you suggest may be suited for a smaller screen size but you are missing some navigation elements on the first screen, ones that go to the settings, turn on the screen saver, or view the home assistant webpage. That being said, the layout out files are located in a folder called “layout” and “layout-sw600dp”. Layout files are in xml format, some are layouts for activities, some are dialog layouts. (https://github.com/thanksmister/android-mqtt-alarm-panel/tree/master/app/src/main/res)

The Android application already runs in fullscreen mode and you would exit this mode or change apps by swiping from the top/bottom on your phone to see the device navigation controls.

If your phone screen deactivates then yeah, you need to click into the Android application in order to wake it up because its not aware of when your phone goes to sleep but it can react to user interaction. If the alarm mode does change, the application wakes up the device itself. I can test this again, but the behavior is that any message from HA would wake the device and bring the application to the foreground. I am not sure if you have special device settings on your phone that may be causing some other behavior.

However, it sounds as though your device is also putting the WiFi to sleep, this might not be a good option. This should be more or less a dedicated device and having the screen sleep is fine, turning off WiFi isn’t, and using the built in screen saver is even better. Many people mistake the application for just another app to install on their daily phone, but it’s definitely not designed to be that way. I designed this to be used for a dedicated tablet or wall mounted Raspberry Pi device.

I think for camera motion you can already install a different Android application which will wake the device using motion detection. The reason I didn’t incorporate this feature is because its not as easy to get working properly and there are not many available libraries to do this.

Each change you make to the settings is already saved automatically when you make the change, there is no reason to have a save option. There are however many screens to swipe through. I think it would be a good option have one home back option button or tabs to navigate with a home back option.

Thanks for your super fast reply!

And a few pingbacks:
Fullscreen - what I meant were more like “showing only alarm related info, no other buttons”.
Camera motion detection - It didn’t occur to me then, but of course there must be other apps that can accomplish that. Thanks for the tip.
Screen off: I will do more testing. You are probably right about shutting WiFi off. I just tested this out today so I haven’t mounted the phone yet and since, it hasn’t been on external power today. It will be permanently placed by the main entrance, with a sole purpose to be an alarm panel (and maybe double as a light sensor and IP cam while it’s there)

I realised I just thought some things, I never wrote them :slight_smile:

To accomplish my desired layout, I would also need to move the buttons for screensaver, settings and log to another place. The main reasons for me wanting that look are:

  1. I like it really clean design
    2: I have a wife that need to have as few buttons as possible to press to accept any new gadgets.
    3: And I have two boys that always press every button possible as many times as possible.
    That’s why I want to hide everything that don’t really need to be accessible at all times.
    So I think the best place would be a menu that you slide from left, like the ordinary material design “three dot menus”, but without showing the dots - and secured by code, just like settings are today.

I realize I have a lot Andriod app coding to learn, but hey - now my HA installation and config is kind of finished so I need something new to do :slight_smile:

Which device so you have? How would you access the other areas without the buttons?

I have several devices, but the ones I have been testing with is a Sony Z1 and a Nexus 6P. None of them have physical keys, only virtual buttons.

I imagine accessing the functions by swiping in from left to show the menu, just like you do on the HA web app

Swipe from left > Show the key pad. Enter the code to access the menu.
If correct code is entered, the menu comes in from left, like this:

When it is unlocked, you have three items on the menu: Settings and Log (personally I see little use of the button to start the screensaver, but it can be there as well)

It is probably obvious that English is not my native tongue, so I just might be a little confusing while trying to explain my vision :slight_smile:

I understand what you mean. Let me think about it. I only had one previous request to update the UI, so I have to make sure changes I make don’t cause issues for other users. I like having native buttons present and I don’t want to have to support more than one design, it just opens up the application to more issues. Do try the application on a device that is plugged in and also make sure turn off WiFi when sleeping isn’t active for your device. Thanks!

I would like to use the android app in combination with cloudmqtt but i cant get it to work?

Right now there is no way to use a certificate if you have your cloud MQTT setup for that type of security. It does support secure connections with username/password. The MQTT broker shouldn’t matter otherwise, just set the correct address, topic, command and it should be fine. However, without further information, I don’t have any more advice to give you.