A little help with MQTT Alarm

Hi
I have a Paradox Alarm system and I integrated to HA with this setup

In the configuration.yaml I have the following
alarm_control_panel:

  - platform: mqtt
    state_topic: "paradoxdCTL/hassio/Arm"
    command_topic: "paradoxCTL/in"
    payload_disarm: '{"password":"0000","Command":"disarm","Subcommand":"0"}'
    payload_arm_night: '{"password":"0000","Command":"sleep","Subcommand":"0"}'
    payload_arm_home: '{"password":"0000","Command":"stay","Subcommand":"0"}'
    payload_arm_away: '{"password":"0000","Command":"arm","Subcommand":"0"}'

Iknow that I have to change the password to the one I have but I will do it later (I am noob so one step at a time)
I have also setup all the binary sensors and are working ok.

The problem right now is I don’t get the status of the of the alarm in Home Assistant alarm card
but I can get the messages in the MQTT topic. (see below message 71)
I am not sure what I have to type in the subcommand in configuration yaml or what the problem is.
Can someone help a little please?

Listen to a topic
 
Listening to
#
 
Message 98 received on paradoxCTL/in at 11:50 AM:
{
    "password": "0000",
    "Command": "disarm",
    "Subcommand": "0"
}
QoS: 0 - Retain: false
Message 97 received on paradoxdCTL/out at 11:48 AM:
{
    "event": 0,
    "sub_event": 3,
    "partition": 0,
    "sub_eventD": "",
    "eventD": "Zone OK",
    "data": "R.SALONI"
}
QoS: 0 - Retain: false
Message 96 received on paradoxdCTL/hassio/zone3 at 11:48 AM:
OFF
QoS: 0 - Retain: false
Message 95 received on paradoxdCTL/out at 11:48 AM:
{
    "event": 1,
    "sub_event": 3,
    "partition": 0,
    "sub_eventD": "",
    "eventD": "Zone open ",
    "data": "R.SALONI"
}
QoS: 0 - Retain: false
Message 94 received on paradoxdCTL/hassio/zone3 at 11:48 AM:
ON
QoS: 0 - Retain: false
Message 93 received on paradoxdCTL/out at 11:48 AM:
{
    "event": 0,
    "sub_event": 3,
    "partition": 0,
    "sub_eventD": "",
    "eventD": "Zone OK",
    "data": "R.SALONI"
}
QoS: 0 - Retain: false
Message 92 received on paradoxdCTL/hassio/zone3 at 11:48 AM:
OFF
QoS: 0 - Retain: false
Message 91 received on paradoxdCTL/out at 11:48 AM:
{
    "event": 0,
    "sub_event": 4,
    "partition": 0,
    "sub_eventD": "",
    "eventD": "Zone OK",
    "data": "R.XOL"
}
QoS: 0 - Retain: false
Message 90 received on paradoxdCTL/hassio/zone4 at 11:48 AM:
OFF
QoS: 0 - Retain: false
Message 89 received on paradoxdCTL/out at 11:48 AM:
{
    "event": 1,
    "sub_event": 4,
    "partition": 0,
    "sub_eventD": "",
    "eventD": "Zone open ",
    "data": "R.XOL"
}
QoS: 0 - Retain: false
Message 88 received on paradoxdCTL/hassio/zone4 at 11:48 AM:
ON
QoS: 0 - Retain: false
Message 87 received on paradoxdCTL/out at 11:48 AM:
{
    "event": 1,
    "sub_event": 3,
    "partition": 0,
    "sub_eventD": "",
    "eventD": "Zone open ",
    "data": "R.SALONI"
}
QoS: 0 - Retain: false
Message 86 received on paradoxdCTL/hassio/zone3 at 11:48 AM:
ON
QoS: 0 - Retain: false
Message 85 received on paradoxdCTL/out at 11:48 AM:
{
    "event": 0,
    "sub_event": 3,
    "partition": 0,
    "sub_eventD": "",
    "eventD": "Zone OK",
    "data": "R.SALONI"
}
QoS: 0 - Retain: false
Message 84 received on paradoxdCTL/hassio/zone3 at 11:48 AM:
OFF
QoS: 0 - Retain: false
Message 83 received on paradoxdCTL/out at 11:47 AM:
{
    "event": 1,
    "sub_event": 3,
    "partition": 0,
    "sub_eventD": "",
    "eventD": "Zone open ",
    "data": "R.SALONI"
}
QoS: 0 - Retain: false
Message 82 received on paradoxdCTL/hassio/zone3 at 11:47 AM:
ON
QoS: 0 - Retain: false
Message 81 received on paradoxdCTL/out at 11:47 AM:
{
    "event": 0,
    "sub_event": 3,
    "partition": 0,
    "sub_eventD": "",
    "eventD": "Zone OK",
    "data": "R.SALONI"
}
QoS: 0 - Retain: false
Message 80 received on paradoxdCTL/hassio/zone3 at 11:47 AM:
OFF
QoS: 0 - Retain: false
Message 79 received on paradoxdCTL/out at 11:47 AM:
{
    "event": 1,
    "sub_event": 3,
    "partition": 0,
    "sub_eventD": "",
    "eventD": "Zone open ",
    "data": "R.SALONI"
}
QoS: 0 - Retain: false
Message 78 received on paradoxdCTL/hassio/zone3 at 11:47 AM:
ON
QoS: 0 - Retain: false
Message 77 received on paradoxdCTL/hassio/zone8 at 11:40 AM:
OFF
QoS: 0 - Retain: true
Message 76 received on paradoxdCTL/hassio/zone10 at 11:40 AM:
OFF
QoS: 0 - Retain: true
Message 75 received on paradoxdCTL/hassio/zone6 at 11:40 AM:
ON
QoS: 0 - Retain: true
Message 74 received on paradoxdCTL/hassio/zone9 at 11:40 AM:
ON
QoS: 0 - Retain: true
Message 73 received on paradoxdCTL/hassio/zone11 at 11:40 AM:
ON
QoS: 0 - Retain: true
Message 72 received on paradoxdCTL/hassio/zone2 at 11:40 AM:
OFF
QoS: 0 - Retain: true
Message 71 received on paradoxdCTL/hassio/Arm0 at 11:40 AM:
disarmed

