MQTT Alarm Control Panel for Raspberry Pi and Android

@rebelnme I have tested the latest version with TTS, but I could seem to reproduce the issue. Could it be that you are sending multiple MQTT notifications? I tested by using a the MQTT service in HASS to broadcast a message. Go to http://hassio.local:8123/dev-service in HASS and select MQTT Publish from the dropdown and then send something like this {"topic":"home/notification", "payload":"Hello"}. I don’t hear any hiccup or double messages. Test it that way and let me know, also be sure you are running the latest version from Google Play or Github if side loaded.

It will be my custom alarm control panel specifically https://github.com/gazoscalvertos/Hass-Custom-Alarm/blob/master/custom_components/alarm_control_panel/bwalarm.py

The MQTT Manual Control Panel disarms the alarm without any code being passed over.

If this could be included as an option within your app that would be fantastic.

@gazoscalvertos I think that is a good idea. I like really like what you are doing with your custom component and would be glad to help. I didn’t investigate this yet, but does your custom component integrate with HA Dashboard?

1 Like

I haven’t yet looked at HADash to be honest, using the iFrame widget would allow the page to be displayed on HADash.

Was there any additional features you were looking to tie into it?

@gazoscalvertos The only thing I am looking into for my application is to know current sensor states so the alarm panel can alert the user if the door is open before setting the alarm. I have a quick follow up question for you about the alarm code being sent on the payload. Have you tested this already, have you published something like DISARM [1234] to HASS’s MQTT service and successfully picked it up in your component? The HASS MQTT control panel currently picks up the command I am publishing with the payload DISARM, are you capturing those as well from external MQTT calls and handling them in your component?

@gazoscalvertos I guess it would be nice if when I published ARM_HOME or ARM_AWAY, the component would return something different back if the user has indicated they can’t arm the alarm with a sensor open.

It shouldn’t arm the system but send back some type of notification instead or status other than armed_away, armed_home, pending, triggered that I could react to by giving notification. Perhaps the payload could be the reason why the alarm couldn’t be armed.

I was going to do this within the alarm panel, but it makes more sense if the alarm component would return the a different alarm state, like {“sensor_open”:“main door sensor”}. Maybe send back the friendly name of the sensor that is open, or an array of open sensors. I know your component does something like this, not sure if it prevents the arming of the system if a door is open.

@thanksmister

Have you tested this already, have you published something like DISARM [1234] to HASS’s MQTT service and successfully picked it up in your component

Not yet, I will add this feature over the next couple of days as I will make it an optional feature. I.e. if mqtt_override_code is set to false in alarm.yaml then the component will require the DISARM payload to include the code else it will simply disarm.

The HASS MQTT control panel currently picks up the command I am publishing with the payload DISARM, are you capturing those as well from external MQTT calls and handling them in your component?

Yes, currently capturing these and they do work, there is no need for the additional MQTT manual control panel

I know your component does something like this, not sure if it prevents the arming of the system if a door is open

The system gives a friendly message warning the user a device is open and they can then choose to override it and arm the alarm. I can certainly publish something along the lines of {“sensor_open”:“[hallway motion sensor], [main door sensor]”} i.e. the status and the array without the system being armed. I could also capture say ARM_HOME_OVERRIDE which would arm regardless of open sensors so that you could also present a friendly warning to the user with the option to override.

1 Like

I’ve built this panel and it works like a charm!

I’m wondering which speaker you’re using for the TTS functionality with it? Are you using those speakers that are powered via the USB port of a raspberry and plug into the 3,5mm jack for audio? Also, Is there a way to expose the Rpi camera feed to home assistant?

@warbringer The TTS uses the 3.5mm jack for audio. I have USB powered speakers that hook to the jack. I am not sure there is a simple way to get the Rpi camera feed back to Home Assistant without some major work. The camera isn’t continuously running for one thing, it’s just capturing a photo.

@gazoscalvertos My only suggestion at this point would be to update the HASS MQTT component with some of these custom changes we are discussing. This way you have more eyes and input for the changes. Having the HASS alarm control panel accept a code through MQTT as well as notify users if the sensor they wanted closed is open when they want to arm the system are nice features to have.

1 Like

Do you have a link for the speakers you bought? I’m currently looking at something like this. Would that work?

I was hoping that there would be an “easy” integration with the android IP webcam given that this platform runs on Android Things but I know far to little about it to say anything meaningful here. Thanks for your work so far and is there anywhere I can donate?

Any speaker that has a 3.5mm audio cable would work. I use this one from Amazon, https://www.amazon.com/AYL-Guarantee-Rechargeable-Expandable-Smartphones/dp/B007OYAVLI/ref=lp_8188092011_1_2?srs=8188092011&ie=UTF8&qid=1515938918&sr=8-2. As for streaming video you have to build a streaming video Android application. I am only capturing images, it would be a totally different type of application.

If you only wanted to stream video from the Pi camera, you could just use python and the default Raspberry Pi OS instead of Android Things. There is already free software to do what you want for RPi. Search Google for RPi streaming video. I have used this one to successfully stream video to Home Assistant from a RPi3 http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome.

1 Like

After I updated the Android application, I found that my screen turns off automatically when it is inactive. It used to prevent that with its screen saver. But now it seems it does not work. How can I solve this issue?

@uwut I will have to take a look. Did you change your screen saver settings on your device recently?

Hi,
I have just started using your app for Android and I am very pleased with it.
I have set up a Mailgun account to get the emails with the photo and it working as it should.
But I am using mostly Telegram for all the notifications forma HA. And would like to ask you if you think that adding support for that notify platform would be very dificult.
I did the integration with HA and seemed to be pretty simple.
Thanks for your work.

@tremebundo do you mean sending a photo using Telegram as an option? I looked at Telegram aft first but there was something that made hesitant to use it. I can take another look.

Yes.
I use it to send snapshots from my cameras when the alarm system is triggered. All I had to do was setting up a bot at Telegram and subscribe my user to it.
All I did was to follow the set up procedure described at the Telegram notify platform docs from HA.

I will take a look, thanks for the feedback.

And other question:
If you ever think to support other languages than english, I could assist with the spanish translation.
WAF factor, you know…

Yeah, I live in Argentina but my Spanish isn’t good enough to do full translations. I would love the help, there is a strings.xml file in the Github repository. All that would be required would be to download the file and translate it, all the strings used in the application are there already. Here is the file location: https://github.com/thanksmister/android-mqtt-alarm-panel/blob/master/app/src/main/res/values/strings.xml.