Skip to content

Commit

Permalink
Merge pull request #3 from AzonInc/dev
Browse files Browse the repository at this point in the history
PCB Revision 1.3
  • Loading branch information
AzonInc committed Apr 13, 2024
2 parents a3a1f29 + 6721523 commit 72d1bf4
Show file tree
Hide file tree
Showing 64 changed files with 747,044 additions and 16,437 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: AzonInc
ko_fi: azoninc
Binary file added .github/images/enclosure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/pcb_bottom_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/pcb_top_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/title_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
doorman-backups
manufacturing
production
*.lck
*autosave*
*auto_save*
Expand Down
108 changes: 65 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,52 @@
Doorman S3
<br>
<br>
<img src="docs/Doorman-S3-Title.png" alt="Doorman S3" height="275">
<img src=".github/images/title_dark.png" alt="Doorman S3" height="275">
<br>
</h1>

This repository contains the source files for the Doorman S3 - TCS Intercom Gateway, a device which lets you connect your [TCS](https://www.tcsag.de/) Intercom to any home automation system.
This repository contains the source files for the Doorman S3 Intercom Gateway, a device which lets you connect your [TCS](https://www.tcsag.de/) or [Koch](https://www.kochag.ch/) intercom to any home automation system.

However it's not limited to TCS and Koch intercoms only.
With the integrated relais you can easily simulate a button press to trigger the door opener or the light (up to 40V, max 2.5A).

If your intercom is not a TCS or Koch one but operates on a 2-wire bus (14-24V) it might be possible to implement other protocols as well.

You could also monitor the voltage level on older intercoms (14-24V) by replacing the tcs_intercom component with a template Binary Sensor combined with ADC and trigger specific actions based on it.

<!--
## 📦 Interested in buying one?
I still have some PCBs left. They are fully assembled and tested and come with ESPHome pre-Installed for direct integration and adoption into Home Assistant.
Feel free to contact me on [Discord](https://discord.gg/MMT4bxhQ68) or by [E-Mail](mailto:[email protected]?subject=Doorman).
Feel free to contact me on [Discord](https://discord.gg/t2d34dvmBf), [GitHub Issues](https://github.com/AzonInc/Doorman/issues) or by [E-Mail](mailto:[email protected]?subject=Doorman).
-->

## 📫 Have a question? Ran into a problem?

I'm happy to answer your questions on [Discord](https://discord.gg/MMT4bxhQ68) or [GitHub Issues](https://github.com/AzonInc/Doorman/issues).
I'm happy to answer your questions on [Discord](https://discord.gg/t2d34dvmBf) or [GitHub Issues](https://github.com/AzonInc/Doorman/issues).

## 🚩 Repository Structure

At the root of the repository you will find these directories:

- `pcb`: KiCad schematic and PCB design files
- `firmware`: ESPHome configuration files
- `enclosure`: Enclosure STL Files

## 🤖 Features

- Powered by ESP32-S3
- USB-C port for easy flashing (and because USB-C is cool 😎)
- It's super small (37.2mm x 35mm) and fits almost everywhere
- It's super small (37mm x 37mm) and fits almost everywhere
- Configurable WS2812B RGB LED to indicate specific events
- 2 additional GPIO pins for easy expansion with your own sensors and devices
- External Button Connector
- 2 additional GPIO via Screw Terminal for easy expansion with your own sensors and devices
- 1 Relay via Screw Terminal to switch up to 40V (max. 2.5A) for oldschool intercom systems
- 1 External Button via Screw Terminal (G + BTN)
- Bridge Rectifier on the Bus Input to correct wire polarity
- TCS Bus Communication (e.g. Open the front door, Detect Doorbell)
- You can optionally use your Doorman as a Nuki Bridge replacement
- You can optionally use your Doorman as a Nuki Bridge (incompatible with Nuki App, Bluetooth only)


## 🚀 Automation

Expand All @@ -52,7 +65,7 @@ You can find an Example in the [Firmware Examples](https://github.com/AzonInc/Do
## ✔️ Compatibility

### Hardware
If your TCS Intercom got a, b and P labeled Screw Terminals it's likely compatible.
If your TCS or Koch Intercom got a, b and P labeled Screw Terminals and is operating on 24V DC it's likely compatible.

### Firmware
You can use Doorman S3 with your prefered Firmware.\
Expand All @@ -67,69 +80,75 @@ This Configuration inherits everything from the Stock Firmware and adds a Nuki B
You need to adjust a few things to make it work with Doorman S3.

## ⚡ Wiring
>⚠️ **DO NOT USE THE +24V P-LINE AND USB-C AT THE SAME TIME**
If your Intercom is connected in 2-wire mode you need to use a USB-C Power Supply as the Bus Voltage is not sufficient to power your Doorman while sending commands. If it is connected in 3-wire mode you should be able to use the P-Line to power Doorman.
If your Intercom is connected in 2-wire mode and you dont have a separate 24V P-Line you need to use an external Power Supply via USB-C or P (+5V to +24V) and B (Ground) Screw Terminal.\
If it is connected in 3-wire mode you should be able to use the P-Line to power your Doorman in most cases.

>⚠️ **THERE IS A CATCH**\
> The Power Supply of your Intercom **must have** a minimum output of **100-150mA**!\
> Otherwise your Doorman is gonna drain all the power.\
> In the worst case you could even cause severe damage.\
> **Please power your Doorman with a USB-C Power Supply if your Intercom provides less than 100mA.**
### Intercom Screw Terminal Explanation:
- **a** is usually the Bus line (+24V)
- **b** is usually GND
- **P** is the +24V line in 3-wire mode or just the apartment bell button in 2-wire mode

> ✅ On some installations the a and b wires are twisted but it doesn't matter because Doorman has an integrated bridge rectifier to fix that for you.
### Wire Explanation:
- **a** is usually the Bus line (+24V, but not recommended as power supply)
- **b** is GND
- **P** is the +24V line in 3-wire mode or just the apartment bell button in 2-wire mode

You have to make sure which of the **a**- and **b**-Terminals is the 24V+ Bus one because the Intercom has a rectifier bridge which handles twisted wiring but the **Doorman S3 Board doesn't have one**!
>⚠️ **BE AWARE**\
> The minimum output current of the intercom power supply **must be 60mA** in order to achieve a stable operation!\
> However it is possible that some other devices using the 24V-wire are taking too much current so it's not sufficient to power Doorman anymore.\
> A best case scenario would be that you can use the P-wire with 60mA. That doesn't work for everyone tho.\
>
> **Please power your Doorman with an external Power Supply (USB-C or Screw Terminal) if your Intercom provides less than 60mA or whenever you notice an unstable operation.**

### Steps:
#### 2-Wire Mode
1. Open the wall-mounted phone in your flat
2. Check which of the a and b Terminals is Ground and which is +24V Bus
3. Connect the 24V Bus Line to the A Terminal of your Doorman
3. Connect the Ground Line to the B Terminal of your Doorman
4. Connect an external Power Supply via USB-C Port or P (+5V to +24V) and B (Ground) Screw Terminals of your Doorman
>⚠️ **DO NOT USE THE +24V P-LINE AND USB-C AT THE SAME TIME**
#### 2-Wire Mode (with external Power Supply)
1. Open the Intercom enclosure
2. Connect the a-wire (24V Bus) to the a-Terminal of your Doorman
3. Connect the b-wire (Ground) to the b-Terminal of your Doorman
4. Connect an external Power Supply via USB-C Port or P (+5V to +24V) and b (Ground) Screw Terminals of your Doorman

#### 3-Wire Mode with sufficient Intercom Power Supply (min. 100mA)
1. Open the wall-mounted phone in your flat
2. Check which of the a and b Terminals is Ground and which is +24V Bus
3. Connect the 24V Bus Line to the A Terminal of your Doorman
3. Connect the Ground Line to the B Terminal of your Doorman
4. Connect the P Line to the P Terminal of your Doorman
#### 3-Wire Mode (with sufficient Intercom Power Supply - min. 60mA)
1. Open the Intercom enclosure
2. Connect the a-wire (24V Bus) to the a-Terminal of your Doorman
3. Connect the b-wire (Ground) to the b-Terminal of your Doorman
4. Connect the P-wire (+24V) to the P-Terminal of your Doorman

## 📟 How to obtain Command Codes from the TCS Bus
## 📟 Obtaining Command Codes from the Bus

Depending on the Firmware you are going to use there are different methods to obtain Command Codes.
Depending on the Firmware you are using, there are different methods to obtain Command Codes.

- **[ESPHome](https://github.com/AzonInc/doorman/tree/master/firmware)**\
If you use the ESPHome Doorman Firmware from this Repository, every received Command Code is logged in the ESPHome Console and also published as an Home Assistant Event. Besides that there is a "Last Bus Command" Text Sensor (disabled by default) which also shows the last Bus Command.

- **[Doorman by peteh](https://github.com/peteh/doorman)**\
You can find a detailed explanation in the repository. It's kinda similar.

## 🛠️ Manufacturing

TODO

## 🖨️ Enclosure

Depending on your needs you can print your own Doorman Enclosure.\
Just use the STL files provided [here](https://github.com/AzonInc/Doorman/tree/master/enclosure).\
<img src=".github/images/enclosure.png" alt="Doorman S3" height="275">

## ⚠️ Disclaimer

Please DO NOT use the +24V P-Line if the Power Supply is not powerful enough.\
Check your Power Supply first because there are some Power Supply Models which supply 60mA (Peak 100mA) only and that's definitely not enough for an ESP32.

You could cause the Power Supply to overheat and end up damaging the whole system!\
Please check everything first.
Check your Power Supply first as there are some Power Supply Models which supply less than 60mA on 24V and that won't be enough to power the ESP32.

## 🙌 Contributing
If you would like to contribute, please feel free to open a Pull Request.

## 📜 Credits

Doorman is heavily built on the code and the information of the following projects.\
Doorman is heavily built on the code and the information of the following projects and people.\
This project would not have been possible without all of them. ❤️

**[TCSIntercomArduino](https://github.com/atc1441/TCSintercomArduino)**\
Different Methods to read from and write to the TCS Bus.\
Feel free to watch the [Reverse Engineering Video](https://www.youtube.com/watch?v=xFLoauqj9yA&t=11s) if you're interested.
Feel free to watch the [Reverse Engineering Video](https://www.youtube.com/watch?v=xFLoauqj9yA) if you're interested.

**[tcs-monitor](https://github.com/Syralist/tcs-monitor)**\
An mqtt monitor for listening to the TCS Bus.\
Expand All @@ -140,4 +159,7 @@ A lot of this Doorman project is based on peteh's one.\
The main goal is to provide a proper PCB for his Doorman Project.

**[ESPHome_nuki_lock](https://github.com/uriyacovy/ESPHome_nuki_lock)**\
This module builds an ESPHome lock platform for Nuki Smartlock (nuki_lock).
This module builds an ESPHome lock platform for Nuki Smartlock (nuki_lock).

**[AStrehlau](https://github.com/AStrehlau)**\
Thanks a lot for your time, patience and every single valuable advice that made this Project better, smaller and more affordable.
Binary file removed docs/Doorman-S3-Title.png
Binary file not shown.
Binary file added enclosure/Bottom.stl
Binary file not shown.
5 changes: 5 additions & 0 deletions enclosure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Enclosure Files

This directory contains all the STL Files to be able to print your own enclosure.

<img src="../.github/images/enclosure.png" alt="Doorman S3" height="275">
Binary file added enclosure/Top.stl
Binary file not shown.
4 changes: 2 additions & 2 deletions firmware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This directory contains [ESPHome](https://esphome.io) config files for the Doorm

It is organized like so:

- `base.yaml`: The base essential configuration, which contains components for reading from and writing to the TCS Bus
- `base.yaml`: The base essential configuration, which contains components for reading from and writing to the TC/TCS Bus
- `doorman-stock.yaml`: Inherits everything from `base.yaml`.
- `doorman-nuki-bridge.yaml`: Inherits everything from `base.yaml` and adds the Nuki Bridge Components

If you just want to get started with Doorman you should take a look at `stock.example.yaml` in the examples directory.\
For further documentation of the tcs_intercom component look [here](https://github.com/AzonInc/Doorman/tree/master/components).
For further documentation of the tcs_intercom component [check the docs](https://github.com/AzonInc/ESPHome-TCS-Intercom).
5 changes: 2 additions & 3 deletions firmware/addons/nuki-bridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ binary_sensor:
number: GPIO0
inverted: True
internal: True
id: boot_button_internal
id: doorman_boot_button
on_multi_click:
- timing:
- ON for at least 5s
Expand All @@ -27,5 +27,4 @@ binary_sensor:
- lambda: |
ESP_LOGI("pairing", "Pairing Mode: TODO");
else:
- lambda: |
ESP_LOGE("pairing", "Not paired yet - maybe automatically enable pairing mode on boot");
- nuki_lock.set_pairing_mode: true
64 changes: 59 additions & 5 deletions firmware/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,46 @@ esphome:
name: ${name}
friendly_name: ${friendly_name}
name_add_mac_suffix: true

min_version: "2024.3.0"

project:
name: "AzonInc.Doorman S3"
version: "1.0.0"
version: "1.2.0"

on_boot:
then:
- light.turn_on:
id: doorman_rgb_status_led
effect: slow_pulse
red: 100%
green: 60%
blue: 0%
- wait_until:
condition:
wifi.connected:
- light.turn_on:
id: doorman_rgb_status_led
effect: pulse
red: 0%
green: 100%
blue: 0%
- wait_until:
condition:
api.connected:
- light.turn_on:
id: doorman_rgb_status_led
effect: none
red: 0%
green: 100%
blue: 0%
- delay: 1s
- script.execute: reset_led

# Board Setup
esp32:
board: esp32-s3-devkitc-1
flash_size: 16MB
flash_size: 8MB

# Configurable Options
substitutions:
Expand Down Expand Up @@ -128,13 +159,30 @@ light:
rmt_channel: 0
chipset: ws2812
gamma_correct: 1
default_transition_length: 500ms
default_transition_length: 0ms
color_correct: [80%, 80%, 80%]
effects:
- pulse:
#update_interval: 2s
name: pulse
transition_length: 250ms
update_interval: 250ms
- pulse:
name: slow_pulse
transition_length: 1s
update_interval: 2s

binary_sensor:
- platform: status
id: api_connection
filters:
- delayed_on: 1s
on_press:
- lambda: |
ESP_LOGD("api", "API Connected");
on_release:
- lambda: |
ESP_LOGD("api", "API Disconnected");
# Preconfigured Party Mode Action (Internal)
- platform: tcs_intercom
id: doorman_entrance_doorbell
Expand All @@ -157,4 +205,10 @@ binary_sensor:

- platform: tcs_intercom
name: "Apartment Doorbell"
command: ${apartment_doorbell_command}
command: ${apartment_doorbell_command}

script:
- id: reset_led
then:
# TODO: Restore specific state conditionally
- light.turn_off: doorman_rgb_status_led
5 changes: 4 additions & 1 deletion firmware/doorman-nuki-bridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ lock:
id: doorman_rgb_status_led
red: 100%
green: 0%
blue: 100%
blue: 100%
- delay: 3s
- light.turn_off:
id: doorman_rgb_status_led
7 changes: 1 addition & 6 deletions firmware/doorman-stock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,4 @@ dashboard_import:
import_full_config: false

packages:
device_base: !include base.yaml

# Moved here from base.yaml
# It's incompatible with the Nuki Bridge Component
esp32_improv:
authorizer: false
device_base: !include base.yaml
4 changes: 4 additions & 0 deletions pcb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# PCB KiCad Files

This directory contains everything PCB related.
You can also find an interactive BOM [here](https://github.com/AzonInc/Doorman/tree/master/pcb/bom).
Loading

0 comments on commit 72d1bf4

Please sign in to comment.