Ademco/Honeywell/Vista ESPHome custom component with an esp32/esp8266

Should this work with the older Vista 20se? It seems like all discussion on this has been for the newer Vista 20p. I tried an initial test setup last night and nothing seemed to decode properly. I’m not sure if I made a wiring mistake or if it’s just sending different codes. Most seem to start with f8, 98, or 9e.

From higher in this thread it looks like 98 and 9e are expansion and rf devices, which I hadn’t enabled in the config yet since I just wanted to test the main system first. So it’s possible those ones are fine.

What you describe is a similar issue a user reported with an older Ademco board, ie an SAV20AMTE.
We never could figure outl the issue. Since I don’t have one of those boards to test with I can’t check it out. I would need to see logic analyzer traces to see what is going on with the protocol. There isnt much documentation on those older boards out there especially the bus protocol.

1 Like

How would I go about getting those logic analyzer traces? I captured a series of messages from the logs. Not sure if those would be useful, but if so, I can paste them here.

Is this something that I’m better off upgrading the panel or is it a reasonable task to figure out the protocol?

Well, you would need to have a logic analyzer like an inexpensive saleae clone and a program like Pulseview to capture and decode the bus signals but you sorta need to have some experience doing it. I can post a setup file for Pulse view (or Saleae if you use that) to simplify the process if you think this is something you want to try.
It might just be easier and more effective in the long run to just upgrade your alarm main board to a vista-20p or something. They are fairly inexpensive.

I’m willing to give it a shot, I don’t mind doing a bit of tinkering. If this doesn’t work out I can always fall back on upgrading the main board. I’m guessing something like this logic analyzer on amazon would do the trick.

However, before going down that rabbit hole is it possible that I screwed something else up? Just to rule some things out. Like for the wiring I ended up using this schematic posted in the issues section with 3 optocouplers instead of 1. Though I replaced the 210 resistor with 220 and used PC817 for the optocouplers.

Here are some examples of the logs

[09:15:46][I][CMD:351]: F8 F8 F8 F8 00 80 00 00 80 00 00 00 00 
[09:15:46][I][CMD:351]: F8 78 9E 78 66 78 98 00 00 00 00 00 00 
[09:15:47][I][CMD:351]: F8 E0 F8 00 FE 1E F8 F8 F8 00 00 00 00 
[09:15:47][I][CMD:351]: F8 00 FE 1E F8 F8 F8 F8 00 00 00 00 00 
[09:15:47][I][CMD:351]: 9E 98 60 E6 06 00 00 00 00 00 00 00 00 
[09:15:47][I][CMD:351]: 98 7E E6 66 7E 98 00 00 00 00 00 00 00 
[09:15:48][I][CMD:351]: 98 00 F8 66 86 7E 00 00 00 00 00 00 00 
[09:15:50][I][CMD:351]: 98 7E E6 00 00 78 00 00 00 00 00 00 00 
[09:15:50][I][CMD:351]: F8 78 9E 78 66 78 98 00 00 00 00 00 00 
[09:15:50][I][CMD:351]: F8 E0 1E 00 00 FE 1E F8 60 00 00 00 00 

I appreciate you taking the time to respond and help.

That schematic is good . Your logs look exactly like the other board I noted. The user in question, using the same circuit replaced the board with a 20p and this fixed the issue so I think your wiring is fine. There just seems to be something slightly different in this boards bus. There should not be much as this board works fine with newer vista keypads and wireless adapters. So I might need to either tweak the circuit or the firmware to work with it.

Yes, that amazon logic analyzer is fine. I’ve used those with no issues.

The user offered to lend me his board for testing so I will be able to have a look in the next few weeks.

1 Like

