Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ABB-Welcome / Busch-Welcome Door Intercom Protocol #4689

Merged
merged 26 commits into from Apr 9, 2024

Conversation

Mat931
Copy link
Contributor

@Mat931 Mat931 commented Apr 15, 2023

What does this implement/fix?

This protocol allows monitoring your doorbell, opening your front door etc. with your ABB-Welcome / Busch-Welcome door intercom system. It requires a custom circuit to send and receive messages on the two-wire bus.

Transmitter documentation
Receiver documentation

Requires #4642

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#2844

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040

Example entry for config.yaml:

# Example config.yaml
esp32:
  board: esp32doit-devkit-v1
  framework:
    type: arduino

esphome:
  name: abb-welcome-demo
  friendly_name: "ABB Welcome Demo"
  on_boot:
    - lock.template.publish:
        id: main_door
        state: LOCKED
    - binary_sensor.template.publish:
        id: doorbell_indoor
        state: OFF
    - binary_sensor.template.publish:
        id: doorbell_outdoor
        state: OFF

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

logger:

api:
  encryption:
    key: !secret api_encryption_key

ota:
  password: !secret ota_password

remote_transmitter:
  pin: GPIO26
  carrier_duty_percent: 100%

remote_receiver:
  pin:
    number: GPIO25
    mode:
      input: True
  dump: [abbwelcome, raw]
  filter: 8us
  tolerance: 26us # requires https://github.com/esphome/esphome/pull/4642
  idle: 1500us
  buffer_size: 15kB
  memory_blocks: 6
  clock_divider: 160 # requires https://github.com/esphome/esphome/pull/4642
  on_abbwelcome:
    then:
      - if:
          condition:
            and:
              - lambda: 'return (x.get_message_type() == 0x8d);' # unlock door response
              - lambda: 'return (x.get_source_address() == 0x4001);' # door address
          then:
            - lock.template.publish:
                id: main_door
                state: UNLOCKING
            - delay: 3s
            - lock.template.publish:
                id: main_door
                state: LOCKED
      - if:
          condition:
            and:
              - lambda: 'return (x.get_message_type() == 0x11);' # doorbell indoor
              - lambda: 'return (x.get_source_address() == 0x1001);' # your indoor station address
          then:
            - binary_sensor.template.publish:
                id: doorbell_indoor
                state: ON
            - binary_sensor.template.publish:
                id: doorbell_indoor
                state: OFF
      - if:
          condition:
            and:
              - lambda: 'return (x.get_message_type() == 0x01);' # doorbell outdoor
              - lambda: 'return (x.get_source_address() == 0x2001);' # outdoor station address
              - lambda: 'return (x.get_destination_address() == 0x1001);' # your indoor station address
          then:
            - binary_sensor.template.publish:
                id: doorbell_outdoor
                state: ON
            - binary_sensor.template.publish:
                id: doorbell_outdoor
                state: OFF

binary_sensor:
  - platform: template
    name: Doorbell indoor
    id: doorbell_indoor
    icon: mdi:bell
    filters:
      - delayed_off: 1s

  - platform: template
    name: Doorbell outdoor
    id: doorbell_outdoor
    icon: mdi:bell
    filters:
      - delayed_off: 1s

lock:
  - platform: template
    name: "Main Door"
    id: main_door
    on_unlock:
      - then:
          - lock.template.publish:
              id: main_door
              state: LOCKED
    lock_action:
      - then:
          - lock.template.publish:
              id: main_door
              state: LOCKED
    unlock_action:
      - then:
          - remote_transmitter.transmit_abbwelcome:
              source_address: 0x1001 # your indoor station address
              destination_address: 0x4001 # door address
              message_type: 0x0d # unlock door
              data: [0xab, 0xcd, 0xef]  # door opener secret code, see receiver dump

