arachnetech / homebridge-mqttthing

A plugin for Homebridge allowing the integration of many different accessory types using MQTT.
Apache License 2.0
462 stars 104 forks source link

Security System not respecting defined state values #594

Closed dresende closed 1 year ago

dresende commented 1 year ago

The alarm (Paradox) is proxied to specific topics of my own, so I control the values. I configured the accessory like this:

{
    accessory : "mqttthing",
    type      : "securitySystem",
    name      : "Alarm",
    topics    : {
        setTargetState      : "home/main/alarm/home/status/set",
        getTargetState      : "home/main/alarm/home/status/target",
        getCurrentState     : "home/main/alarm/home/status",
        targetStateValues   : [ "arm_stay", "arm", "armm_sleep", "disarm" ],
        currentStateValues  : [ "stay", "armed", "sleep", "disarmed", "alarm" ],
        restrictTargetState : [ 1, 2, 3 ],
    },
}

The test I did was arming/disarming using homekit and what I see are the default values, not the ones I specify.

Screenshot 2022-10-31 at 15 35 06

It should have published arm and not AA.

arachnetech commented 1 year ago

targetStateValues etc. should not be within topics - i.e. try

{
    accessory : "mqttthing",
    type      : "securitySystem",
    name      : "Alarm",
    topics    : {
        setTargetState      : "home/main/alarm/home/status/set",
        getTargetState      : "home/main/alarm/home/status/target",
        getCurrentState     : "home/main/alarm/home/status"
    },
    targetStateValues   : [ "arm_stay", "arm", "armm_sleep", "disarm" ],
    currentStateValues  : [ "stay", "armed", "sleep", "disarmed", "alarm" ],
    restrictTargetState : [ 1, 2, 3 ],
}
dresende commented 1 year ago

oh... how stupid of me. Sorry. Let me just test it out.

dresende commented 1 year ago

Perfect. IMG_F924E454D515-1

arachnetech commented 1 year ago

Excellent! Thanks for confirming.