One thing you can try is see if inverting the serial logic on this bus will affect it. In file Vista.cpp change the lines 1112 and 1118 (the SoftwareSerial init lines to have false instead of true in the invert parameter and recompile.

 if (vistaSerial->isValidGPIOpin(rxPin)) {
    vistaSerial = new SoftwareSerial(rxPin, txPin, false, 50);
    vistaSerial->begin(4800,SWSERIAL_8E2);
    attachInterrupt(digitalPinToInterrupt(rxPin), rxISRHandler, CHANGE);
  }
#ifdef MONITORTX
  if (vistaSerialMonitor->isValidGPIOpin(monitorPin)) {
    vistaSerialMonitor = new SoftwareSerial(monitorPin,-1, false, 50);
    vistaSerialMonitor->begin(4800,SWSERIAL_8E2);
    //interrupt for capturing keypad/module data on green transmit line
    attachInterrupt(digitalPinToInterrupt(monitorPin), txISRHandler, CHANGE);
  }
#endif

I can give that a try a little bit later today. I also have the logic analyzer arriving tomorrow.

No dice. Flipping them to false and installing the firmware still gave log lines starting with F8, 98, and 9E. And a few 00. It also, made my physical keypad completely unresponsive. Setting them back to true restored the keypad functionality.

Something else curious is when it’s connected and with the values as they originally were (true) I constantly get API Disconnect warnings WARNING Disconnected from API: Timeout while waiting for message response!, like every 5-20 seconds. This likewise causes the device to sometimes go unavailable in HA. When I set them to false or disconnect the wires I seem to have no such connection issues in the logs or HA.

The timeouts are due to the device being busy or reseting due to invalid data i expect. To know for sure you’d have to look at the serial logs (with a serial monitor on the usb port) and see if the device is resetting and with what error message. The first issue is trying to find out what is different with the ECP bus that prevents it from being decoded correctly. If you can get a trace (saved as an *.sr file) from the logic anylizer and post it on my github page for this project as a new issue, I can decode it. Make sure you pick up the signals from the ESP side (3.3 or 5 volt) and not directly on the panel lines (12+ volts).

@Dilbert66 Thank you for this great project.
I have connect an ESP 2866 and it loads. Where should I see the logs?
If I look at the logs in ESPhome, I see the nodemce load, as below and then nothing after that?

[20:14:14][C][template.switch:058]:   Icon: 'mdi:shield-link-variant'
[20:14:14][C][template.switch:059]:   Restore State: NO
[20:14:14][C][template.switch:060]:   Optimistic: NO
[20:14:14][C][logger:189]: Logger:
[20:14:14][C][logger:190]:   Level: DEBUG
[20:14:14][C][logger:191]:   Log Baud Rate: 115200
[20:14:14][C][logger:192]:   Hardware UART: UART0
[20:14:14][C][restart:021]: Restart Switch 'restart_switch'
[20:14:14][C][restart:021]:   Icon: 'mdi:restart'
[20:14:14][C][ota:029]: Over-The-Air Updates:
[20:14:14][C][ota:030]:   Address: vistaalarm.local:8266
[20:14:14][C][api:095]: API Server:
[20:14:14][C][api:096]:   Address: vistaalarm.local:6053

It means you are not getting data in. There is something wrong with your wiriing.

@Dilbert66 Thank you for your help. I had a bad solder joint. Fixed. My logs below. Are they normal?

2:41:03][C][api:096]:   Address: vistaalarm.local:6053
[12:41:05][I][CMD:351]: F6 01 00 00 00 00 00 00 00 00 00 00 00 
[12:41:05][I][EXT:351]: F6 01 00 A1 0C 00 6B 62 02 45 43 F5 31 
[12:41:05][I][CMD:351]: F2 0E 02 00 00 00 00 53 FE FE EC 01 01 
[12:41:09][I][CMD:351]: F7 02 00 03 10 08 00 1C 08 02 00 00 2A 
[12:41:09][D][text_sensor:015]: 'vistaalarm Line2': Sending state 'Rdy to Arm 12:47'
[12:41:10][I][INFO:585]: Prompt: *** DISARMED ***
[12:41:10][I][INFO:586]: Prompt: Rdy to Arm 12:47
[12:41:10][I][INFO:587]: Beeps: 0

[12:41:14][I][CMD:351]: F6 01 00 00 00 00 00 00 00 00 00 00 00 
[12:41:14][I][EXT:351]: F6 01 00 E1 07 00 6C 6B 02 43 43 B9 31 
[12:41:14][I][CMD:351]: F2 0E 02 00 00 00 00 54 FE EC 01 01 01 
[12:41:15][I][CMD:351]: F6 01 00 00 00 00 00 00 00 00 00 00 00 
[12:41:15][I][EXT:351]: F6 01 00 21 0C 00 6D 62 02 45 43 F5 31 
[12:41:15][I][CMD:351]: F2 0E 02 00 00 00 00 55 FE FE EC 01 01 
[12:41:19][I][CMD:351]: F7 02 00 03 10 00 00 1C 08 02 00 00 2A 
[12:41:19][I][INFO:585]: Prompt: *** DISARMED ***
[12:41:19][I][INFO:586]: Prompt: Rdy to Arm 12:47
[12:41:19][I][INFO:587]: Beeps: 0