well, it’s me again :wink:
Acording to the paradox guide the alarm’s state topic is paradoxdCTL/hassio/Arm but in your MQTT logs I can see this

QoS: 0 - Retain: true
Message 71 received on paradoxdCTL/hassio/Arm0 at 11:40 AM:
disarmed

so in your case it’s paradoxdCTL/hassio/Arm0 (how have you managed to achieve that?) and that’s what you need to use in state_topic so HA picks up your alarm’s state.

Hi!
I saw that so yes I am able to get the status.
Now I am stuck on how to arm the alarm from the card.
now my conf file is

alarm_control_panel:
  - platform: mqtt
    #name: Paradox Mak
    #unique_id: Paradox Mak
    state_topic: "paradoxdCTL/hassio/Arm0"
    command_topic: "paradoxCTL/in"
    payload_disarm: '{"password":"1234","Command":"disarm","Subcommand":"1"}'
    payload_arm_night: '{"password":"1234","Command":"sleep","Subcommand":"1"}'
    payload_arm_home: '{"password":"1234","Command":"stay","Subcommand":"1"}'
    payload_arm_away: '{"password":"1234","Command":"arm","Subcommand":"1"}'

I tried with “Subcommand”:“1” & “Subcommand”:“0”
but it is not working. Any ideas :slight_smile:

and this is the topic that it sends the command which seems right?

{
    "password": "1234",
    "Command": "stay",
    "Subcommand": "1"
}

I cannot figure out what the instructions means with the following

if Command is arm,sleep,disarm subcomand is partition

well, look at your logs:

