MQTT Alarm Control Panel for Raspberry Pi and Android

In the settings my Sony is detected as Front camera 1920x1080, and when testing the camera in the app it show full resolution. But the stream is only 640x480.

Is the camera stream restricted to 640x480px or can I change that to a higher resolution? How?

I have that set manually at this time to 640x480 but it can be configurable. Can you add a feature request to the Github repository, we currently have a backlog of features.

1 Like

Is there a way to have 2 alarm ‘zones’? I am looking to have a set of sensors for ‘night/sleep’ and and additional set to be used for ‘empty house’.

Got mine all working and it’s great. Even passed the ‘wife approval factor’

One thing that I know must be handled with a simple automation is a notification when trying to set the alarm that a door or window is already open.

As mqtt alarm relies on a state change to open, the already open states get missed.

A traditional alarm system blocks arming until all zones are closed and motion is clear.

An suggestions?

Hans

I think the best approach to solve this is to use your home automation platform to perform a check and send a notification to the alarm panel if a sensor such as a door or window is not closed.

You can perform this check on the MQTT state change from disarm to armed home or armed away. You could also disarm the system in the same automation that sends the alert to the alarm panel.

So am automation that checks sensors is the best approach so the application doesn’t have to be aware of each sensor.

@thanksmister thank you for your hard work on this. After many months I’ve finally got it setup!

Working a treat just about to install the pi and screen in the wall but was wondering is Ethernet supported?

I wired up the wall and I’m using Poe to power the pi but doesn’t seem to register with Ethernet on

Yeah Ethernet should work as long as you don’t also usé WiFi. I think there was a bug with Android Things that you couldn’t use both at the same time.

But I thought that Raspberry Pi 3 (not the B+) didn’t support POE? The Android Things version only supports the older RPi 3 and not the newest Pi.

I’ll start trying to debug! Need to make sure the cable works and try and strip out the WiFi info

(Blocking it and rebooting didn’t work)

Yep! I I saw that and had to use my older pi.

Picked up one of these to strip out Ethernet and power :slight_smile:

Look what I found on AliExpress

OK so I found out the ethernet only worked if the POE was mid-span so I fixed that issue up.

How can I disable Wifi so it will only use ethernet? If I go into the settings I can’t clear the existing network, adding blank (or fake) details doesn’t clear it either. I Also tried restoring settings to default (although most setting were still retained)

Would I need to do a fresh install or is there another option?

Update on the Ethernet - seems if I block the wifi (for pi device) from the access point I can get it working with Ethernet. (Not sure if that is the best approach, I can see myself forgetting this in months/years to come and pulling my hair out trying to troubleshoot!)

Otherwise, i’m not really sure if its using ethernet or wifi - it shows its connected to both and is using data on both via my unifi AP admin area

I think its possible that the latest Android Things can use both WiFi and Ethernet. The only way to avoid WiFi being used is to not enter the credentials during setup. Not sure why they are not getting reset, but I guess you could enter the wrong information as well.

@thanksmister I have 2 android tablets in two different rooms in the same house running this Alarm Control panel app. I really like the app interface and when it works, it works well.

Lately though, I’ve been struggling with repeated connections and disconnections from my Mosquitto MQTT server running under HASSIO. Both tablets connect and disconnect from the server about once every second.

The logs for the Mosquitto add-on in HASSIO look like this:

And then, further down there’s also:

[INFO] found *hass username1* on Home Assistant
1549834859: Client *unique client ID1* disconnected.
1549834859: New client connected from 192.168.0.112 as *unique client ID1* (c0, k60, u'*hass username1*').
[INFO] found *hass username1* on Home Assistant
1549834860: Client *unique client ID2* disconnected.
1549834860: New client connected from 192.168.0.112 as *unique client ID2* (c0, k60, u'*hass username1*').
[INFO] found *hass username1* on Home Assistant
1549834861: Client *unique client ID3* disconnected.
1549834861: New client connected from 192.168.0.112 as *unique client ID3* (c0, k60, u'*hass username1*').
[INFO] found *hass username2* on Home Assistant
1549834862: Client *unique client ID4* disconnected.
1549834862: New client connected from 192.168.0.115 as *unique client ID4* (c0, k60, u'*hass username2*').
[INFO] found *hass username2* on Home Assistant
1549834864: Client *unique client ID5* disconnected.
1549834864: New client connected from 192.168.0.115 as *unique client ID5* (c0, k60, u'*hass username2*').
[INFO] found *hass username2* on Home Assistant
1549834866: Client *unique client ID6* disconnected.
1549834866: New client connected from 192.168.0.115 as *unique client ID6* (c0, k60, u'*hass username2*').
[INFO] found *hass username2* on Home Assistant