[12:41:25][I][CMD:351]: F6 01 00 00 00 00 00 00 00 00 00 00 00 
[12:41:25][I][EXT:351]: F6 01 00 61 0C 00 6E 62 02 45 43 F5 31 
[12:41:25][I][CMD:351]: F2 0E 02 00 00 00 00 56 FE FE EC 01 01 
[12:41:29][I][CMD:351]: F7 02 00 03 10 08 00 1C 08 02 00 00 2A 
[12:41:29][I][INFO:585]: Prompt: *** DISARMED ***
[12:41:29][I][INFO:586]: Prompt: Rdy to Arm 12:47
[12:41:29][I][INFO:587]: Beeps: 0

[12:41:34][I][CMD:351]: F6 01 00 00 00 00 00 00 00 00 00 00 00 
[12:41:34][I][EXT:351]: F6 01 00 A1 0C 00 6F 62 02 45 43 F5 31 
[12:41:35][I][CMD:351]: F2 0E 02 00 00 00 00 57 FE FE EC 01 01 
[12:41:39][I][CMD:351]: F7 02 00 03 10 08 00 1C 08 02 00 00 2A 
[12:41:39][I][INFO:585]: Prompt: *** DISARMED ***
[12:41:39][I][INFO:586]: Prompt: Rdy to Arm 12:47
[12:41:39][I][INFO:587]: Beeps: 0

The data looks correct . A couple differences to my older test vista-20p system. First,is the second line prompt on my system is "READY TO ARM’. Yours is a bit more verbose with the time included. What system do you have and what peripherals are attached?

Secondly, the F6 below indicates that you have a touch keypad (AUI device) attached at address 01. I never tested with one of those so can’t decode the response at this time but it looks correct however incomplete since my logging code only displays a portion of the response.

All and all, i think it should work fine. I dont’ see any 98’s or F9’s in the log so not sure if you have any extenders or LRR device attached.

Thank you so much. You have done an amazing job with this project.
I am using a Vista 12A. Yes I have a touch keypad.
I think I have a Powerline Carrier Devices and also a module for wireless fob keys.
Sorry another question.
I am having trouble with the keyboard lovelace card. See below. Error "need to define a kpd_linie_1?
any suggestions?

You have got an old version of alam-keypad-card.js installed on your system or the browser has cached an old version… Ensure you use the latest one from master or dev. Here’s a link to a post on how to force refresh the card javascript code on the browser:

Thank you again. It was an old version. Perfect.

@Dilbert66 First, thanks alot for this great project.
I setup the system with ESP8266 but I am having problem using the ESP32.
I can read the data from Vista 20p, but I cannot write anything with the HA dashboard and your provided custom keypad. When I press any key, it seem no message are being sent to the Vista 20p (I check with the serial monitor).

Any idea what could be the problem? shouldn’t ESP32 works same as the ESP8266?

Thanks again

It works fine with the esp32. Since I don’t have any idea on your setup, I would assume you have a wiring problem or you are using the wrong pins. The ESP32 config uses different pins as documented in the yaml.

@Dilbert66 Thanks alot for your reply.

I closely followed the instructions in the circuit and the Yaml file. My ESP32 and ESP8266 setup are attached below.
For ESP32, when I press keys in the Keypad the outcome of the Serial monitor is also attached (nothing being sent).

and my ESP8266 setup works perfectly:

and Yaml file setup is:

#For ESP32:
substitutions:
  systemName: "vistaalarm"
  accessCode: "1234" 
  keypadAddr: "17" # (changed it to 16 and 18 to test)
 
  rxPin: "22" #GPIO pin to use for data receive (yellow line) 
  txPin: "21" #GPIO pin to use for data transmit (green line)
  monitorPin: "18" #GPIO pin to use for monitoring 
esphome:
  name: $systemName
  platform: ESP32
  board: esp32doit-devkit-v1 #(also tried with node32s)
  #platform: ESP8266
  #board: nodemcuv2
#For ESP8266: 
substitutions:
  systemName: "vistaalarm"
  accessCode: "1234" 
  keypadAddr: "17" 
 
  rxPin: "5" #GPIO pin to use for data receive (yellow line) 
  txPin: "4" #GPIO pin to use for data transmit (green line)
  monitorPin: "14" #GPIO pin to use for monitoring 
esphome:
  name: $systemName
  #platform: ESP32
  #board: node32s
  platform: ESP8266
  board: nodemcuv2

Any advice that what might be the problem?
I really appreciate your help.