Skip to content

Commit

Permalink
Merge pull request #8 from AzonInc/dev
Browse files Browse the repository at this point in the history
Update Readme and FW
  • Loading branch information
AzonInc authored Jun 6, 2024
2 parents 36b0fe7 + fb3cb53 commit 9f92bac
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 62 deletions.
Binary file added .github/images/dashboard.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 modified .github/images/wiring_2wire_power_screwterminal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 38 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ You could also monitor the voltage level on older intercoms (14-24V) by replacin
Thanks a lot to [PCBWay](https://pcbway.com) for sponsoring this Project.
Scroll down to "Manufacturing" to read more.

** Please also take a look at the Getting started section for first-use instructions.**
**Please also take a look at the Getting started section for first-use instructions.**

## 📦 Interested in buying one?

Feel free to contact me on [Discord](https://discord.gg/t2d34dvmBf), [GitHub Issues](https://github.com/AzonInc/Doorman/issues) or by [E-Mail](mailto:flo@azon.ai?subject=Doorman).

I offer you a fully assembled and tested Doorman-S3 for **26€** which comes with ESPHome pre-Installed for direct integration and adoption into Home Assistant.
I offer you a fully assembled and tested Doorman-S3 which comes with ESPHome pre-installed for direct integration and adoption into Home Assistant.

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

Expand Down Expand Up @@ -81,7 +81,7 @@ This is the prefered Firmware as it works out of the Box with the Doorman S3 Fir
This Configuration inherits everything from the Stock Firmware and adds a Nuki Bridge Component via BLE on top.

- **[Doorman by peteh](https://github.com/peteh/doorman)**\
You need to adjust a few things to make it work with Doorman S3.
You need to adjust a few things (GPIO, Board Type, Flash Size) to make it work with Doorman S3.

## ⚡ Wiring
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 +30V) and B (Ground) Screw Terminal.\
Expand All @@ -95,7 +95,6 @@ If it is connected in 3-wire mode you should be able to use the P-Line to power

> [!NOTE]
> On some installations the a and b wires are twisted but it doesn't matter because Doorman has an integrated bridge rectifier to handles that for you.
<!--> However if you want to power your Doorman in two-wire-mode using the bus wire it's only possible with hardware revision >= V1.4.-->
> [!WARNING]
> The minimum output current of the intercom power supply **must be 60mA** in order to achieve a stable operation!\
Expand All @@ -111,14 +110,10 @@ If it is connected in 3-wire mode you should be able to use the P-Line to power
#### 2-Wire Mode (with external Power Supply)
<img src=".github/images/wiring_2wire_power_screwterminal.png" alt="2 Wire Installation" height="275">

> [!IMPORTANT]
> Please check the polarity of a- and b-wires as the bridge rectifier can only handle two wires but not three.
> Be sure to connect the ground wire of your external power supply to the same Screw Terminal as the ground wire that comes from your intercom.
1. Open the Intercom enclosure
2. Connect the a-wire (24V Bus) to one of the TCS:BUS-Terminals of your Doorman
3. Connect the b-wire (Ground) to the other TCS:BUS-Terminal of your Doorman
4. Connect an external Power Supply via USB-C Port or P (+5V to +30V) and b (Ground) Screw Terminals of your Doorman
4. Connect an external Power Supply via P (+5V to +30V) and G (Ground) Screw Terminals of your Doorman

#### 2-Wire Mode (with external Power Supply via USB-C)
<img src=".github/images/wiring_2wire_power_usb_c.png" alt="2 Wire Installation" height="275">
Expand All @@ -145,17 +140,45 @@ If it is connected in 3-wire mode you should be able to use the P-Line to power
1. Open the Intercom enclosure
2. Connect the a-wire (24V Bus) to one of the TCS:BUS-Terminals of your Doorman
3. Connect the b-wire (Ground) to the other TCS:BUS-Terminal of your Doorman
4. Connect the P-wire (+24V) to the P-Terminal of your Doorman
4. Connect the P-wire (+24V) to the P-Terminal of your Doorman

## 🚀 Getting started

When you power on your Doorman-S3 for the first time it opens an Access Point called "Doorman-S3 Setup".
The AP Password is "open-sesame".
You can setup your WiFi credentials there or also via Improv Serial + Improv Bluetooth.

Thanks to mDNS Support Homeassistant will find your Doorman out of the box.
After adding your Doorman to Homeassistant you need to enable the Last Bus Command Sensor to capture the Bus commands of your intercom.

When you obtained all neccessary commands you can adopt the device in your ESPHome Dashboard and flash the `stock.example.yaml` firmware with adjusted command values.

After flashing the example you should have the following entities (if you enable all of them):

<img src=".github/images/dashboard.png" alt="Homeassistant Device Dashboard" height="500">

That's basically everything you need to do. Happy automating!

## 📟 Obtaining Command Codes from the Bus

Depending on the Firmware you are using, there are different methods to obtain Command Codes.
Every received Command Code is logged in the ESPHome Console (Debug Log-Level) and also published as an Home Assistant Event.
Besides that there is a "Last Bus Command" Text Sensor (disabled by default) which shows the last Bus Command.
If you use the command in your yaml config file you need to prepend 0x in order to interpret is as a hexadecimal number.

- **[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.
## 🖲️ GPIO

- **[Doorman by peteh](https://github.com/peteh/doorman)**\
You can find a detailed explanation in the repository. It's kinda similar.
Doorman-S3 needs some GPIO for a specific purpose and offers free GPIO for your sensors.

| GPIO | Purpose |
| :----- | :-----|
| GPIO01 | Red Status LED |
| GPIO02 | WS2812B RGB Status LED |
| GPIO08 | TCS Bus TX - Shorts the Bus to Ground |
| GPIO09 | TCS Bus RX - Reading Bus Data / ADC input (onboard Voltage Divider - 1M+160K) |
| GPIO40 | Free I/O |
| GPIO41 | External Button (10K onboard resistor) |
| GPIO42 | Relay for analog door opener |
| GPIO48 | Free I/O |

## 🛠️ Manufacturing

Expand All @@ -178,19 +201,6 @@ In case you want an enclosure you can print your own one.\
Just use the STL files provided [here](https://github.com/AzonInc/Doorman/tree/master/enclosure) and you'll be good to go.\
<img src=".github/images/enclosure.png" alt="Doorman S3" height="275">

## 🚀 Getting started

When you power on your Doorman-S3 for the first time it opens an Access Point called "Doorman-S3 Setup".
The AP Password is "open-sesame".
You can setup your WiFi credentials there or also via Improv Serial + Improv Bluetooth.

Thanks to mDNS Support Homeassistant will find your Doorman out of the box.
After adding your Doorman to Homeassistant you need to enable the Last Bus Command Sensor to capture the Bus commands of your intercom.

When you obtained all neccessary commands you can adopt the device in your ESPHome Dashboard and flash the `stock.example.yaml` firmware with adjusted command values.

That's basically everything you need to do. Happy automating!

## ⚠️ Disclaimer

Please DO NOT use the +24V P-Line if the Power Supply is not powerful enough.\
Expand Down
21 changes: 21 additions & 0 deletions firmware/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ switch:
turn_off_action:
- light.turn_off: doorman_rgb_status_led

# Preconfigured Relay Switch
- platform: gpio
name: Relay
icon: mdi:electric-switch
id: doorman_relay
restore_mode: RESTORE_DEFAULT_OFF
disabled_by_default: true
pin: GPIO42

button:
# System Actions
- platform: restart
Expand Down Expand Up @@ -215,6 +224,18 @@ binary_sensor:
name: "Apartment Doorbell"
command: ${apartment_doorbell_command}

- platform: gpio
id: doorman_external_button
name: External Button
icon: mdi:gesture-tap
disabled_by_default: true
pin:
number: GPIO41
mode:
pulldown: true
input: true
inverted: true

script:
- id: reset_led
then:
Expand Down
5 changes: 3 additions & 2 deletions firmware/examples/nuki-bridge.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
# - Apartment Doorbell Sensor
# - Door Opener Button
# - Party Mode Switch (Disabled by default)
# - Bus Command (Disabled by default)

# - Last Bus Command (Disabled by default)
# - External Button (Disabled by default)
# - Relay (Disabled by default)

# You can change a few options here.
# There are more substitutions available for testing - just take a look at Github.
Expand Down
151 changes: 151 additions & 0 deletions firmware/examples/stock-doorbell-pattern-events.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Doorman S3 Stock Firmware
# Example Configuration to use Events & Doorbell Button Patterns


# The following Entities are already preconfigured:
# - Entrance Doorbell Sensor
# - Apartment Doorbell Sensor
# - Door Opener Button
# - Party Mode Switch (Disabled by default)
# - Last Bus Command (Disabled by default)
# - External Button (Disabled by default)
# - Relay (Disabled by default)


# You can change a few options here.
# There are more substitutions available for testing - just take a look at Github.
substitutions:
name: "doorman-s3"
friendly_name: "Doorman S3"

# TCS Commands
# Make sure to change all commands to yours in order to use the preconfigured Entities
apartment_doorbell_command: "0x00000000"
entrance_doorbell_command: "0x00000000"
entrance_door_opener_command: "0x1100"

# Optional Settings
# log_level: "ERROR"
# party_mode_door_opener_delay: "70ms"


# Import Doorman Stock Firmware Config
packages:
AzonInc.Doorman_S3: github://AzonInc/doorman/firmware/doorman-stock.yaml@master


esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}

api:
encryption:
key: "REPLACEME"

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password



# Define some events here
event:
- platform: template
id: doorbell_pattern
name: "Doorbell Pattern"
device_class: DOORBELL
event_types:
- "apartment_single"
- "apartment_double"
- "apartment_triple"
- "entrance_single"
- "entrance_double"
- "entrance_triple"


# Homeassistant Automation Trigger Example
# Change the Event Entity ID to your Doorman S3 Doorbell Pattern Event Entity

#trigger:
# - platform: state
# entity_id:
# - event.doorman_s3_doorbell_pattern
# attribute: event_type
# to: entrance_triple



# Define Button Patterns here that trigger the events above
binary_sensor:
- platform: tcs_intercom
command: ${entrance_doorbell_command}
auto_off: 0.5s
internal: true
# Single press
on_press:
- event.trigger:
id: doorbell_pattern
event_type: entrance_single
on_multi_click:
# Double press
- timing:
- ON for at most 1s
- OFF for at most 1s

- ON for at most 1s
- OFF for at least 0.2s
then:
- event.trigger:
id: doorbell_pattern
event_type: entrance_double
# Triple press
- timing:
- ON for at most 1s
- OFF for at most 1s

- ON for at most 1s
- OFF for at most 1s

- ON for at most 1s
- OFF for at least 0.2s
then:
- event.trigger:
id: doorbell_pattern
event_type: entrance_triple

- platform: tcs_intercom
command: ${apartment_doorbell_command}
auto_off: 0.5s
internal: true
# Single press
on_press:
- event.trigger:
id: doorbell_pattern
event_type: apartment_single
on_multi_click:
# Double press
- timing:
- ON for at most 1s
- OFF for at most 1s

- ON for at most 1s
- OFF for at least 0.2s
then:
- event.trigger:
id: doorbell_pattern
event_type: apartment_double
# Triple press
- timing:
- ON for at most 1s
- OFF for at most 1s

- ON for at most 1s
- OFF for at most 1s

- ON for at most 1s
- OFF for at least 0.2s
then:
- event.trigger:
id: doorbell_pattern
event_type: apartment_triple
30 changes: 4 additions & 26 deletions firmware/examples/stock.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
# - Apartment Doorbell Sensor
# - Door Opener Button
# - Party Mode Switch (Disabled by default)
# - Bus Command (Disabled by default)
# - Last Bus Command (Disabled by default)
# - External Button (Disabled by default)
# - Relay (Disabled by default)


# You can change a few options here.
Expand Down Expand Up @@ -58,37 +60,13 @@ wifi:




# Doorbell pattern detection
# If you are interested in detecting specific doorbell patterns you could use this example as a base:

#binary_sensor:
# - platform: tcs_intercom
# id: entrance_doorbell_pattern
# command: "0x3b8f9a00"
# auto_off: 0.5s
# internal: true
# on_multi_click:
# - timing:
# - ON for at most 1s
# - OFF for at most 1s
# - ON for 0.5s to 1s
# - OFF for at most 1s
# - ON for 0.5s to 1s
# - OFF for at least 0.2s
# then:
# - logger.log: "Doorbell Pattern (Triple Press) detected!"




# Controlling the internal RGB LED
# If you want to control the onboard RGB LED just use the Light ID: doorman_rgb_status_led
# For example:

#button:
# - platform: template
# name: "Turn on Status RGB LED"
# name: "Turn on Status RGB LED to red"
# on_press:
# - light.turn_on:
# id: doorman_rgb_status_led
Expand Down
Loading

0 comments on commit 9f92bac

Please sign in to comment.