Note that I redacted the Home Assistant usernames and MQTT client IDs. I can’t seem to find out why the app running on the two tablets connects and disconnects constantly, but it seems to overload the MQTT server to the point where it cannot process anything else.

Note that the two tablets each use unique HA credentials, each has a unique client ID setup in the app, along with a unique panel name in the app.

Does anyone have any idea what might be causing this? Thanks. If it’s better to open up an issue on Github, I can do that.

You are getting disconnected from your MQTT client for some reason, the application will try to reconnect on its own. The logs are valid, but you need to figure out why your MQTT is dropping the connection or possibly the WiFi connection is being reset on the device.

I’m having trouble connecting to MQTT. I get an error on the Alarm Panel screen “There was an error initializing the MQTT client. Please check your settings.”

I recently had some MQTT issues but got them all sorted out. My issues were due to some updates with Mosquitto MQTT. (thread on the issue). I have MQTT working again and all my MQTT devices work, except my alarm panel.

I am confident that my settings are correct on the alarm panel. I am using “http://192.168.1.111” for my MQTT broker address. This is my HASSIO server with an embedded broker. I’m using the same username and password that I use on all my MQTT devices and that I set up for Mosquitto MQTT to use.

Here are my Mosquitto MQTT logs. My wall tablet’s IP is 192.168.1.148. My MQTT username is HASSIO.

1553657331: New connection from 192.168.1.148 on port 1883. 
1553657331: |-- mosquitto_auth_unpwd_check(HASSIO) 
1553657331: |-- ** checking backend http 
1553657331: |-- url=http://127.0.0.1:8080/login 
1553657331: |-- data=username=HASSIO&password=REDACTED&topic=&acc=-1&clientid= |[INFO] found HASSIO on Home Assistant 
1553657333: |-- getuser(HASSIO) AUTHENTICATED=1 by http 
1553657333: Socket error on client mywallpanel, disconnecting. 
1553657333: New client connected from 192.168.1.148 as mywallpanel (c0, k60, u'HASSIO'). 
1553657333: Socket error on client <unknown>, disconnecting.

HASSIO v 0.89.0
Mosquitto MQTT v 4.1
Most recent Alarm Panel version

Any idea how to fix this?

It looks like I’m the initial connection you have a client ID that is blan. What is your client ID set as in the application?

I’ve been having this exact issue the last month or so, it’s happened perhaps 3 times. First I notice that all my MQTT devices are showing as unavailable in hassio, and before I traced it back to the alarm control panel app the first time it actually started rebooting my tasmota devices over and over. It seems like a flood of mqtt messages that cause unusual behavior? The solution each time has been to close the app, restart mosquito on hassio, and relaunch the app a few hours later. It’s happened on the last few versions of hassio (including latest 90.1) and with mosquito add on v 4.0

I am on an older version of HA (v.82?) and I am not having issues with disconnecting my MQTT devices including Alarm Panel. I am reluctant to upgrade HA as I just think they are not spending enough time on stability rather than new features. I can’t reproduce the issue but I have put out a new version on slow rollout which I’ve tried to address past connection issues. Feel free to download the latest version from Github if you are not one of the users in the slow rollout on Google Play. However, I can’t guarantee this will fix your issues especially if it’s with a new version of MQTT and HA.

My clientID in the MQTT settings on the app is 170ea175c1102b8169105130f2ef150163139b4fa

Here is my log with some alarm entries

2019-03-27 18:50:39 INFO (MainThread) [homeassistant.components.alarm_control_panel] Setting up alarm_control_panel.manual_mqtt

2019-03-27 18:50:40 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to alarmpanel/sensor/battery

2019-03-27 18:50:40 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to home/alarm/set

2019-03-27 18:50:41 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on home/alarm: disarmed