Hardware components | ||||||
![]() |
| × | 1 | |||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
![]() |
| × | 6 | |||
![]() |
| × | 4 | |||
Software apps and online services | ||||||
![]() |
| |||||
![]() |
|
The main door of my building is managed by a Fermax system and inside my apartment I have a Fermax Loft BW intercom.
Using a multimeter I search for the 18VDC and GND wires. As the NodeMCU lua module works with 5V I added a DC-DC step down converter.
The PCB where the buttons are is very basic and I just followed the wires of the key and video controls to find out which ones I should "press" virtually.
The virtual button requires GND to activate the output, since they are connected to the Fermax processor with a pull-up resistor.
Aiming the continuous work of the monitors buttons, I connected the KEY button to pin A- of the L293D Shield and the VIDEO button to pins B-. In the arduino code I forced both H-bridges (always activated) and set the output pins ENABLE A and ENABLE B.
This project is independent from Fermax. So, you should implement it carefully to not damage your intercom devices.
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
//NodeMCU Motor Shield I/O
#define KEY D1
#define VIDEO D2
#define OUTA D3
#define OUTB D4
//Wifi
const char* ssid = "----";
const char* wifi_password = "----";
IPAddress ip(192, 168, 1, 2);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
// MQTT
const char* mqtt_server = "----";
const char* mqtt_topic = "FermaxDoor";
const char* mqtt_username = "----";
const char* mqtt_password = "----";
const char* clientID = "Fermax";
WiFiClient wifiClient;
PubSubClient client(mqtt_server, 1883, wifiClient);
void ReceivedMessage(char* topic, byte* payload, unsigned int length) {
if ((char)payload[0] == '1') {
digitalWrite(OUTA, HIGH);
digitalWrite(OUTB, HIGH);
delay(10);
//"Press" video button to switch on monitor
digitalWrite(VIDEO, HIGH);
delay(2000);
digitalWrite(VIDEO, LOW);
delay(1000);
//"Press" key button to oppen the door
digitalWrite(KEY, HIGH);
delay(1000);
digitalWrite(KEY, LOW);
delay(1000);
//"Press" video button to switch off monitor
digitalWrite(VIDEO, HIGH);
delay(500);
digitalWrite(VIDEO, LOW);
delay(100);
digitalWrite(OUTA, LOW);
digitalWrite(OUTB, LOW);
delay(10);
}
}
bool Connect() {
// Connect to MQTT Server and subscribe to the topic
if (client.connect(clientID, mqtt_username, mqtt_password)) {
client.subscribe(mqtt_topic);
return true;
}
else {
return false;
}
}
void setup() {
pinMode(KEY, OUTPUT);
pinMode(VIDEO, OUTPUT);
pinMode(OUTA, OUTPUT);
pinMode(OUTB, OUTPUT);
digitalWrite(KEY, LOW);
digitalWrite(VIDEO, LOW);
digitalWrite(OUTA, LOW);
digitalWrite(OUTB, LOW);
// Connect to WiFi
WiFi.config(ip, gateway, subnet);
WiFi.begin(ssid, wifi_password);
// Wait until the connection has been confirmed before continuing
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
ArduinoOTA.setHostname("ESP_Fermax");
ArduinoOTA.begin();
client.setCallback(ReceivedMessage);
}
void loop() {
// If the connection is lost, try to connect again
if (!client.connected()) {
Connect();
}
client.loop();
ArduinoOTA.handle();
}
[
{
"id": "70fb7a00.957a24",
"type": "mqtt out",
"z": "16f783de.471cdc",
"name": "",
"topic": "FermaxDoor",
"qos": "1",
"retain": "",
"broker": "1820173.0315be9",
"x": 940,
"y": 1380,
"wires": []
},
{
"id": "66e769ef.fb9d68",
"type": "ui_button",
"z": "16f783de.471cdc",
"name": "",
"group": "d0858a86.88d2d8",
"order": 2,
"width": "4",
"height": "1",
"passthru": false,
"label": "{{msg.texto}}",
"tooltip": "",
"color": "",
"bgcolor": "{{background}}",
"icon": "fa-sign-in fa-2x",
"payload": "1",
"payloadType": "num",
"topic": "",
"x": 630,
"y": 1380,
"wires": [
[
"eb00410e.9fd95",
"29f40ada.0332b6"
]
]
},
{
"id": "38c90c2c.d26804",
"type": "function",
"z": "16f783de.471cdc",
"name": "Door button text",
"func": "if (msg.payload == '0'){\n msg.texto = \"Opening...\";\n msg.background = \"#C0C0C0\";\n flow.set('OpeningDoor',true);\n}\nelse {\n msg.payload = '0';\n msg.texto = \"Open the door\";\n msg.background = \"#32af3d\";\n flow.set('OpeningDoor',false);\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 470,
"y": 1380,
"wires": [
[
"66e769ef.fb9d68"
]
]
},
{
"id": "eb00410e.9fd95",
"type": "trigger",
"z": "16f783de.471cdc",
"op1": "0",
"op2": "x",
"op1type": "str",
"op2type": "str",
"duration": "10",
"extend": false,
"units": "s",
"reset": "",
"bytopic": "all",
"name": "",
"x": 530,
"y": 1300,
"wires": [
[
"38c90c2c.d26804"
]
]
},
{
"id": "948474fb.4fe0f8",
"type": "inject",
"z": "16f783de.471cdc",
"name": "",
"topic": "",
"payload": "x",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"x": 290,
"y": 1380,
"wires": [
[
"38c90c2c.d26804"
]
]
},
{
"id": "29f40ada.0332b6",
"type": "function",
"z": "16f783de.471cdc",
"name": "Open the door",
"func": "if (msg.payload == '1' && flow.get('OpeningDoor')===false){\n return msg;\n}",
"outputs": 1,
"noerr": 0,
"x": 790,
"y": 1380,
"wires": [
[
"70fb7a00.957a24"
]
]
},
{
"id": "1820173.0315be9",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "localhost",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "d0858a86.88d2d8",
"type": "ui_group",
"z": "",
"name": "Door entry",
"tab": "de4212be.7e8d3",
"order": 3,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "de4212be.7e8d3",
"type": "ui_tab",
"z": "",
"name": "Home",
"icon": "home",
"order": 1,
"disabled": false,
"hidden": false
}
]
Comments
Please log in or sign up to comment.