2024-09-2401
This commit is contained in:
parent
8994baad3c
commit
68e1241260
|
@ -22,6 +22,8 @@ lib_deps =
|
||||||
|
|
||||||
[env:debug] ; Entwicklungssystem
|
[env:debug] ; Entwicklungssystem
|
||||||
build_flags = ${env.build_flags}
|
build_flags = ${env.build_flags}
|
||||||
|
-DTRANSPONDER=\"96:33:bb:bf:ff:ab\"
|
||||||
|
-DORT=\"Wohnung\"
|
||||||
-DDEBUG=0
|
-DDEBUG=0
|
||||||
-DNOADS=0
|
-DNOADS=0
|
||||||
-DNAME=\"BLE-Praesenz\"
|
-DNAME=\"BLE-Praesenz\"
|
||||||
|
|
10
src/main.cpp
10
src/main.cpp
|
@ -22,7 +22,7 @@ PubSubClient client(espClient);
|
||||||
#define mqtt_port 1883
|
#define mqtt_port 1883
|
||||||
|
|
||||||
//cf:d7:ab:1f:24:2c
|
//cf:d7:ab:1f:24:2c
|
||||||
String Adresse = "96:33:bb:bf:ff:ab"; // Bluetooth Adresse die zu Anwesenheitserkennung überwacht wird ET585
|
String Adresse = TRANSPONDER; // Bluetooth Adresse die zu Anwesenheitserkennung überwacht wird ET585
|
||||||
//String Adresse = "cf:d7:ab:1f:24:2c"; // Bluetooth Adresse die zu Anwesenheitserkennung überwacht wird Holy-IOT
|
//String Adresse = "cf:d7:ab:1f:24:2c"; // Bluetooth Adresse die zu Anwesenheitserkennung überwacht wird Holy-IOT
|
||||||
const int RelaisPin = LED_BUILTIN; // Pin an dem Relais hängt
|
const int RelaisPin = LED_BUILTIN; // Pin an dem Relais hängt
|
||||||
int Verzoegerung = 30; // Auschaltverzögerung wenn das Signal von BLE ibeacon fehlt
|
int Verzoegerung = 30; // Auschaltverzögerung wenn das Signal von BLE ibeacon fehlt
|
||||||
|
@ -155,10 +155,6 @@ class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks
|
||||||
Serial.print(" ");
|
Serial.print(" ");
|
||||||
digitalWrite (RelaisPin, HIGH); // Relais Einschalten
|
digitalWrite (RelaisPin, HIGH); // Relais Einschalten
|
||||||
VerzoegerungZaeler = 0; // Ausschaltverzögerung zurücksetzen
|
VerzoegerungZaeler = 0; // Ausschaltverzögerung zurücksetzen
|
||||||
/* sprintf(topic, "%s%s%s", "hjk/devices/", "Wohnung", "/telemetry/status" );
|
|
||||||
client.publish(topic, "DA", true);
|
|
||||||
Serial.println();
|
|
||||||
Serial.print(topic); Serial.println(" DA"); */
|
|
||||||
advertisedDevice.getScan()->stop(); // Scanvorgang beenden
|
advertisedDevice.getScan()->stop(); // Scanvorgang beenden
|
||||||
gefunden = true;
|
gefunden = true;
|
||||||
} // Found our server
|
} // Found our server
|
||||||
|
@ -202,12 +198,12 @@ void loop()
|
||||||
client.loop();
|
client.loop();
|
||||||
pBLEScan->start(scanTime);
|
pBLEScan->start(scanTime);
|
||||||
if (gefunden == true){
|
if (gefunden == true){
|
||||||
sprintf(topic, "%s%s%s", "hjk/devices/", "Wohnung", "/telemetry/status" );
|
sprintf(topic, "%s%s%s", "hjk/devices/", ORT, "/telemetry/status" );
|
||||||
client.publish(topic, "DA", true);
|
client.publish(topic, "DA", true);
|
||||||
Serial.println();
|
Serial.println();
|
||||||
Serial.print(topic); Serial.println(" DA");
|
Serial.print(topic); Serial.println(" DA");
|
||||||
} else {
|
} else {
|
||||||
sprintf(topic, "%s%s%s", "hjk/devices/", "Wohnung", "/telemetry/status" );
|
sprintf(topic, "%s%s%s", "hjk/devices/", ORT, "/telemetry/status" );
|
||||||
client.publish(topic, "FERN", true);
|
client.publish(topic, "FERN", true);
|
||||||
Serial.println();
|
Serial.println();
|
||||||
Serial.print(topic); Serial.println(" FERN");
|
Serial.print(topic); Serial.println(" FERN");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user