Mqtt discovery for ha (#323)
* MQTT discovery factoring * add DHT discovery * BME topic macro change * add sensors to ha discovery * correct a comment typo #327 * let the possibility at buildtime to don't publish service data * reduce string usage * change MQTT ONOFF actuator to ON OFF commands instead of true false * add ZactuatorONOFF discovery * add simple publishing for GPIO input * Add RF switch and gateway discovery
This commit is contained in:
1 parent
ed44418a7f
commit
133e9cd33a
21 files changed
+442
-201
No files matched your search
+7
-5
@@ -89,10 +89,10 @@ Thanks to wolass https://github.com/wolass for suggesting me HM 10 and dinosd ht
|
||||
char service_data[returnedString.length()+1];
|
||||
returnedString.toCharArray(service_data,returnedString.length()+1);
|
||||
service_data[returnedString.length()] = '\0';
|
||||
BLEdata.set("servicedata", service_data);
|
||||
|
||||
BLEdata.set("servicedatauuid", (char *)advertisedDevice.getServiceDataUUID().toString().c_str());
|
||||
|
||||
#ifdef pubBLEServiceData
|
||||
BLEdata.set("servicedata", service_data);
|
||||
BLEdata.set("servicedatauuid", (char *)advertisedDevice.getServiceDataUUID().toString().c_str());
|
||||
#endif
|
||||
pub((char *)mactopic.c_str(),BLEdata);
|
||||
|
||||
if (strstr(BLEdata["servicedatauuid"].as<char*>(),"fe95") != NULL){
|
||||
@@ -259,7 +259,9 @@ boolean BTtoMQTT() {
|
||||
#endif
|
||||
String Service_data(d[5].extract);
|
||||
Service_data = Service_data.substring(14);
|
||||
BLEdata.set("servicedata", (char *)Service_data.c_str());
|
||||
#ifdef pubBLEServiceData
|
||||
BLEdata.set("servicedata", (char *)Service_data.c_str());
|
||||
#endif
|
||||
pub((char *)topic.c_str(),BLEdata);
|
||||
if (strcmp(d[4].extract, "fe95") == 0) {
|
||||
int pos = -1;
|
||||
|
||||
Reference in new issue
Block a user