button:
  - platform: template
    name: "Stop Doorbell"
    on_press:
      - remote_transmitter.transmit_abbwelcome:
          source_address: 0x1001 # your indoor station address
          destination_address: 0x2001 # outdoor station address
          message_type: 0x02 # end call (stops your doorbell ringtone)
          data: [0x00]

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@Mat931
Copy link
Contributor Author

Mat931 commented Apr 15, 2023

Circuit

circuit

@nagyrobi nagyrobi added the not-stale Won't go stale label Jul 6, 2023
@dylanmazurek
Copy link

I love this functionality! I've ordered all the parts to create the circuit and will be adding it to my intercom as soon as I build it. Question about the implementation, does it work in line with the intercom screen or does it replace the screen?

@Mat931
Copy link
Contributor Author

Mat931 commented Jul 30, 2023

@dylanmazurek You can add it in parallel with the intercom screen or replace it.

@bilak
Copy link

bilak commented Dec 14, 2023

Hey, I'm doing research how to make my ABB welcome little bit smarter and found this. Is there any chance that this will become a part of esphome? I didn't touched the esphome yet but if this is something that should work I'd give it a try.

Dumb question: is there any possibility to include also the sound when somebody speaks or even do some 2 way audio so it would be possible to create some integration with sound?

@Mat931
Copy link
Contributor Author

Mat931 commented Dec 14, 2023

@bilak Not sure if there are any plans to merge this into ESPHome at this point. You can still use it as an external component. With the circuit above you can only receive and send control messages, no audio or video. You can find more info in the comments here. For me personally this project is finished because I have all the functionality I need and I already ordered my custom PCBs with the circuit years ago. But feel free to investigate more. Good Luck!

@dylanmazurek
Copy link

Hey @Mat931 I'm looking into this again, is there any chance you have the circuit files you sent to get made? I haven't really worked with circuit design or fab so it would be awesome if you had yours lying around 😊

@Mat931
Copy link
Contributor Author

Mat931 commented Dec 21, 2023

@dylanmazurek Sure I still have the PCB files. Before I share them I want to clean up some errors and remove unused footprints. The PCB can be installed on top of a flush-mounted box on a wall. It has some touch buttons and LEDs so you can program it as a standalone door opener for example. The board can be powered from the ABB-Welcome bus and send/receive control messages. (no audio or video) You would still need to solder the components to the PCB. Most are 0603 and bigger but there are also some smaller ones. Do you think that works for you?

PCB images

abb-welcome-esphome

abb-welcome-esphome-back

@dylanmazurek
Copy link

Wow that would be amazing! I think what I would do is send the files and components required to a company that can do it for me (my soldering skills are very much lacking), I found one that's around the corner from me and hopefully they can help me out.

@Mat931
Copy link
Contributor Author

Mat931 commented Dec 24, 2023

@dylanmazurek I designed a new board that only has the minimum of required components to supply an ESP32 with power and send/receive messages. In theory you can order 2 of the fully assembled boards for under 50€ from JLC. (I haven't tried)
If you have Discord you can contact me there @Mat931 and we can discuss the details.
abb-welcome-esphome-simplified

@esphome esphome bot marked this pull request as draft January 18, 2024 08:44
@esphome
Copy link

esphome bot commented Jan 18, 2024

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Mat931 and others added 3 commits January 18, 2024 09:59
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Jan 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (045836c) 53.70% compared to head (306f6c9) 53.70%.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #4689   +/-   ##
=======================================
  Coverage   53.70%   53.70%           
=======================================
  Files          50       50           
  Lines        9389     9389           
  Branches     1651     1651           
=======================================
  Hits         5042     5042           
  Misses       4048     4048           
  Partials      299      299           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Mat931 Mat931 marked this pull request as ready for review January 18, 2024 10:49
@esphome esphome bot requested a review from jesserockz January 18, 2024 10:49
@jesserockz jesserockz merged commit 3b6e8fa into esphome:dev Apr 9, 2024
77 checks passed
This was referenced Apr 9, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2024
@Mat931 Mat931 deleted the abbwelcome_protocol branch April 22, 2024 21:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants