Dilbert66 / esphome-vistaECP

This is an implementation of an ESPHOME custom component and ESP Library to interface directly to a Safewatch/Honeywell/Ademco Vista 15/20 alarm system using the ECP interface and very inexpensive ESP8266/ESP32 modules .
GNU Lesser General Public License v2.1
125 stars 21 forks source link

Rf sensor decoding #22

Closed nitej closed 3 years ago

nitej commented 3 years ago

Adds decoding rf serial data sent to main panel on tx line. This version is more rigorously tested than the previous PR. Also changed to the serial print to match the mqtt serial format (xxx-xxxx), which matches the labels on honeywell RF sensors.

nitej commented 3 years ago

Thinking about this serial format, does it make sense to format the serial as xxx-xxxx since that format is not nearly as easy to pass on the server side? Should the mqtt topic just be the serial without the "-"?

Dilbert66 commented 3 years ago

Actually, that might be better then it could be used as a number or a string. I dont' have an RF setup so can't really test it.

Dilbert66 commented 3 years ago

I don't get the division by 10000? Why is that needed? I don't have sample data so can't compare. Do you have an example real serial and it's encoded 9E record?

nitej commented 3 years ago

The division by 10000 is the pick off the three biggest digits of the serial number (and the mod 10000 picks off the smallest 4 digits). The reason is that the serial number printed on the RF devices themselves are formatted as xxx-yyyy. This serial number is encoded in the 9E response as an integer xxxyyyy. A response coming from the RF transceiver looks like

00 51 81 8B 72 A0 91 00 54 81 8B 72 20 0E

Bytes 3, 4, and 5 contain the serial (as from what I can tell, just the lower nibble of the 3rd byte). Byte 6 contains the sensor data Byte 7 contains a checksum (2s complement sum).

These examples have a serial of 0101234, and the device would have a label of 010-1234.

Dilbert66 commented 3 years ago

ahh. ok, i see. It was needed to do the split with the dash. Tks.