peteh / doorman

ESP based mqtt bridge for TCS and Koch door control systems
GNU General Public License v3.0
25 stars 4 forks source link

Integration for the E terminal line #6

Closed NonProgrammerCharacter closed 8 months ago

NonProgrammerCharacter commented 8 months ago

Help Wanted (as I can not add labels)

Is it possible to integrate the E line into the microcontroller, which is used for the bell button in front of the apartment door, so I can work with it in Homeassistant?

I would only want it to be the same like the the bell button on the front door, but I guess this one does not run over the bus, so it would only need to register if there is a signal or not which I then would use to create a signal in Homeassistant I can automate with.

This is my first little project and pretty much my first time wiring, soldering and programming stuff like this so it´s a little to much for me. Im only asking for help with the wiring, the programming I would probably manage by myself somehow.

peteh commented 8 months ago

You could wire a relay to one of the unused output pins to close the same contacts the button would close.

I don't know what you mean by e-line. Can you provide some pictures of model number?

NonProgrammerCharacter commented 8 months ago

I dont understand what you mean with wire a relay, wouldnt I just have to look what voltage runs through the contact when the button is pressen and use an appropriate resistor to reduce it to a ESP usable level and wire it to an input (as far as I understood this)? I only want to see on the ESP if the button is pressed as I would then programm Homeassistant to send a signal to my phone and maybe open the apartment door (with a Nuki Smart Lock or something).

I mean the third bell wire, A, B, E and P, E is used for the bell button directly infront of the apartment door.

This one is not the correct modell but the same contacts, my configuration is with only 3 wires (rightmost graphic) with only A, B, E. (it´s in german, should be a problem as the text is irrelevant for this) https://www.tcsag.de/fileadmin/user_upload/TCS_DE/Metanavigation/Downloads/ARCHIV/Innenstationen/PI_TTS2.pdf

Edit: Im using a 24V transformer as powersupply as my fuse box is directly next to my bell and no power outlett (and my bell installation doesnt have an P wire for power).

peteh commented 8 months ago

Ah now I think I get it. I thought we are talking to simulate a press on the "Etagenruftaster".

Measure what's the voltage. I guess it's around 24V when it's pressed as it connects to the P line when pressed.

Thus you should be able to use the same voltage divider as used for bus reading.

When you look at the wiring: https://github.com/peteh/doorman image Check the green cable going from Bus 24V through the resistors and into the blue cable.

That's a voltage divider that reduces the 24V down to the ESP-readable range.

Wire the same setup with identical two resistors to another input (maybe measure before to get a 0V and ~ 3.3V signal when pressing the switch).

Then you can either read the state with digitalRead in every main loop cycle or add another interrupt routine for the new input.

You probably have to debounce it as well.

peteh commented 8 months ago

@NonProgrammerCharacter

I created a branch and PR with the necessary changes: feature/etr

See the PR for details: #7

I cannot test it though. However, if you put a voltage divider on D7 it should work.

PS: are you sure the system puts no code on the bus when the floor button is pressed? If it does I can also create an entity that just reacts on a code which would be less wiring.

NonProgrammerCharacter commented 8 months ago

Based on your drawing the new voltage divider should connect to 5V on the D1-mini, I guess thats not supposed to be like that so I connected it to GND (I couldnt find a better looking software which had the parts needed, which programm did you use for your graphic?). image

I think you took the wrong input ID, should be D0 not D7 as that is already in use. (its wrong in the code also)

I checked now and there is no signal on the bus when pressing the door bell infront of the door.

Im not yet using the new branch, wanted to test the "base"-functionality befor adding new stuff.

Havent checked the voltage on "E" yet.

peteh commented 8 months ago

Based on your drawing the new voltage divider should connect to 5V on the D1-mini, I guess thats not supposed to be like that so I connected it to GND (I couldnt find a better looking software which had the parts needed, which programm did you use for your graphic?).

You are right, my drawing was a bit unprecise. Voltage divider should go to GND, not to 5V. I used fritzing. It's not great, not terrible. The project is in the doc folder (wiring.ffz).

What are you using as a tool to draw the electric plan?

I think you took the wrong input ID, should be D0 not D7 as that is already in use. (its wrong in the code also)

I deliberately used D7 because D0 is used for boot and wakeup in the d1 mini which might cause issues when starting the controller. D7 is used in the wiring drawing but actually no code is using it yet. So I thought that I might remove the connectors on it in a future iteration as I haven't found a use case.

If you don't want to use D7, I'd recommend D1 or D2. Let me know which, then I can also update the code.

I checked now and there is no signal on the bus when pressing the door bell infront of the door.

By "the door bell infront" it's the ETR Etagentaster?

Im not yet using the new branch, wanted to test the "base"-functionality befor adding new stuff.

Havent checked the voltage on "E" yet.

Before you wire, check if you see a voltage change of 24V when pressing the button. Then we know that we could at least expect it to work.

NonProgrammerCharacter commented 8 months ago

You are right, my drawing was a bit unprecise. Voltage divider should go to GND, not to 5V. I used fritzing. It's not great, not terrible. The project is in the doc folder (wiring.ffz).

Ah fritzing, I stumbled upon that but could not test it as it was pay-to-download. I used TinyCAD, not that happy with it as it too has limited parts and it does not look good enough to warrant the limited parts, the esp8266 is imported from here. "https://forum.arduino.cc/t/how-to-make-a-schematic-you-can-post/675103/10"

I deliberately used D7 because D0 is used for boot and wakeup in the d1 mini which might cause issues when starting the controller. D7 is used in the wiring drawing but actually no code is using it yet. So I thought that I might remove the connectors on it in a future iteration as I haven't found a use case.

If you don't want to use D7, I'd recommend D1 or D2. Let me know which, then I can also update the code.

Ahh, thats fine then, I too didn´t use it so D7 is ok

By "the door bell infront" it's the ETR Etagentaster?

Yes. Apartment bell button is probaly the better term.

Before you wire, check if you see a voltage change of 24V when pressing the button. Then we know that we could at least expect it to work.

I will try, kinda hard with my tools as I dont have 4 hands and my voltage tester doesnt have clamps. But I guess it does. I only have three lines in my bell, A, B and E, so it should go to A. Will test when possible.

peteh commented 8 months ago

Fritzing is not pay to download. Just their website makes it seem to be so. \ You can download it from their github releases page: https://github.com/fritzing/fritzing-app/releases

I'm still confused if you actually use the ETR or the actual door bell button.

When I press the door bell at my apartment door I get a code on the bus and the building does not have a separate "Etagenruftaster"

NonProgrammerCharacter commented 8 months ago

Ah well good to know with fritzing, but it kinda grew on me to have more technical and less good looking graphic.

I use the ETR, and it propably had to do with the wifi problems but now I have a code for it, so no extra wiring needed. Most likely I just didnt see the LED flashing and together with the code and my missing P line I went straight to "just a button".

Well thanks for the help on this issue and sorry for all the work only for it to be a false alarm.

peteh commented 8 months ago

No worries, I think I managed to improve the wifi code a bit and will continue to do so. At least it should not reset randomly by blocking through wifi disconnect.

I'll remove the integration branch as the feature is not really needed.