From 68e1241260746c9b3c8c465ed99e938b9de8ccf6 Mon Sep 17 00:00:00 2001 From: hans-jurgen Date: Tue, 24 Sep 2024 23:29:12 +0200 Subject: [PATCH] 2024-09-2401 --- platformio.ini | 2 ++ src/main.cpp | 10 +++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/platformio.ini b/platformio.ini index 74050f1..afc78ce 100644 --- a/platformio.ini +++ b/platformio.ini @@ -22,6 +22,8 @@ lib_deps = [env:debug] ; Entwicklungssystem build_flags = ${env.build_flags} + -DTRANSPONDER=\"96:33:bb:bf:ff:ab\" + -DORT=\"Wohnung\" -DDEBUG=0 -DNOADS=0 -DNAME=\"BLE-Praesenz\" diff --git a/src/main.cpp b/src/main.cpp index 09ede1c..007ed12 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,7 +22,7 @@ PubSubClient client(espClient); #define mqtt_port 1883 //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 const int RelaisPin = LED_BUILTIN; // Pin an dem Relais hängt int Verzoegerung = 30; // Auschaltverzögerung wenn das Signal von BLE ibeacon fehlt @@ -155,10 +155,6 @@ class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks Serial.print(" "); digitalWrite (RelaisPin, HIGH); // Relais Einschalten 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 gefunden = true; } // Found our server @@ -202,12 +198,12 @@ void loop() client.loop(); pBLEScan->start(scanTime); 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); Serial.println(); Serial.print(topic); Serial.println(" DA"); } 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); Serial.println(); Serial.print(topic); Serial.println(" FERN");