Device handler is Alarm Panel Bridge as a copy of your code
I have been using this for a while now, using mqtt to control my alarm panel from Home Assistant.
But, after some time the mqtt component hangs. Once a day or so. I can still control the alarm panel from the nodemcu web interface and status is correctly read from the panel. MQTT commands are not received and MQTT status messages are not published. A soft reset issued from the web interface solves the issue. Any ideas?
Hi, Iâm in the UK and just started using SmartThings. I use a Powermax+ and am amazed at what youâve developed - very keen to integrate it!
Please could you advise if you still sell the required âplug and playâ kit?
Thanks!
@fredrik_P Somebody else has reported an mqtt depot that happens after a few days. As soon as Iâm back ill investigate what is causing that, seems a bug in mqtt library, or a quirk in how Iâm using it.
@alleycatuk Yes Iâm still selling them, though currently on honeymoon so i closed my âshopâ. Will post on here in about a week and a half when Iâll reopen it.
@R_M Just checking you are using the actual mac address rather than what you just pasted here. Can you give me a screenshot?
@cjcharles thank you and congratulations! Enjoy your honeynoon - perhaps best you donât spend ages on the ST board 
Will check back towards end of Feb. Thanks
@Fredrik_P, would you mind sharing your Home Assistant configuration/Python scripts. I started to look at it without too much success. With mqtt_sub, I can see the state of the zones but I donât think you get any topic for status like âdisarmedâ.
Alarm/panel has the panel status information while alarm/zoneX has the zone status. Alarm/set for changing state (use the same names/identifiers as ST)
I made a quick and dirty fix (not my idea, Iâll link to the original post where I got the idea from as soon as I find it). I use automations with mqtt to simply translate messages and repost them in another topic. Iâll give you the details.
I can change the topic structure if needed and you have a better proposal? I dont use MQTT so it was just my guess for how to structure thingsâŚ
This is my quick fix for this:
configuration.yaml:
alarm_control_panel:
- platform: mqtt
name: âVisonic Powermax Proâ
code: â****â
state_topic: âalarm/panelstatusâ
command_topic: âalarm/setâ
payload_disarm: âdisarmâ
payload_arm_home: âarmhomeâ
payload_arm_away: âarmawayâ
automations.yaml:
- id: Disarmed
alias: Disarmed
initial_state: âonâ
trigger:
platform: mqtt
topic: alarm/panel
payload: Disarm
action:
service: mqtt.publish
data:
topic: alarm/panelstatus
payload: disarmed
retain: true - id: Armedhome
alias: Armedhome
initial_state: âonâ
trigger:
platform: mqtt
topic: alarm/panel
payload: Arm Home
action:
service: mqtt.publish
data:
topic: alarm/panelstatus
payload: armed_home
retain: true - id: Armedaway
alias: Armedaway
initial_state: âonâ
trigger:
platform: mqtt
topic: alarm/panel
payload: Arm Away
action:
service: mqtt.publish
data:
topic: alarm/panelstatus
payload: armed_away
retain: true
Thanks @Fredrik_P, that helped me to get started.
@cjcharles here are the changes I made (I essentially changed the state labels) to get it working out of the box with a minimal configuration on the Home Assistant side:
configuration.yaml:
alarm_control_panel:
- platform: mqtt
name: Alarm
state_topic: âalarm/panelâ
command_topic: âalarm/setâ
ESP-PowerMaxESP8266.ino:
-
Change in SendJSONMessage():
//Now publish the message with retain flag (the âtrueâ parameter)
if (zone_or_system_update == ALARM_STATE_CHANGE) {
char state[25];
strcpy(state, ZoneOrEvent);
if (strcmp(state, âDisarmâ) == 0) {
strcpy(state, âdisarmedâ);
}
if (strcmp(state, âArm Homeâ) == 0 || strcmp(state, âQuick Arm Homeâ) == 0) {
strcpy(state, âarmed_homeâ);
}
if (strcmp(state, âArm Awayâ) == 0 || strcmp(state, âQuick Arm Awayâ) == 0) {
strcpy(state, âarmed_awayâ);
}
if (strcmp(state, âPerimeter Alarmâ) == 0) {
strcpy(state, âtriggeredâ);
}
mqtt.publish(topic, state, true);
} -
Change in mqttcallback():
if (strcmp(message, âDISARMâ) == 0 || strcmp(message, âARM_AWAYâ) == 0 || strcmp(message, âARM_HOMEâ) == 0) {
mqtt.publish(âalarm/panelâ, âpendingâ, true);
}
if (strcmp(message, âDISARMâ) == 0) handleDisarm();
if (strcmp(message, âARM_AWAYâ) == 0) handleArmAway();
if (strcmp(message, âARM_HOMEâ) == 0) handleArmHome();
if (strcmp(message, âarmawayinstantâ) == 0) handleArmAwayInstant();
if (strcmp(message, âarmhomeinstantâ) == 0) handleArmHomeInstant();
}
I tried that before, and also some other things but couldnât get it to compile. Got errors that I couldnât fix. Iâll look at it again.
Hope you had a great honeymoon! 
yep used the actual mac address which I also fixed in the router and have sent you a message with the screenshots in
fingers crossed itâs an easy fix!
Thanks
@Fredrik_P check my fork with an updated pmax.h and ESP-PowerMaxESP8266.ino which should compile fine.
Sorry, stupid question maybe, but where can I find it?
Here is the direct link:
https://github.com/passy05/SmartThings/tree/master/VisonicAlarm/ESP-Source-Code
Hi All,
I am looking to update my current alarm with a alarm system connected to SmartThings, and came across this thread. Looking for an alarm system so that I can program my ST which things like (if the alarm is set, do this otherwise do that) type controls.
I am looking at the PowerMax Complete. Is this all working for this level of alarm panel?
Basically, in a nutshell, does it work, and will it continue to work?
Thanks.
Thatâs the model i have, so in a nutshell yes! As for all other versions, Iâm virtually confident theyâll all be fully working soon, now that Iâm back home.
Hi, sorry its taken so long to be able to connect everything up.
So I have a powermaster 30.
I have connected using:
just the Wemo D1 and with port 9 (TX1) going to the TTL > USB & GND -> GND
with it plugged in, and a little trial and error I have found that the settings for putty & the device need to be
bits per second : 57600
data bits : 8
parity : none
stop bits 1 :
flow control : none
Using this I can then connect putty & grab what is coming out.
When I click on the status button I a load of Hex codes:
pastbin logs (https://pastebin.com/dwwF4CxN)
Iâve disconnected the setup for now. but hoping that makes some kind of sense to you?
Heya mate, hope all is well.
Just wondering if you had any more ideas I could try please?
This was the main reason why I got ST so might sell it on if I canât get this to work 