背景
由于现在住的公寓大楼对讲门禁装在客厅门外,门关着时很难听到门铃,因此经常错过邮递员。于是打算将其接入 Home Assistant,这样出门也不用带钥匙了。

拆开外壳后,从 PCB 上的贴纸可以看到型号是 “auta 700105 ↗ [存档] ↗”。

硬件
根据厂家官网提供的技术手册 ↗ [存档] ↗,接线柱 CON1 连着的四根入户线从左到右依次是 GND(黑)、+24 VDC 电源(褐)、麦克风(蓝)、扬声器与数据通信(灰)。CON2 通过一个 RJ11 接口连接了听筒。

将 PCB 拆下后,开始逆向电路。


各个 IC:
-
U1是一颗 “78L05A” 稳压器,给其他元件提供了 +5 V 电源 -
U2是一颗 “PIC16F870-I/SO” MCU,实现了主要的功能控制 -
U3是一颗 “ULN2003A” 达林顿管驱动,让 MCU 驱动外围功能电路- 通道 1:输入为 MCU 的 PIN27
RB6,输出为听筒扬声器功放 - 通道 2:输入为 MCU 的 PIN26
RB5,输出为继电器RY1 - 通道 3-7:输入为 MCU 的 PIN25
RB4,输出为 CON1 接线柱上的 “Auxiliary bell (24 Vdc output, in call)”
- 通道 1:输入为 MCU 的 PIN27
-
U4是一颗 “LM393” 电压比较器- 比较器 1 未被使用
- 正相输入 2:+12 V
- 反相输入 2:CON1 接线柱上的入户线 “扬声器与数据通信”
- 输出 2:MCU PIN23
-
U5是一颗 “PC357NJ0000F” 光耦,输入端是 CON1 接线柱上的 “Ding-Dong function (tension free button)”,短接时下拉 MCU 的 PIN22RB1
MCU 引脚功能
- 1
MCLR:复位 - 2
RA0:铃声切换按钮PB1输入(低电平触发) - 3
RA1:红色 LED 输出 - 4
RA2:绿色 LED 输出 - 5
RA3:解锁门禁按钮PB2输入(低电平触发) - 6
RA4:AUX1 按钮(低电平触发) - 7
RA5:解锁信号输出? - 8
Vss:GND - 9
OSC1, 10OSC2:时钟晶振X1输入 - 11
RC0- 14RC3:拨码开关SW15-8 位输入(低电平触发) - 15
RC4- 18RC7:拨码开关SW11-4 位输入(低电平触发) - 19
Vss:GND - 20
Vdd:+5 V 电源输入 - 21
RB0:主/副机选择跳线J1输入(低电平为副机) - 22
RB1:“Ding-Dong function (tension free button)” 光耦集电极输入(低电平触发) - 23
RB2:门铃信号输入? - 24
RB3:解锁信号输出? - 25
RB4:“Auxiliary bell” 输出,通过驱动 ICU3通道 3-7(高电平触发) - 26
RB5:继电器输出,通过驱动 ICU3通道 2(低电平触发) - 27
RB6:听筒扬声器铃声输出,通过驱动 ICU3通道 1 - 28
RB7:挂机插簧开关BT1输入(低电平为挂机)
可见 PIN5 RA3 可以用于解锁门禁,和 PIN27 RB6 可以用于检测门铃在响。
电路如下图所示,由于 PIC MCU 使用 5 V TTL,而 ESP8266 使用 3.3 V,需要通过一个电平转换器来通讯:

安装
如图所示,通过方便焊接的几个触点分别引出 GND(绿)、MCU PIN5(白) 和 PIN27(蓝)(请忽略连接了对讲机电路板 +5 V 的紫色线,因为在供电输入有一个非常有限的 400 mA 保险丝,切勿使用其提供的 +5 V):

由于附近已有一个 ESPHome 设备(全屋电能监控),直接修改复用了它(请忽略用于连接 PZEM 电能监控器的 4-pin 杜邦线):

通过一根废旧 USB 线缆连接:

软件
ESPHome 配置示例:
esphome:
name: building-intercom
comment: 'Auta 楼宇对讲门禁系统 hack'
esp8266:
board: d1_mini
logger:
level: WARN
# baud_rate: 115200
wifi:
fast_connect: true
networks:
- ssid: !secret wifi_ssid
bssid: !secret wifi_bssid
password: !secret wifi_password
domain: !secret domain_name
api:
ota:
password: !secret ota_password
button:
# 暴露解锁按钮至 HASS 前端
- platform: output
name: '解锁楼门'
output: building_intercom_unlock_door_button
duration: 3s
icon: mdi:door
binary_sensor:
# 楼门门铃传感器
- platform: gpio
name: '楼门门铃'
pin: 12
filters:
- delayed_off: 30s # 调整至实际响铃时间
icon: mdi:bell-outline
publish_initial_state: true
output:
# 下拉触发解锁按钮
- platform: gpio
id: building_intercom_unlock_door_button
pin:
number: 14
inverted: trueyaml刷入固件后添加至 Home Assistant:

在 Home Assistant 新建一个自动化,用于在门铃响的时候推送通知至手机(以下两个 YAML 仅为展示配置,应通过图形界面创建):
alias: '楼门门铃通知'
trigger:
- type: turned_on
platform: device
device_id: # 通过 UI 创建
entity_id: binary_sensor.building_intercom_ringing
domain: binary_sensor
condition: []
action:
- service: notify.mobile_app_notification_group
data:
message: '楼门门铃响了'
data:
push:
# iOS 紧急警报
sound:
name: default
critical: 1
volume: 1
actions:
# 解锁按钮
- action: UNLOCK_BUILDING_DOOR
title: '解锁楼门'
destructive: true # 显示为红色
mode: restartyaml另一个自动化用于处理通知中的解锁按钮回调事件:
alias: '解锁楼门通知按钮回调'
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: UNLOCK_BUILDING_DOOR
condition: []
action:
- device_id: # 通过 UI 创建
domain: button
entity_id: button.unlock_building_door
type: press
mode: restartyaml
Hi, I have a similar project that I'm trying to implement but it differs from yours a bit. I have the board "auta 050136" and wanted to detect just the ringing so I'm looking at reading 1.2v from the led diode to my ESP8266MOD, the challenge is that that 1.2v is too small to detect and also I wanted to take 5v from the intercom board to power up my ESP if this possible.
Hi, can you confirm it's the same as in the manuals of Auta 700305 or 700505? If so, it seems they are using individual wire for each function, maybe you can simple tap your ESP into the corresponding wires (with voltage divider of course); if not, you can try adding a suitable transistor, or simply use the ADC pin (be careful and use a voltage divider if necessary) on your ESP and trigger on voltage threshold.
Also I would suggest you not to power your ESP with the +5V from the intercom board, as they usually come with a low-rated fuse, just enough to power the board itself. The ESP8266 (with some peripherals) can peak to around 1W.