QoS: 0 - Retain: false
Message 93 received on paradoxdCTL/out at 11:48 AM:
{
“event”: 0,
“sub_event”: 3,
“partition”: 0,
“sub_eventD”: “”,
“eventD”: “Zone OK”,
“data”: “R.SALONI”
}

so your Subcommand should be 0.

you need to dig deeper (and btw, “it is not working” won’t get you anywhere, be specific).
I’d advise to try sending your ‘{“password”:“1234”,“Command”:“stay”,“Subcommand”:“0”}’ to paradoxCTL/in to see if it works at all.
It’s also a good idea to listen to the state topic as the alarm should react on what it receives on command topic and it’ll get us a better picture.

huh? it's a message.

It does receive the message but I don’t get any respond from the alarm
I checked it in my phone mqtt app
I experiment with the quotes in the numbers with the same results

Listen to a topic
 
Listening to
paradoxCTL/in
 
Message 10 received on paradoxCTL/in at 4:36 PM:
{
    "password": 1234,
    "Command": "arm",
    "Subcommand": 0
}
QoS: 0 - Retain: false
Message 9 received on paradoxCTL/in at 4:36 PM:
{
    "password": 1234,
    "Command": "sleep",
    "Subcommand": 0
}
QoS: 0 - Retain: false
Message 8 received on paradoxCTL/in at 4:35 PM:
{
    "password": 1234,
    "Command": "sleep",
    "Subcommand": 0
}
QoS: 0 - Retain: false
Message 7 received on paradoxCTL/in at 3:47 PM:
{
    "password": 1234,
    "Command": "sleep",
    "Subcommand": 0
}
QoS: 0 - Retain: false
Message 6 received on paradoxCTL/in at 3:47 PM:
{
    "password": 1234,
    "Command": "arm",
    "Subcommand": 0
}
QoS: 0 - Retain: false

what exactly does that mean? does the command set the alarm?

do you mean that you subscribed to the alarm’s state topic and there is nothing new in it when you publish that arm message?

the Github page clearly sets out how it should be so what’s the point?

No. I mean that when I press the button it does sent a message

I had the phone listening to # and didn’t received any messages

Sometimes when I am following the formats in numbers I have to use ’ instead of " in order to be valid the configuration or the automation

so you send a message, you can see it in paradoxdCTL/in but nothing happens on paradoxdCTL/status, correct?

it means something is not quite right with either your message or the paradox code you’re using. bummer.
have you tried to find a support group for it or open an issue on the Github repo?

could you give me an example?

Correct

No, but I am speaking with the guy that wrote the code.It happens to live near me!
The problem is he don’t knows anything about HA. He is working with Openhab.
He told me to check the ground cable (if it is connected right) and it is

I don’t remember exactly but sometimes in an example it says
days:5
and I have to wright
days:‘5’

May I ask something please?
Just because I haven’t write any automation in mqtt
could you give me a simple code (to check if it will work) of an automation that it will arm the alarm at 21:00 o’clock?

I have some news.
I tried to arm the alarm with mqtt explorer. I tried the following and it worked!

What do you think is the problem?

I’m not using MQTT Explorer - could you tell me what exactly did you do (in steps and exact data)?
And how didi you send a message previously when I asked you to do so? (a bit rhetorical question though :slight_smile: )

that’s awesome.

it’s not necessary. if we make sure his code works as expected, it’d be a great step forward.

well… you need to read docs. there they usually say whether it’s a string or a number. sometimes it doesn’t matter but there are cases when it does. in this case its obviously a string (the guy converts it to a number inside anyway).

this alarm?
I can do that if you tell me how to arm it :wink:

I was clicking the button of the alarm cardAnnotation 2020-03-30 223343
I tried to publish the packet in HA Mqqt (developers tool) and it also worked (armed the alarm)
I published the following code

{
    "password": "1234",
    "Command": "disarm",
    "Subcommand": "0"
}

So I think that the problem is in the alarm card.

Yes please, with the above code I almost certain it will work

well, I asked you to public a message to see if it’s correct - not to click at the LL card button as I know the difference.

