-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to send disarm code via MQTT? #304
Comments
The example ino mqtt file does not support direct keypad entry. If you have some coding familiarity you can try adding support for it by adding the code snippet below to the ino file in the "mqttcallback" function after the disarm if statement. Note that that I have not tested this on a dsc system as I use something similar to the code below on my vista implementation so adapted it for this use. You might need to tweak it and debug it. This should add the ability to recognize when a direct keypad command is sent by using an exclamation mark '!' as a trigger . eg. !1234 where 1234 is your code to be sent directly to the panel. You can then send anything you want. If you want to send to as specific partition, you would enter 1!1234 where the first character is the partition, then the ! as the direct code flag, then your digits.
|
My HomeAssistant-MQTT.ino file now looks like:
And my HA config now looks like:
Now I can successfully pass the user code to disarm the panel. However, this creates a new issue with HA where it wants to pass "1S{code}" to MQTT. Of course this is expected given the "command_template", so that begs the question... What would be the direct command for "S", "A", and "N" for home, away, and night respectively? I looked through the code, but couldn't find an obvious answer. Side note: |
The following snippet works on the HA side as a hackish way to solve the issue I mentioned above:
|
The S, A and N are the direct commands for those modes as they simulate the DSC panel keys assigned to those functions. Since you are using homeassistant you might also be interested in using ESPHome instead of MQTT. Here's a link to my implementation of this library adapted to ESPHome. https://github.com/Dilbert66/esphome-dsckeybus/tree/new Edit: Other direct commands you can send such as *0 to quick arm your system (that's assuming quick arming is enabled on your panel). |
@Dilbert66 I saw your ESPHome implementation before I built my Arduino shield. Nice work there, especially with the example PCBs. The only thing that stopped me, aside from not having the hardware on hand, was a lack of simple implementation using Ethernet instead of WiFi. I really need a hard wired Ethernet connection. Perhaps I should ask about that on your github repo instead of here. |
There's a few boards that are out that include an esp32 with built in ethernet connectivity such as : https://www.aliexpress.com/item/4001122992446.html Then you configure esphome to use ethernet: https://esphome.io/components/ethernet.html Edit: the WT32-ETH01 is also a good less expensive board but needs an external usb to serial adapter to flash initially. |
@Dilbert66 I tried your direct command example to bypass a zone with the following changes:
With these changes "|*102#" bypasses zone 2. |
I am successfully running the Arduino HomeAssistant-MQTT.ino example with Home Assistant (HA). For the life of me I cannot figure out how to force the HA alarm keypad to send a user code to disarm the system. If I hard code a user code into the sketch, compile, and upload to the Arduino, I can enter any number into the HA keypad to disarm the system. Even a single digit works.
I would like the HA alarm keypad to just pass the user code via MQTT to the Arduino, which then passes the code to the alarm panel. What am I missing?
HA config:
The text was updated successfully, but these errors were encountered: