diff --git a/sonoff/xsns_53_sml.ino b/sonoff/xsns_53_sml.ino index 77c88bd36..4b74e7d73 100644 --- a/sonoff/xsns_53_sml.ino +++ b/sonoff/xsns_53_sml.ino @@ -847,13 +847,15 @@ uint8_t Serial_peek() { return meter_ss[num-1]->peek(); } +uint8_t sml_logindex; + void Dump2log(void) { int16_t index=0,hcnt=0; uint32_t d_lastms; uint8_t dchars[16]; - if (!SML_SAVAILABLE) return; + //if (!SML_SAVAILABLE) return; if (dump2log&8) { // combo mode @@ -898,7 +900,25 @@ uint8_t dchars[16]; } } } else { - //while (SML_SAVAILABLE) { + if (meter_desc_p[(dump2log&7)-1].type=='o') { + // obis + while (SML_SAVAILABLE) { + char c=SML_SREAD&0x7f; + if (c=='\n' || c=='\r') { + log_data[sml_logindex]=0; + AddLog(LOG_LEVEL_INFO); + sml_logindex=2; + log_data[0]=':'; + log_data[1]=' '; + break; + } + log_data[sml_logindex]=c; + if (sml_logindex0) { + if (index>2) { log_data[index]=0; AddLog(LOG_LEVEL_INFO); } } - //} - + } } // skip sml entries @@ -1750,6 +1761,7 @@ void SML_Show(boolean json) { } +/* #ifdef USE_DOMOTICZ if (json && !tele_period) { char str[16]; @@ -1761,6 +1773,7 @@ void SML_Show(boolean json) { DomoticzSensor(DZ_CURRENT, str); // Current } #endif // USE_DOMOTICZ +*/ } struct SML_COUNTER {