that’s cool. so the state is picked up by HA and you can arm /disarm the alarm by sending MQTT messages from MQTT Explorer?

Could you post code of your alarm card?

It should, why not?
Here’s what automations are constructed from.
Basically you need a time trigger as you want your alarm to set at a certain time.
And to do the you need to publish a MQTT message - here’s how.

There you go

- alias: set_alarm_at_9pm
  trigger:
    platform: time
    at: "21:00"

  action:
    service: mqtt.publish
    data:
      topic: "paradoxCTL/in"
      payload: '{
        "password": "1234",
        "Command": "disarm",
        "Subcommand": "0"
      }'

Give it a go and let me know.
Btw, you don’t need to wait for 9pm to test this particular automation as it does not use any trigger’s data - just go to Developer tools → Services, select automation.trigger, find your automation and click the button. Or to Developer tools → States, find your automation by typing its name, click on it and there will be TRIGGER button ib the more-info dialog.

Well, I really don’t believe it but it finally works!
The most odd thing is that the command topic should be padadoxdCLT/in (with d in the end!)

command_topic: "paradoxdCTL/in"

At first I tested your automation and it didn’t work. I saw the that in mqtt explorer it had listened the correct command topic. If you see my previous post with mqtt explorer you will notice it too.
After that correction it did worked.
I will ask the developer tomorrow why that happened. I forgot to mention that earlier we talked I told him about the arm0 instead of arm in the topic and he told me that it has to do with partitions.
By mistake in the code he gave me he left it with partition on and that was the reason of arm0.

Finally I changed the configuration command topic in correct one and the alarm card is working too.

Thank you so much for the help and the lessons. I have to admit that this was by far my most difficult task in HA until now at least,

how do you know that? from the logs you posted earlier I’d say it’s paradoxCTL/in (but Github instructions state paradoxdCTL/out).
combined with paradoxdCTL/hassio/Arm0 instead of paradoxdCTL/hassio/Arm I just don’t know what to say. it’s bizarre.

well, up to this point it was paradoxCTL/in, don’t know how you changed it. and the most importantly, you didn’t mention it to me :frowning:

sounds credible but please ask him to update the readme if that’s the case.
however, that d thing cannot be explained like that. where did you get it from (read Github?) and why in the initial post there is a string “Message 98 received on paradoxCTL/in at 11:50 AM:”?

holy £$%@! I thought you downloaded it from Github. well, it can be anything inside, that’s crazy.

hurray and amen!
hope it will work well for you as security must be as reliable as possible.

Hi
Everything is working ok here. I would like to add an extra automation where in the morning (after I have disarmed the alarm with another automation) to open the cover of the living room.
So I wrote the following automation. I am wondering if I am right regarding the state condition. What do you think?

- alias: disarm_alarm_at_0600
  trigger:
    platform: time
    at: "06:00"

  action:
    service: mqtt.publish
    data:
      topic: "paradoxdCTL/in"
      payload: '{
        "password": "1234",
        "Command": "disarm",
        "Subcommand": "0"
      }'
#Covers Up
- id: Cover Up
  alias: Cover Up
  trigger:
    platform: time
    at: '06:15:00'
  condition:
    condition: state
    entity_id: alarm_control_panel.mqtt_alarm
    state: "disarmed"
  action:
    - service: cover.open_cover
      entity_id: cover.50758014840d8e91f036 #erker
    - delay:
        seconds: 60  
    - service: cover.open_cover
      entity_id: cover.50758014840d8e91f4fd #trapezaria

Annotation 2020-04-05 204556

it looks good.
or you can make it better and swap entities, i.e when the alarm is disarmed and time is between say, 6am and 7am, perform the actions.

why do you need delay between opening your covers?

My covers are tuya, and lately I see a delay when I manually try to open or close them.1-2 months earlier there was no delay so I thought it would be safer this way.

I have this same Paradox alarm interface and one thing that I have never been able to get working it this control via MQTT. Is this code working for you?

EDIT: I have a feeling I need to sort this out, so I’ll give that a try and see what happens.