Add support for FiF LE-01MR energy meter

Add support for FiF LE-01MR energy meter by saper-2 (#7584)
This commit is contained in:
Theo Arends 2020-02-10 15:18:11 +01:00
parent b5c1da91fe
commit af63bb363d
8 changed files with 84 additions and 27 deletions

View File

@ -98,3 +98,4 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- Add BootCount Reset Time as BCResetTime to ``Status 1``
- Add ``ZbZNPReceived``and ``ZbZCLReceived`` being published to MQTT when ``SetOption66 1``
- Add optional Wifi AccessPoint passphrase define WIFI_AP_PASSPHRASE in my_user_config.h (#7690)
- Add support for FiF LE-01MR energy meter by saper-2 (#7584)

View File

@ -11,6 +11,7 @@
- Add BootCount Reset Time as BCResetTime to ``Status 1``
- Add ``ZbZNPReceived``and ``ZbZCLReceived`` being published to MQTT when ``SetOption66 1``
- Add optional Wifi AccessPoint passphrase define WIFI_AP_PASSPHRASE in my_user_config.h (#7690)
- Add support for FiF LE-01MR energy meter by saper-2 (#7584)
### 8.1.0.5 20200126

View File

@ -563,9 +563,10 @@
//#define USE_SOLAX_X1 // Add support for Solax X1 series Modbus log info (+3k1 code)
#define SOLAXX1_SPEED 9600 // Solax X1 Modbus RS485 serial speed (default: 9600 baud)
#define SOLAXX1_PV2 // Solax X1 using second PV
//#define USE_LE01MR // Add support for F&F LE-01MR modbus energy meter
#define LE01MR_SPEED 9600 // LE-01MR modbus baudrate (9600 default) (+2k code, +36 RAM)
#define LE01MR_ADDR 1 // LE-01MR modbus address (0x01 default)
//#define USE_LE01MR // Add support for F&F LE-01MR Modbus energy monitor (+1k code)
#define LE01MR_SPEED 9600 // LE-01MR modbus baudrate (default: 9600)
#define LE01MR_ADDR 1 // LE-01MR modbus address (default: 0x01)
// -- Low level interface devices -----------------
#define USE_DHT // Add support for DHT11, AM2301 (DHT21, DHT22, AM2302, AM2321) and SI7021 Temperature and Humidity sensor (1k6 code)

View File

@ -411,10 +411,10 @@ void CmndStatus(void)
if ((0 == payload) || (4 == payload)) {
Response_P(PSTR("{\"" D_CMND_STATUS D_STATUS4_MEMORY "\":{\"" D_JSON_PROGRAMSIZE "\":%d,\"" D_JSON_FREEMEMORY "\":%d,\"" D_JSON_HEAPSIZE "\":%d,\""
D_JSON_PROGRAMFLASHSIZE "\":%d,\"" D_JSON_FLASHSIZE "\":%d,\"" D_JSON_FLASHCHIPID "\":\"%06X\",\"" D_JSON_FLASHMODE "\":%d,\""
D_JSON_FEATURES "\":[\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\"]"),
D_JSON_FEATURES "\":[\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\"]"),
ESP.getSketchSize()/1024, ESP.getFreeSketchSpace()/1024, ESP.getFreeHeap()/1024,
ESP.getFlashChipSize()/1024, ESP.getFlashChipRealSize()/1024, ESP.getFlashChipId(), ESP.getFlashChipMode(),
LANGUAGE_LCID, feature_drv1, feature_drv2, feature_sns1, feature_sns2, feature5);
LANGUAGE_LCID, feature_drv1, feature_drv2, feature_sns1, feature_sns2, feature5, feature6);
XsnsDriverState();
ResponseAppend_P(PSTR(",\"Sensors\":"));
XsnsSensorState();

View File

@ -519,4 +519,48 @@ void GetFeatures(void)
// feature5 |= 0x40000000;
// feature5 |= 0x80000000;
/*********************************************************************************************/
feature6 = 0x00000000;
// feature6 |= 0x00000001;
// feature6 |= 0x00000002;
// feature6 |= 0x00000004;
// feature6 |= 0x00000008;
// feature6 |= 0x00000010;
// feature6 |= 0x00000020;
// feature6 |= 0x00000040;
// feature6 |= 0x00000080;
// feature6 |= 0x00000100;
// feature6 |= 0x00000200;
// feature6 |= 0x00000400;
// feature6 |= 0x00000800;
// feature6 |= 0x00001000;
// feature6 |= 0x00002000;
// feature6 |= 0x00004000;
// feature6 |= 0x00008000;
// feature6 |= 0x00010000;
// feature6 |= 0x00020000;
// feature6 |= 0x00040000;
// feature6 |= 0x00080000;
// feature6 |= 0x00100000;
// feature6 |= 0x00200000;
// feature6 |= 0x00400000;
// feature6 |= 0x00800000;
// feature6 |= 0x01000000;
// feature6 |= 0x02000000;
// feature6 |= 0x04000000;
// feature6 |= 0x08000000;
// feature6 |= 0x10000000;
// feature6 |= 0x20000000;
// feature6 |= 0x40000000;
// feature6 |= 0x80000000;
}

View File

@ -79,6 +79,7 @@ unsigned long feature_drv2; // Compiled driver feature map
unsigned long feature_sns1; // Compiled sensor feature map
unsigned long feature_sns2; // Compiled sensor feature map
unsigned long feature5; // Compiled feature map
unsigned long feature6; // Compiled feature map
unsigned long serial_polling_window = 0; // Serial polling window
unsigned long state_second = 0; // State second timer
unsigned long state_50msecond = 0; // State 50msecond timer

View File

@ -16,6 +16,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef USE_ENERGY_SENSOR
#ifdef USE_LE01MR
/*********************************************************************************************\
@ -248,7 +249,6 @@ void FifLEShow(bool json)
char total_active_chr[FLOATSZ];
dtostrfd(Le01mr.total_active, Settings.flag2.energy_resolution, total_active_chr);
if (json) {
ResponseAppend_P(PSTR(",\"" D_JSON_TOTAL_ACTIVE "\":%s,\"" D_JSON_TOTAL_REACTIVE "\":%s"),
total_active_chr, total_reactive_chr);

View File

@ -192,7 +192,16 @@ a_features = [[
"USE_SONOFF_SC","USE_SONOFF_RF","USE_SONOFF_L1","USE_EXS_DIMMER",
"USE_ARDUINO_SLAVE","USE_HIH6","USE_HPMA","USE_TSL2591",
"USE_DHT12","USE_DS1624","USE_GPS","USE_HOTPLUG",
"USE_NRF24","USE_MIBLE","USE_HM10","",
"USE_NRF24","USE_MIBLE","USE_HM10","USE_LE01MR",
"","","",""
],[
"","","","",
"","","","",
"","","","",
"","","","",
"","","","",
"","","","",
"","","","",
"","","",""
]]
@ -227,7 +236,7 @@ else:
obj = json.load(fp)
def StartDecode():
print ("\n*** decode-status.py v20200207 by Theo Arends and Jacek Ziolkowski ***")
print ("\n*** decode-status.py v20200210 by Theo Arends and Jacek Ziolkowski ***")
# print("Decoding\n{}".format(obj))