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