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

@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.

You are using the wrong pin for tx on the esp32. You have it on gpio13 instead of gpio21 like the config is set to. The reason I don’t use gpio13 on the esp32 is that it outputs pwm on boot and we don’t want to induce noise on the ecp bus for no reason.

@Dilbert66
I am using the GPIO21. (I believe the angel wasn’t good in the last photo gave wrong impression about gpio13).

I am using GPIO 22, 21, and 18 and GND and VIN in the ESP32 as can be seen here.

Any advice?

again I really appreciate your help :slight_smile:

this is my whole circuit in case you want to check. It works with ESP8266.

Try a different pin then as that is the only thing it can be. The code is fine. You can also try lowering the resistor value of the optocoupler from 220 to 180 or something to see if that also helps. Other wise, the only way of knowing what is going on for sure is to trace the signals with a scope.

@Dilbert66
wow, I had 150 handly and changed the 220 to 150. Works perfectly now.
and thanks a lot.
Should I change it to 180 or 150 is fine?

You should be ok with 150. Assuming a forward voltage drop of around 1.3 (typical) of the 4n26, you will be sourcing about 13ma of current give or take. The esp pins are rated at around 12ma. Since the output is not continuous, it should not be a problem. Using 180 will bring the current to about 11ma.

I use tlp521’s here since I have tons of em and they have slightly more gain and hence the 220 ohm value.

It is interesting though that the esp8266 had no issues but the esp32 did.

1 Like

I went back and had a look at the esp32 datasheet and it seems to indicate that 40ma is the max source current on a pin. That seems high but there is a some confusion out there about what the true limit on the ESP32 is. The 12ma value comes from the ESP8266 i suspect.

Either way, I’m pretty sure using 150ohm is best here so stick with that value on the ESP32. I will amend my schematic to indicate that.

1 Like

Hi @Dilbert66 Thank you again for this amazing project. One more question. I have an Ademco CE3 code Encryptor which provides key fobs to Arm and Disarm the alarm. It also provides two relays for unlocking doors. Do you think the buttons for the relays could be read from this application?

I’m not familiar with that peripheral so can’t say how they work. The documenation doesnt describe the relays as programmable from the panel so suspect they will not be visible. You can try capturing the logs while you operate the fobs and see if we can view any interesting traffic. The one to watch is the 98 cmd.

FYI,before you post the logs, you might want to check or edit the F6 cmds generated when you use the keyfobs as they will most likely contain the user code assigned to the encryptor board (it emulates a keypad and sends the associated user code to arm/dissarm). The f6 will start with F6 11 (keypad id 17 response)

The F6 01 are the touch keypad cmd/responses. Those are fine.

I went back and retested with a bunch of optocouplers I had on hand and found that the 4N25/4N26 I had initially suggested is inadequate for this use. The CTR (gain) is too low. I recommend using a 4N35 or TLP521 (those I have tested and use currently) as they will produce a good signal with minimal forward current. Hence you could drive the optocoupler with 220 ohm instead of 150 if needed.

I have amended the schematic to reflect the new design recommendations. I have also published a fully isolated version for those that would prefer it.

2 Likes