Theengs decoder integration (#1092)
* Use Theengs Decoder for BLE device decoding
This commit is contained in:
1 parent
c5f7a3a55e
commit
10f0d4cff4
3 files changed
+54
-690
No files matched your search
+21
-678
@@ -56,7 +56,10 @@ SemaphoreHandle_t semaphoreCreateOrUpdateDevice;
|
||||
# include <ArduinoSTL.h>
|
||||
# endif
|
||||
|
||||
# include <decoder.h>
|
||||
|
||||
# include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
# define device_flags_init 0 << 0
|
||||
@@ -65,6 +68,8 @@ using namespace std;
|
||||
# define device_flags_isBlackL 1 << 2
|
||||
# define device_flags_connect 1 << 3
|
||||
|
||||
TheengsDecoder decoder;
|
||||
|
||||
struct decompose {
|
||||
int start;
|
||||
int len;
|
||||
@@ -671,9 +676,7 @@ class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks {
|
||||
BLEdata["name"] = (char*)advertisedDevice->getName().c_str();
|
||||
if (advertisedDevice->haveManufacturerData()) {
|
||||
char* manufacturerdata = BLEUtils::buildHexData(NULL, (uint8_t*)advertisedDevice->getManufacturerData().data(), advertisedDevice->getManufacturerData().length());
|
||||
Log.trace(F("Manufacturer Data: %s" CR), manufacturerdata);
|
||||
BLEdata["manufacturerdata"] = manufacturerdata;
|
||||
free(manufacturerdata);
|
||||
}
|
||||
if (advertisedDevice->haveRSSI())
|
||||
BLEdata["rssi"] = (int)advertisedDevice->getRSSI();
|
||||
@@ -1104,8 +1107,19 @@ void PublishDeviceData(JsonObject& BLEdata, bool processBLEData) {
|
||||
# endif
|
||||
# if !pubKnownBLEServiceData
|
||||
RemoveJsonPropertyIf(BLEdata, "servicedata", BLEdata.containsKey("model") && BLEdata.containsKey("servicedata"));
|
||||
# endif
|
||||
# if !pubBLEManufacturerData
|
||||
RemoveJsonPropertyIf(BLEdata, "manufacturerdata", BLEdata.containsKey("model") && BLEdata.containsKey("manufacturerdata"));
|
||||
# endif
|
||||
pubBT(BLEdata);
|
||||
} else {
|
||||
# if !pubUnknownBLEServiceData
|
||||
Log.trace(F("Unknown service data, removing it" CR));
|
||||
RemoveJsonPropertyIf(BLEdata, "servicedata", BLEdata.containsKey("servicedata"));
|
||||
# endif
|
||||
# if !pubUnknownBLEManufacturerData
|
||||
RemoveJsonPropertyIf(BLEdata, "manufacturerdata", BLEdata.containsKey("model") && BLEdata.containsKey("manufacturerdata"));
|
||||
# endif
|
||||
}
|
||||
} else if (BLEdata.containsKey("distance")) {
|
||||
pubBT(BLEdata);
|
||||
@@ -1114,683 +1128,12 @@ void PublishDeviceData(JsonObject& BLEdata, bool processBLEData) {
|
||||
}
|
||||
}
|
||||
|
||||
JsonObject& process_bledata(JsonObject& BLEdata) {
|
||||
const char* mac = BLEdata["id"].as<const char*>();
|
||||
BLEdevice* device = getDeviceByMac(mac);
|
||||
if (BLEdata.containsKey("servicedata")) {
|
||||
Log.trace(F("Checking BLE service data validity" CR));
|
||||
const char* service_uuid = (const char*)BLEdata["servicedatauuid"];
|
||||
const char* service_data = (const char*)(BLEdata["servicedata"] | "");
|
||||
int service_len = strlen(service_data);
|
||||
if (valid_service_data(service_data, service_len)) {
|
||||
Log.trace(F("Searching BLE device data %s size %d" CR), service_data, strlen(service_data));
|
||||
Log.trace(F("Is it a mokoBeacon?" CR));
|
||||
if (strcmp(service_uuid, "0xff01") == NULL) {
|
||||
createOrUpdateDevice(mac, device_flags_init, MOKOBEACON);
|
||||
return process_mokobeacon(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a mokoBeaconX Pro?" CR));
|
||||
if (strcmp(service_uuid, "0xfeab") == NULL) {
|
||||
createOrUpdateDevice(mac, device_flags_init, MOKOBEACONXPRO);
|
||||
return process_mokobeaconXPro(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a mi flora ?" CR));
|
||||
if (strstr(service_data, "209800") != NULL) {
|
||||
Log.trace(F("mi flora data reading" CR));
|
||||
BLEdata["model"] = "HHCCJCY01HHCC";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_connect, HHCCJCY01HHCC);
|
||||
return process_sensors(2, BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a vegtrug ?" CR));
|
||||
if (service_len > ServicedataMinLength && strstr(service_data, "20bc03") != NULL) {
|
||||
Log.trace(F("vegtrug data reading" CR));
|
||||
BLEdata["model"] = "VEGTRUG";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, VEGTRUG);
|
||||
return process_sensors(2, BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a LYWSDCGQ?" CR));
|
||||
if (service_len > ServicedataMinLength && strstr(service_data, "20aa01") != NULL) {
|
||||
Log.trace(F("LYWSDCGQ data reading" CR));
|
||||
BLEdata["model"] = "LYWSDCGQ";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, LYWSDCGQ);
|
||||
return process_sensors(0, BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a JQJCY01YM?" CR));
|
||||
if (service_len > ServicedataMinLength && strstr(service_data, "20df02") != NULL) {
|
||||
Log.trace(F("JQJCY01YM data reading" CR));
|
||||
BLEdata["model"] = "JQJCY01YM";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, JQJCY01YM);
|
||||
return process_sensors(0, BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a LYWSD02?" CR));
|
||||
if (service_len > ServicedataMinLength && strstr(service_data, "205b04") != NULL) {
|
||||
Log.trace(F("LYWSD02 data reading" CR));
|
||||
BLEdata["model"] = "LYWSD02";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, LYWSD02);
|
||||
return process_sensors(2, BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a MUE4094RT?" CR));
|
||||
if (strstr(service_data, "4030dd") != NULL) {
|
||||
Log.trace(F("MUE4094RT data reading" CR));
|
||||
BLEdata["model"] = "MUE4094RT";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, MUE4094RT);
|
||||
return process_milamp(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a CGP1W?" CR));
|
||||
if (service_len > ServicedataMinLength && strncmp(service_data, "0809", 4) == 0) {
|
||||
Log.trace(F("CGP1W data reading" CR));
|
||||
BLEdata["model"] = "CGP1W";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, CGP1W);
|
||||
return process_cleargrass(BLEdata, true);
|
||||
}
|
||||
Log.trace(F("Is it a CGG1" CR));
|
||||
// One type of the advertising packet format started with 50204703 or 50304703, where 4703 is a type of a sensor
|
||||
// Another type of the advertising packet started with 0807 or 8816
|
||||
if ((service_len > ServicedataMinLength && strncmp(&service_data[2], "4703", 4) == 0) || (strncmp(service_data, "0807", 4) == 0) || (strncmp(service_data, "8816", 4) == 0)) {
|
||||
Log.trace(F("CGG1 data reading" CR));
|
||||
BLEdata["model"] = "CGG1";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, CGG1);
|
||||
return strncmp(&service_data[2], "4703", 4) == 0 ? process_sensors(0, BLEdata) : process_cleargrass(BLEdata, false);
|
||||
}
|
||||
Log.trace(F("Is it a CGD1?" CR));
|
||||
if ((service_len > ServicedataMinLength && (strstr(service_data, "080caf") != NULL || strstr(service_data, "080c09") != NULL)) || (service_len > ServicedataMinLength - 6 && strstr(service_data, "080cd0") != NULL)) {
|
||||
Log.trace(F("CGD1 data reading" CR));
|
||||
BLEdata["model"] = "CGD1";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, CGD1);
|
||||
return process_cleargrass(BLEdata, false);
|
||||
}
|
||||
Log.trace(F("Is it a CGDK2?" CR));
|
||||
if (service_len > ServicedataMinLength && strncmp(&service_data[0], "8810", 4) == 0) {
|
||||
Log.trace(F("CGDK2 data reading" CR));
|
||||
BLEdata["model"] = "CGDK2";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, CGDK2);
|
||||
return process_cleargrass(BLEdata, false);
|
||||
}
|
||||
Log.trace(F("Is it a CGPR1?" CR));
|
||||
if ((service_len > ServicedataMinLength) && (strncmp(&service_data[0], "4812", 4) == 0 || strncmp(&service_data[0], "0812", 4) == 0)) {
|
||||
Log.trace(F("CGPR1 data reading" CR));
|
||||
BLEdata["model"] = "CGPR1";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, CGPR1);
|
||||
return process_cgpr1(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a CGH1?" CR));
|
||||
if (service_len > ServicedataMinLength && (strncmp(&service_data[0], "c804", 4) == 0 || strncmp(&service_data[0], "8804", 4) == 0 || strncmp(&service_data[0], "0804", 4) == 0 || strncmp(&service_data[0], "4804", 4) == 0)) {
|
||||
Log.trace(F("CGH1 data reading" CR));
|
||||
BLEdata["model"] = "CGH1";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, CGH1);
|
||||
return process_cgh1(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a MHO_C401?" CR));
|
||||
if (strstr(service_data, "588703") != NULL) {
|
||||
Log.trace(F("MHO_C401 add to list for future connect" CR));
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_connect, MHO_C401);
|
||||
}
|
||||
Log.trace(F("Is it a LYWSD03MMC?" CR));
|
||||
if (strstr(service_data, "585b05") != NULL) {
|
||||
Log.trace(F("LYWSD03MMC add to list for future connect" CR));
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_connect, LYWSD03MMC);
|
||||
}
|
||||
Log.trace(F("Is it a custom (pvvx) LYWSD03MMC?" CR));
|
||||
if (service_len >= 30 && strncmp(service_data + 6, "38c1a4", 6) == 0) {
|
||||
Log.trace(F("LYWSD03MMC PVVX" CR));
|
||||
BLEdata["model"] = "LYWSD03MMC_PVVX";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, LYWSD03MMC_PVVX);
|
||||
return process_pvvx(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a custom (atc1441) LYWSD03MMC?" CR));
|
||||
if (strstr(service_data, "a4c138") != NULL) {
|
||||
Log.trace(F("LYWSD03MMC ATC" CR));
|
||||
BLEdata["model"] = "LYWSD03MMC_ATC";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, LYWSD03MMC_ATC);
|
||||
return process_atc(BLEdata);
|
||||
}
|
||||
if (BLEdata.containsKey("servicedatauuid")) {
|
||||
const char* service_datauuid = (const char*)(BLEdata["servicedatauuid"] | "");
|
||||
Log.trace(F("servicedatauuid %s" CR), service_datauuid);
|
||||
Log.trace(F("Is it a MiBand?" CR));
|
||||
if (strstr(service_datauuid, "fee0") != NULL) {
|
||||
Log.trace(F("Mi Band data reading" CR));
|
||||
BLEdata["model"] = "MIBAND";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, MIBAND);
|
||||
return process_miband(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a XMTZC04HM?" CR));
|
||||
if (strstr(service_datauuid, "181d") != NULL) {
|
||||
Log.trace(F("XMTZC04HM data reading" CR));
|
||||
BLEdata["model"] = "XMTZC04HM";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, XMTZC04HM);
|
||||
return process_scale_v1(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a XMTZC05HM?" CR));
|
||||
if (strstr(service_datauuid, "181b") != NULL) {
|
||||
Log.trace(F("XMTZC05HM data reading" CR));
|
||||
BLEdata["model"] = "XMTZC05HM";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, XMTZC05HM);
|
||||
return process_scale_v2(BLEdata);
|
||||
}
|
||||
// || strstr(service_datauuid, "0x2080") != NULL
|
||||
Log.trace(F("Is it an EddystoneTLM?" CR));
|
||||
if (strncmp(&service_data[0], "20", 2) == 0 && strstr(service_datauuid, "0xfeaa") != NULL) {
|
||||
Log.trace(F("Eddystone TLM" CR));
|
||||
BLEdata["model"] = "EDDYSTONE_TLM";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, EDDYSTONE_TLM);
|
||||
return process_eddystonetlm(BLEdata);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.trace(F("Non valid service data, removing it" CR));
|
||||
BLEdata.remove("servicedata");
|
||||
}
|
||||
|
||||
# if !pubUnknownBLEServiceData
|
||||
Log.trace(F("Unknown service data, removing it" CR));
|
||||
BLEdata.remove("servicedata");
|
||||
# endif
|
||||
void process_bledata(JsonObject& BLEdata) {
|
||||
if (decoder.decodeBLEJson(BLEdata)) {
|
||||
Log.trace(F("1decoder found device: %s" CR), BLEdata["model"].as<const char*>());
|
||||
} else {
|
||||
Log.trace(F("No device found " CR));
|
||||
}
|
||||
|
||||
if (BLEdata.containsKey("manufacturerdata")) {
|
||||
const char* manufacturerdata = (const char*)(BLEdata["manufacturerdata"] | "");
|
||||
Log.trace(F("manufacturerdata %s" CR), manufacturerdata);
|
||||
if (BLEdata.containsKey("name")) {
|
||||
const char* name = (const char*)(BLEdata["name"] | "");
|
||||
Log.trace(F("name %s" CR), name);
|
||||
Log.trace(F("Is it a INKBIRD IBS-TH1?" CR));
|
||||
if (strcmp(name, "sps") == 0) {
|
||||
Log.trace(F("INKBIRD TH1 data reading" CR));
|
||||
BLEdata["model"] = "IBS-TH1";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, IBSTH1);
|
||||
return process_inkbird_th1(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a INKBIRD IBS-TH2?" CR));
|
||||
if (strcmp(name, "tps") == 0) {
|
||||
Log.trace(F("INKBIRD TH2 data reading" CR));
|
||||
BLEdata["model"] = "IBS-TH2";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, IBSTH2);
|
||||
return process_inkbird_th2(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a INKBIRD IBT-4XS?" CR));
|
||||
if (strcmp(name, "iBBQ") == 0) {
|
||||
Log.trace(F("INKBIRD IBT-4XS data reading" CR));
|
||||
BLEdata["model"] = "IBT-4XS";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, IBT4XS);
|
||||
return process_inkbird_4xs(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a DT24?" CR));
|
||||
if (strcmp(name, "DT24-BLE") == 0) {
|
||||
Log.trace(F("DT24 data reading data reading" CR));
|
||||
BLEdata["model"] = "DT24";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_connect, DT24);
|
||||
return BLEdata;
|
||||
}
|
||||
Log.trace(F("Is it a TPMS? %u" CR), strlen(manufacturerdata));
|
||||
if (strlen(manufacturerdata) == 36 && strstr(name, "TPMS") != NULL) {
|
||||
Log.trace(F("TPMS data reading" CR));
|
||||
BLEdata["model"] = "TPMS";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, TPMS);
|
||||
return process_tpms(BLEdata);
|
||||
}
|
||||
}
|
||||
Log.trace(F("Is it a iNode Energy Meter?" CR));
|
||||
if (strlen(manufacturerdata) == 26 && ((long)value_from_hex_data(manufacturerdata, 0, 4, true) & 0xFFF9) == 0x8290) {
|
||||
Log.trace(F("iNode Energy Meter data reading" CR));
|
||||
BLEdata["model"] = "INODE_EM";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, INODE_EM);
|
||||
return process_inode_em(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it a WS02?" CR));
|
||||
if (strlen(manufacturerdata) >= 40 && (strstr(manufacturerdata, "100000001a11") != NULL)) {
|
||||
Log.trace(F("WS02 data reading data reading" CR));
|
||||
BLEdata["model"] = "WS02";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, WS02);
|
||||
return process_ws02(BLEdata);
|
||||
}
|
||||
Log.trace(F("Is it an iBeacon? %u" CR), strlen(manufacturerdata));
|
||||
if (strlen(manufacturerdata) == 50 && strncmp(&manufacturerdata[0], "4c00", 4) == NULL) {
|
||||
Log.trace(F("iBeacon data reading" CR));
|
||||
BLEdata["model"] = "IBEACON";
|
||||
if (device->sensorModel == -1)
|
||||
createOrUpdateDevice(mac, device_flags_init, IBEACON);
|
||||
return process_ibeacon(BLEdata);
|
||||
}
|
||||
# if !pubBLEManufacturerData
|
||||
Log.trace(F("Remove manufacturer data" CR));
|
||||
BLEdata.remove("manufacturerdata");
|
||||
# endif
|
||||
}
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_sensors(int offset, JsonObject& BLEdata) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
int data_length = 0;
|
||||
|
||||
switch (servicedata[27 + offset]) {
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
data_length = ((servicedata[27 + offset] - '0') * 2);
|
||||
Log.trace(F("Valid data_length: %d" CR), data_length);
|
||||
break;
|
||||
default:
|
||||
Log.trace(F("Invalid data_length, not enriching the device data" CR));
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
double value = 9999;
|
||||
value = (double)value_from_hex_data(servicedata, 28 + offset, data_length, true);
|
||||
|
||||
// Mi flora provides tem(perature), (earth) moi(sture), fer(tility) and lux (illuminance)
|
||||
// Mi Jia provides tem(perature), batt(erry) and hum(idity)
|
||||
// following the value of digit 23 + offset we determine the type of data we get from the sensor
|
||||
switch (servicedata[23 + offset]) {
|
||||
case '0':
|
||||
BLEdata["for"] = (double)value / 100;
|
||||
break;
|
||||
case '4':
|
||||
BLEdata["tempc"] = (double)value / 10;
|
||||
BLEdata["tempf"] = (double)convertTemp_CtoF(value / 10);
|
||||
break;
|
||||
case '6':
|
||||
BLEdata["hum"] = (double)value / 10;
|
||||
break;
|
||||
case '7':
|
||||
BLEdata["lux"] = (double)value;
|
||||
break;
|
||||
case '8':
|
||||
BLEdata["moi"] = (double)value;
|
||||
break;
|
||||
case '9':
|
||||
BLEdata["fer"] = (double)value;
|
||||
break;
|
||||
case 'a':
|
||||
BLEdata["batt"] = (double)value;
|
||||
break;
|
||||
case 'd':
|
||||
// temperature
|
||||
value = (double)value_from_hex_data(servicedata, 28 + offset, 4, true);
|
||||
BLEdata["tempc"], (double)value / 10;
|
||||
BLEdata["tempf"], (double)convertTemp_CtoF(value / 10);
|
||||
// humidity
|
||||
value = (double)value_from_hex_data(servicedata, 32 + offset, 4, true);
|
||||
BLEdata["hum"] = (double)value / 10;
|
||||
break;
|
||||
default:
|
||||
Log.trace(F("can't read values" CR));
|
||||
}
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_scale_v1(JsonObject& BLEdata) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
|
||||
if (servicedata[0] == '2') { // stabilized
|
||||
double weight = 0;
|
||||
if (servicedata[1] == '2') { //kg
|
||||
weight = (double)value_from_hex_data(servicedata, 2, 4, true) / 200;
|
||||
BLEdata["unit"] = "kg";
|
||||
} else if (servicedata[1] == '3') { //lbs
|
||||
weight = (double)value_from_hex_data(servicedata, 2, 4, true) / 100;
|
||||
BLEdata["unit"] = "lbs";
|
||||
} else { //unknown unit
|
||||
BLEdata["unit"] = "unknown";
|
||||
}
|
||||
//Set Json value
|
||||
BLEdata["weight"] = (double)weight;
|
||||
}
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_scale_v2(JsonObject& BLEdata) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
|
||||
double weight = 0;
|
||||
if (servicedata[1] == '2') { //kg
|
||||
weight = (double)value_from_hex_data(servicedata, 22, 4, true) / 200;
|
||||
BLEdata["unit"] = "kg";
|
||||
} else if (servicedata[1] == '3') { //lbs
|
||||
weight = (double)value_from_hex_data(servicedata, 22, 4, true) / 100;
|
||||
BLEdata["unit"] = "lbs";
|
||||
} else { //unknown unit
|
||||
BLEdata["unit"] = "unknown";
|
||||
}
|
||||
double impedance = (double)value_from_hex_data(servicedata, 18, 4, true);
|
||||
|
||||
//Set Json values
|
||||
BLEdata["weight"] = (double)weight;
|
||||
BLEdata["impedance"] = (double)impedance;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_eddystonetlm(JsonObject& BLEdata) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
|
||||
BLEdata["volt"] = (float)value_from_hex_data(servicedata, 4, 4, false) / 1000;
|
||||
BLEdata["tempc"] = (float)value_from_hex_data(servicedata, 8, 2, false);
|
||||
BLEdata["tempf"] = (float)convertTemp_CtoF(value_from_hex_data(servicedata, 8, 2, false));
|
||||
BLEdata["count"] = value_from_hex_data(servicedata, 12, 8, false);
|
||||
BLEdata["time"] = value_from_hex_data(servicedata, 20, 8, false) / 100;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_inkbird_th1(JsonObject& BLEdata) {
|
||||
const char* manufacturerdata = BLEdata["manufacturerdata"].as<const char*>();
|
||||
|
||||
double temperature = (double)value_from_hex_data(manufacturerdata, 0, 4, true) / 100;
|
||||
double humidity = (double)value_from_hex_data(manufacturerdata, 4, 4, true) / 100;
|
||||
double battery = (double)value_from_hex_data(manufacturerdata, 14, 2, true);
|
||||
|
||||
//Set Json values
|
||||
BLEdata["tempc"] = (double)temperature;
|
||||
BLEdata["tempf"] = (double)convertTemp_CtoF(temperature);
|
||||
BLEdata["hum"] = (double)humidity;
|
||||
BLEdata["batt"] = (double)battery;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_inkbird_th2(JsonObject& BLEdata) {
|
||||
const char* manufacturerdata = BLEdata["manufacturerdata"].as<const char*>();
|
||||
|
||||
double temperature = (double)value_from_hex_data(manufacturerdata, 0, 4, true) / 100;
|
||||
double battery = (double)value_from_hex_data(manufacturerdata, 14, 2, true);
|
||||
|
||||
//Set Json values
|
||||
BLEdata["tempc"] = (double)temperature;
|
||||
BLEdata["tempf"] = (double)convertTemp_CtoF(temperature);
|
||||
BLEdata["batt"] = (double)battery;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_inkbird_4xs(JsonObject& BLEdata) {
|
||||
const char* manufacturerdata = BLEdata["manufacturerdata"].as<const char*>();
|
||||
|
||||
double temperature = (double)value_from_hex_data(manufacturerdata, 20, 4, true) / 10;
|
||||
double temperature2 = (double)value_from_hex_data(manufacturerdata, 24, 4, true) / 10;
|
||||
double temperature3 = (double)value_from_hex_data(manufacturerdata, 28, 4, true) / 10;
|
||||
double temperature4 = (double)value_from_hex_data(manufacturerdata, 32, 4, true) / 10;
|
||||
|
||||
//Set Json values
|
||||
BLEdata["tempc"] = (double)temperature;
|
||||
BLEdata["tempf"] = (double)convertTemp_CtoF(temperature);
|
||||
BLEdata["tempc2"] = (double)temperature2;
|
||||
BLEdata["tempf2"] = (double)convertTemp_CtoF(temperature2);
|
||||
BLEdata["tempc3"] = (double)temperature3;
|
||||
BLEdata["tempf3"] = (double)convertTemp_CtoF(temperature3);
|
||||
BLEdata["tempc4"] = (double)temperature4;
|
||||
BLEdata["tempf4"] = (double)convertTemp_CtoF(temperature4);
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_miband(JsonObject& BLEdata) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
|
||||
double steps = (double)value_from_hex_data(servicedata, 0, 4, true);
|
||||
|
||||
//Set Json value
|
||||
BLEdata["steps"] = (double)steps;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_milamp(JsonObject& BLEdata) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
|
||||
long darkness = (double)value_from_hex_data(servicedata, 8, 2, true);
|
||||
|
||||
//Set Json value
|
||||
BLEdata["presence"] = (bool)"true";
|
||||
BLEdata["darkness"] = (long)darkness;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_cleargrass(JsonObject& BLEdata, boolean air) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
|
||||
double value = 9999;
|
||||
// temperature
|
||||
value = (double)value_from_hex_data(servicedata, 20, 4, true);
|
||||
BLEdata["tempc"] = (double)value / 10;
|
||||
BLEdata["tempf"] = (double)convertTemp_CtoF(value / 10);
|
||||
// humidity
|
||||
value = (double)value_from_hex_data(servicedata, 24, 4, true);
|
||||
BLEdata["hum"] = (double)value / 10;
|
||||
if (air) {
|
||||
// air pressure
|
||||
value = (double)value_from_hex_data(servicedata, 32, 4, true);
|
||||
BLEdata["pres"] = (double)value / 100;
|
||||
}
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_cgpr1(JsonObject& BLEdata) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
int value = -1;
|
||||
if (strncmp(&servicedata[0], "0812", 4) == 0) { // lux
|
||||
value = value_from_hex_data(servicedata, 33, 4, true);
|
||||
if (value >= 0)
|
||||
BLEdata["lux"] = value;
|
||||
} else if (strncmp(&servicedata[0], "4812", 4) == 0) { // presence
|
||||
value = value_from_hex_data(servicedata, 21, 1, false);
|
||||
if (value == 0)
|
||||
BLEdata["pres"] = false;
|
||||
if (value == 1)
|
||||
BLEdata["pres"] = true;
|
||||
}
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_cgh1(JsonObject& BLEdata) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
int value = -1;
|
||||
if (strncmp(&servicedata[0], "0804", 4) == 0 || strncmp(&servicedata[0], "8804", 4) == 0) { // state
|
||||
value = value_from_hex_data(servicedata, 33, 1, false);
|
||||
} else if (strncmp(&servicedata[0], "4804", 4) == 0 || strncmp(&servicedata[0], "c804", 4) == 0) { // action
|
||||
value = value_from_hex_data(servicedata, 21, 1, false);
|
||||
}
|
||||
|
||||
if (value == 0)
|
||||
BLEdata["open"] = true;
|
||||
if (value == 1)
|
||||
BLEdata["open"] = false;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_atc(JsonObject& BLEdata) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
|
||||
double temperature = (double)value_from_hex_data(servicedata, 12, 4, false) / 10;
|
||||
double humidity = (double)value_from_hex_data(servicedata, 16, 2, false);
|
||||
double battery = (double)value_from_hex_data(servicedata, 18, 2, false);
|
||||
double voltage = (double)value_from_hex_data(servicedata, 20, 4, false) / 1000;
|
||||
|
||||
//Set Json values
|
||||
BLEdata["tempc"] = (double)temperature;
|
||||
BLEdata["tempf"] = (double)convertTemp_CtoF(temperature);
|
||||
BLEdata["hum"] = (double)humidity;
|
||||
BLEdata["batt"] = (double)battery;
|
||||
BLEdata["volt"] = (double)voltage;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_pvvx(JsonObject& BLEdata) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
|
||||
double temperature = (double)value_from_hex_data(servicedata, 12, 4, true) / 100;
|
||||
double humidity = (double)value_from_hex_data(servicedata, 16, 4, true) / 100;
|
||||
double battery = (double)value_from_hex_data(servicedata, 24, 2, false);
|
||||
double voltage = (double)value_from_hex_data(servicedata, 20, 4, true) / 1000;
|
||||
|
||||
//Set Json values
|
||||
BLEdata["tempc"] = (double)temperature;
|
||||
BLEdata["tempf"] = (double)convertTemp_CtoF(temperature);
|
||||
BLEdata["hum"] = (double)humidity;
|
||||
BLEdata["batt"] = (double)battery;
|
||||
BLEdata["volt"] = (double)voltage;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_inode_em(JsonObject& BLEdata) {
|
||||
const char* manufacturerdata = BLEdata["manufacturerdata"].as<const char*>();
|
||||
|
||||
long impPerKWh = value_from_hex_data(manufacturerdata, 16, 4, true) & 0x3FFF;
|
||||
double power = ((double)value_from_hex_data(manufacturerdata, 4, 4, true) / impPerKWh) * 60000;
|
||||
double energy = (double)value_from_hex_data(manufacturerdata, 8, 8, true) / impPerKWh;
|
||||
long battery = ((value_from_hex_data(manufacturerdata, 20, 2, true) >> 4) - 2) * 10;
|
||||
|
||||
//Set Json values
|
||||
BLEdata["power"] = (double)power;
|
||||
BLEdata["energy"] = (double)energy;
|
||||
BLEdata["batt"] = battery;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_ws02(JsonObject& BLEdata) {
|
||||
const char* manufacturerdata = BLEdata["manufacturerdata "].as<const char*>();
|
||||
|
||||
double temperature = (double)value_from_hex_data(manufacturerdata, 20, 4, true) / 16;
|
||||
double humidity = (double)value_from_hex_data(manufacturerdata, 24, 4, true) / 16;
|
||||
double voltage = (double)value_from_hex_data(manufacturerdata, 16, 4, true) / 1000;
|
||||
|
||||
//Set Json values
|
||||
BLEdata["tempc"] = (double)temperature;
|
||||
BLEdata["tempf"] = (double)convertTemp_CtoF(temperature);
|
||||
BLEdata["hum"] = (double)humidity;
|
||||
BLEdata["volt"] = (double)voltage;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_mokobeacon(JsonObject& BLEdata) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
|
||||
long battery = value_from_hex_data(servicedata, 0, 2, false);
|
||||
int x_axis = (int)value_from_hex_data(servicedata, 14, 4, false);
|
||||
int y_axis = (int)value_from_hex_data(servicedata, 18, 4, false);
|
||||
int z_axis = (int)value_from_hex_data(servicedata, 22, 4, false);
|
||||
|
||||
BLEdata["x_axis"] = x_axis;
|
||||
BLEdata["y_axis"] = y_axis;
|
||||
BLEdata["z_axis"] = z_axis;
|
||||
BLEdata["batt"] = battery;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_mokobeaconXPro(JsonObject& BLEdata) {
|
||||
const char* servicedata = BLEdata["servicedata"].as<const char*>();
|
||||
int length = strlen(servicedata);
|
||||
|
||||
if (length >= 24) {
|
||||
if (strncmp(servicedata, "40", 2) == NULL) {
|
||||
double voltage = (double)value_from_hex_data(servicedata, 6, 4, false) / 1000;
|
||||
BLEdata["volt"] = (double)voltage;
|
||||
|
||||
} else if (strncmp(servicedata, "60", 2) == NULL) {
|
||||
int x_axis = (int)value_from_hex_data(servicedata, 12, 4, false);
|
||||
int y_axis = (int)value_from_hex_data(servicedata, 16, 4, false);
|
||||
int z_axis = (int)value_from_hex_data(servicedata, 20, 4, false);
|
||||
if (length > 24) {
|
||||
double voltage = (double)value_from_hex_data(servicedata, 24, 4, false) / 1000;
|
||||
BLEdata["volt"] = (double)voltage;
|
||||
}
|
||||
|
||||
BLEdata["x_axis"] = x_axis;
|
||||
BLEdata["y_axis"] = y_axis;
|
||||
BLEdata["z_axis"] = z_axis;
|
||||
return BLEdata;
|
||||
|
||||
} else if (strncmp(servicedata, "70", 2) == NULL) {
|
||||
double temperature = (double)value_from_hex_data(servicedata, 6, 4, false) / 10;
|
||||
double humidity = (double)value_from_hex_data(servicedata, 10, 4, false) / 10;
|
||||
double voltage = (double)value_from_hex_data(servicedata, 14, 4, false) / 1000;
|
||||
|
||||
BLEdata["tempc"] = (double)temperature;
|
||||
BLEdata["tempf"] = (double)convertTemp_CtoF(temperature);
|
||||
BLEdata["hum"] = (double)humidity;
|
||||
BLEdata["volt"] = (double)voltage;
|
||||
return BLEdata;
|
||||
}
|
||||
}
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_ibeacon(JsonObject& BLEdata) {
|
||||
const char* manufacturerdata = BLEdata["manufacturerdata"].as<const char*>();
|
||||
char mfid[5] = {NULL};
|
||||
char proxUUID[33] = {NULL};
|
||||
strncpy(&mfid[0], manufacturerdata, 4);
|
||||
strncpy(&proxUUID[0], manufacturerdata + 8, 32);
|
||||
BLEdata["mfid"] = mfid;
|
||||
BLEdata["uuid"] = proxUUID;
|
||||
BLEdata["major"] = (uint16_t)value_from_hex_data(manufacturerdata, 40, 4, false, false);
|
||||
BLEdata["minor"] = (uint16_t)value_from_hex_data(manufacturerdata, 44, 4, false, false);
|
||||
BLEdata["power"] = (int8_t)value_from_hex_data(manufacturerdata, 48, 4, false);
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
JsonObject& process_tpms(JsonObject& BLEdata) {
|
||||
const char* manufacturerdata = BLEdata["manufacturerdata"].as<const char*>();
|
||||
|
||||
int id = (int)value_from_hex_data(manufacturerdata, 5, 1, false);
|
||||
double pressure = (double)value_from_hex_data(manufacturerdata, 16, 8, true) / 1000;
|
||||
double temperature = (double)value_from_hex_data(manufacturerdata, 24, 8, true) / 100;
|
||||
int battery = (int)value_from_hex_data(manufacturerdata, 32, 2, true);
|
||||
int alarm = (int)value_from_hex_data(manufacturerdata, 35, 1, false);
|
||||
|
||||
BLEdata["count"] = (int)id + 1;
|
||||
BLEdata["pres"] = (double)pressure;
|
||||
BLEdata["tempc"] = (double)temperature;
|
||||
BLEdata["tempf"] = (double)convertTemp_CtoF(temperature);
|
||||
BLEdata["batt"] = (int)battery;
|
||||
if (alarm == 1)
|
||||
BLEdata["alarm"] = true;
|
||||
if (alarm == 0)
|
||||
BLEdata["alarm"] = false;
|
||||
|
||||
return BLEdata;
|
||||
}
|
||||
|
||||
void hass_presence(JsonObject& HomePresence) {
|
||||
|
||||
@@ -116,6 +116,10 @@ bool hassPresence = HassPresence;
|
||||
# define pubBLEManufacturerData false // define true if you want to publish the manufacturer's data (sometimes contains characters that aren't valid with receiving client)
|
||||
#endif
|
||||
|
||||
#ifndef pubUnknownBLEManufacturerData
|
||||
# define pubUnknownBLEManufacturerData true // define true if you want to publish the manufacturer's data (sometimes contains characters that aren't valid with receiving client)
|
||||
#endif
|
||||
|
||||
#ifndef pubBLEServiceUUID
|
||||
# define pubBLEServiceUUID false // define true if you want to publish the service UUID data
|
||||
#endif
|
||||
|
||||
+29
-12
@@ -124,6 +124,7 @@ somfy_remote=Somfy_Remote_Lib@0.3.0
|
||||
rtl_433_ESP = https://github.com/NorthernMan54/rtl_433_ESP#e03f689
|
||||
emodbus = miq19/eModbus@1.0.0
|
||||
gfSunInverter = https://github.com/BlackSmith/GFSunInverter.git#v1.0.1
|
||||
decoder = https://github.com/theengs/decoder.git#v0.1.2
|
||||
|
||||
[env]
|
||||
framework = arduino
|
||||
@@ -139,7 +140,7 @@ build_flags =
|
||||
monitor_speed = 115200
|
||||
|
||||
[com]
|
||||
esp8266_platform = espressif8266@2.6.3
|
||||
esp8266_platform = espressif8266@3.2.0
|
||||
esp32_platform = espressif32@3.3.1
|
||||
atmelavr_platform = atmelavr@3.3.0
|
||||
|
||||
@@ -205,6 +206,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
${libraries.irremoteesp}
|
||||
${libraries.lora}
|
||||
${libraries.rfm69}
|
||||
@@ -356,6 +358,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
'-DZgatewayBT="BT"'
|
||||
@@ -370,6 +373,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
'-DZgatewayBT="BT"'
|
||||
@@ -387,6 +391,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
'-DZgatewayBT="BT"'
|
||||
@@ -401,6 +406,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
'-DZgatewayBT="BT"'
|
||||
@@ -427,6 +433,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
'-DZgatewayBT="BT"'
|
||||
@@ -442,6 +449,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
'-DZgatewayBT="BT"'
|
||||
@@ -458,6 +466,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
'-DZgatewayBT="BT"'
|
||||
@@ -473,6 +482,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
${libraries.irremoteesp}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
@@ -493,6 +503,7 @@ lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.m5stack}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
'-DZgatewayBT="BT"'
|
||||
@@ -512,6 +523,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
${libraries.m5stickc}
|
||||
${libraries.irremoteesp}
|
||||
build_flags =
|
||||
@@ -538,6 +550,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
${libraries.m5stickcp}
|
||||
${libraries.irremoteesp}
|
||||
build_flags =
|
||||
@@ -564,6 +577,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
${libraries.irremoteesp}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
@@ -633,6 +647,7 @@ board_build.partitions = min_spiffs.csv
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.ble}
|
||||
${libraries.decoder}
|
||||
${libraries.lora}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
@@ -674,7 +689,7 @@ platform = ${com.esp8266_platform}
|
||||
board = nodemcuv2
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.esppilight}
|
||||
;${libraries.esppilight}
|
||||
${libraries.irremoteesp}
|
||||
${libraries.rfm69}
|
||||
${libraries.rfm69spi}
|
||||
@@ -682,18 +697,19 @@ lib_deps =
|
||||
; ${libraries.newremoteswitch}
|
||||
${libraries.bme280}
|
||||
${libraries.bmp180}
|
||||
${libraries.htu21}
|
||||
;${libraries.htu21}
|
||||
${libraries.ahtx0}
|
||||
${libraries.unifiedsensor}
|
||||
${libraries.dht}
|
||||
${libraries.tsl2561}
|
||||
${libraries.ina226}
|
||||
;${libraries.ina226}
|
||||
${libraries.esp8266_mdns}
|
||||
${libraries.wire}
|
||||
${libraries.fastled}
|
||||
${libraries.onewire}
|
||||
${libraries.dallastemperature}
|
||||
${libraries.rfWeatherStation}
|
||||
;${libraries.rfWeatherStation}
|
||||
${libraries.decoder}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
; '-DZgatewayRF="RF"'
|
||||
@@ -704,13 +720,13 @@ build_flags =
|
||||
'-DZactuatorONOFF="ONOFF"'
|
||||
'-DZactuatorFASTLED="FASTLED"'
|
||||
;'-DZactuatorPWM="PWM"'
|
||||
'-DZsensorINA226="INA226"'
|
||||
;'-DZsensorINA226="INA226"'
|
||||
'-DZsensorHCSR501="HCSR501"'
|
||||
'-DZsensorHCSR04="HCSR04"'
|
||||
'-DZsensorADC="ADC"'
|
||||
'-DZsensorBH1750="BH1750"'
|
||||
'-DZsensorBME280="BME280"'
|
||||
'-DZsensorHTU21="HTU21"'
|
||||
;'-DZsensorHTU21="HTU21"'
|
||||
'-DZsensorAHTx0="AHTx0"'
|
||||
'-DZsensorTSL2561="TSL2561"'
|
||||
'-DZsensorDHT="DHT"'
|
||||
@@ -718,12 +734,11 @@ build_flags =
|
||||
'-DZgatewayRFM69="RFM69"'
|
||||
'-DZsensorGPIOInput="GPIOInput"'
|
||||
'-DZsensorGPIOKeyCode="GPIOKeyCode"'
|
||||
'-DZgatewayWeatherStation="WeatherStation"'
|
||||
;'-DZgatewayWeatherStation="WeatherStation"'
|
||||
'-DsimplePublishing=true'
|
||||
'-DGateway_Name="OpenMQTTGateway_ESP8266_ALL"'
|
||||
board_build.flash_mode = dout
|
||||
|
||||
|
||||
[env:nodemcuv2-2g]
|
||||
platform = ${com.esp8266_platform}
|
||||
board = nodemcuv2
|
||||
@@ -732,7 +747,7 @@ lib_deps =
|
||||
${libraries.a6lib}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
'-DZgatewayBT="2G"'
|
||||
'-DZgateway2G="2G"'
|
||||
'-DGateway_Name="OpenMQTTGateway_ESP8266_2G"'
|
||||
board_build.flash_mode = dout
|
||||
|
||||
@@ -743,6 +758,7 @@ lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
${libraries.wire}
|
||||
${libraries.esp8266_mdns}
|
||||
${libraries.decoder}
|
||||
build_flags =
|
||||
${com-esp.build_flags}
|
||||
'-DZgatewayBT="BT"'
|
||||
@@ -918,7 +934,7 @@ build_flags =
|
||||
board_build.flash_mode = dout
|
||||
|
||||
[env:nodemcuv2-pilight]
|
||||
platform = ${com.esp8266_platform}
|
||||
platform = espressif8266@^2
|
||||
board = nodemcuv2
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
@@ -1007,6 +1023,7 @@ lib_deps =
|
||||
${libraries.dallastemperature}
|
||||
${libraries.rfWeatherStation}
|
||||
${libraries.stl}
|
||||
${libraries.decoder}
|
||||
build_flags =
|
||||
${com-arduino.build_flags}
|
||||
'-DZgatewayRF="RF"'
|
||||
@@ -1059,7 +1076,7 @@ build_flags =
|
||||
'-DZactuatorFASTLED="FASTLED"'
|
||||
|
||||
[env:sonoff-rfbridge-direct]
|
||||
platform = ${com.esp8266_platform}
|
||||
platform = espressif8266@^2
|
||||
board = esp8285
|
||||
lib_deps =
|
||||
${com-esp.lib_deps}
|
||||
|
||||
Reference in new issue
Block a user