Fix Shelly2 monitoring

Disable serial logging on Shelly2 as serial is being used by energy monitoring (#3878)
This commit is contained in:
Theo Arends 2018-09-23 13:55:42 +02:00
parent f05fc71d67
commit 01ce1b0c91
5 changed files with 4 additions and 6 deletions

View File

@ -5,6 +5,7 @@
* Add power value below 5W to Sonoff Pow R2 and S31 (#3745)
* Add force_update to Home Assistant discovery (#3873)
* Fix rule trigger POWER1#STATE execution after restart and SetOption0 is 0 (#3856)
* Disable serial logging on Shelly2 as serial is being used by energy monitoring (#3878)
*
* 6.2.1.5 20180921
* Add authentication to HTTP web pages

View File

@ -203,7 +203,7 @@ enum LichtSubtypes {LST_NONE, LST_SINGLE, LST_COLDWARM, LST_RGB, LST_RGBW, LST_R
enum LichtSchemes {LS_POWER, LS_WAKEUP, LS_CYCLEUP, LS_CYCLEDN, LS_RANDOM, LS_MAX};
enum XsnsFunctions {FUNC_PRE_INIT, FUNC_INIT, FUNC_LOOP, FUNC_EVERY_50_MSECOND, FUNC_EVERY_100_MSECOND, FUNC_EVERY_200_MSECOND, FUNC_EVERY_250_MSECOND, FUNC_EVERY_SECOND, FUNC_PREP_BEFORE_TELEPERIOD,
FUNC_JSON_APPEND, FUNC_WEB_APPEND, FUNC_SAVE_BEFORE_RESTART, FUNC_COMMAND, FUNC_MQTT_SUBSCRIBE, FUNC_MQTT_INIT, FUNC_MQTT_DATA, FUNC_SET_POWER, FUNC_RULE_INIT_POWER, FUNC_SHOW_SENSOR,
FUNC_JSON_APPEND, FUNC_WEB_APPEND, FUNC_SAVE_BEFORE_RESTART, FUNC_COMMAND, FUNC_MQTT_SUBSCRIBE, FUNC_MQTT_INIT, FUNC_MQTT_DATA, FUNC_SET_POWER, FUNC_SHOW_SENSOR,
FUNC_RULES_PROCESS, FUNC_SERIAL, FUNC_FREE_MEM};
const uint8_t kDefaultRfCode[9] PROGMEM = { 0x21, 0x16, 0x01, 0x0E, 0x03, 0x48, 0x2E, 0x1A, 0x00 };

View File

@ -2613,10 +2613,6 @@ void setup()
SetPulseTimer(i, Settings.pulse_timer[i]);
}
}
XdrvMailbox.index = power;
XdrvCall(FUNC_RULE_INIT_POWER);
blink_powersave = power;
snprintf_P(log_data, sizeof(log_data), PSTR(D_PROJECT " %s %s (" D_CMND_TOPIC " %s, " D_FALLBACK " %s, " D_CMND_GROUPTOPIC " %s) " D_VERSION " %s-" ARDUINO_ESP8266_RELEASE),

View File

@ -366,6 +366,7 @@ void RulesEvery50ms()
if (Settings.rule_enabled) { // Any rule enabled
char json_event[120];
if (-1 == rules_new_power) { rules_new_power = power; }
if (rules_new_power != rules_old_power) {
if (rules_old_power != -1) {
for (byte i = 0; i < devices_present; i++) {
@ -628,7 +629,6 @@ boolean Xdrv10(byte function)
case FUNC_EVERY_SECOND:
RulesEverySecond();
break;
case FUNC_RULE_INIT_POWER:
case FUNC_SET_POWER:
RulesSetPower();
break;

View File

@ -614,6 +614,7 @@ void McpEverySecond()
void McpSnsInit()
{
SetSeriallog(LOG_LEVEL_NONE); // Free serial interface from logging interference
digitalWrite(15, 1); // GPIO15 - MCP enable
}