Hi,
This is not HA specific, apologies for that, but I get the feeling this is the place with the most knowledge about this problem.
I’ve installed 6 identical Sonoff basic devices in various light switches in the house. 2 of them are giving me issues, 4 are working perfectly. They’re all configured the same afaict (although at this point I’ve played with them a lot that I lost track).
This post will focus on one of them (I think the other one is a hardware/power issue).
Basically, It’ll turn off randomly.
The setup: Sonoff basic is in the wall light switch. It’s a rocker switch.
2 wires are soldered to gpio 14 (followed this vid: https://youtu.be/ab472a40-co?t=111) and are connected, one on each side, to the switch. Power is going into and out of the Sonoff.
SwitchMode, PowerRetain and PowerOnState are:
21:14:40 CMD: PowerRetain
21:14:40 RSL: Group 0, Index 1, Command POWERRETAIN, Data
21:14:40 MQT: stat/sonoff7/RESULT = {"PowerRetain":"ON"}
21:14:50 CMD: PowerOnState
21:14:50 RSL: Group 0, Index 1, Command POWERONSTATE, Data
21:14:50 MQT: stat/sonoff7/RESULT = {"PowerOnState":3}
21:17:11 MQT: tele/sonoff7/STATE = {"Time":"2018-03-04T21:17:11","Uptime":"9T10:55:15","Vcc":3.230,"POWER":"OFF","Wifi":{"AP":1,"SSId":"*****","RSSI":100,"APMac":"*****"}}
21:17:11 MQT: tele/sonoff7/SENSOR = {"Time":"2018-03-04T21:17:11","Switch1":"ON"}
21:18:32 CMD: switchmode
21:18:32 RSL: Group 0, Index 1, Command SWITCHMODE, Data
21:18:32 MQT: stat/sonoff7/RESULT = {"SwitchMode1":0}
Here are the logs from the light off incidents:
### Before I went to the kitchen, the light was off.
Mar 4 19:41:29 sonoff7-4686 ESP-MQT: tele/sonoff7/STATE = {"Time":"2018-03-04T20:41:29","Uptime":"9T10:20:15","Vcc":3.231,"POWER":"OFF","Wifi":{"AP":1,"SSId":"******","RSSI":100,"APMac":"*******"}}
Mar 4 19:41:29 sonoff7-4686 ESP-MQT: tele/sonoff7/SENSOR = {"Time":"2018-03-04T20:41:29","Switch1":"ON"}
Mar 4 19:46:34 sonoff7-4686 ESP-RSL: tele/sonoff7/STATE = {"Time":"2018-03-04T20:46:29","Uptime":"9T10:25:15","Vcc":3.234,"POWER":"OFF","Wifi":{"AP":1,"SSId":"******","RSSI":100,"APMac":"*******"}}
Mar 4 19:46:38 sonoff7-4686 ESP-RSL: tele/sonoff7/SENSOR = {"Time":"2018-03-04T20:46:34","Switch1":"ON"}
Mar 4 19:46:39 sonoff7-4686 ESP-MQT: Attempting connection...
Mar 4 19:46:39 sonoff7-4686 ESP-MQT: Connected
Mar 4 19:46:39 sonoff7-4686 ESP-MQT: tele/sonoff7/LWT = Online (retained)
Mar 4 19:46:39 sonoff7-4686 ESP-MQT: cmnd/sonoff7/POWER =
Mar 4 19:46:39 sonoff7-4686 ESP-MQT: Subscribe to cmnd/sonoff7/#
Mar 4 19:46:39 sonoff7-4686 ESP-MQT: Subscribe to cmnd/sonoffs/#
Mar 4 19:46:39 sonoff7-4686 ESP-MQT: Subscribe to cmnd/DVES_07724E/#
Mar 4 19:46:39 sonoff7-4686 ESP-RSL: Group 0, Index 1, Command POWER, Data OFF
Mar 4 19:46:39 sonoff7-4686 ESP-MQT: stat/sonoff7/RESULT = {"POWER":"OFF"}
Mar 4 19:46:39 sonoff7-4686 ESP-MQT: stat/sonoff7/POWER = OFF (retained)
Mar 4 19:51:40 sonoff7-4686 ESP-MQT: tele/sonoff7/STATE = {"Time":"2018-03-04T20:51:38","Uptime":"9T10:30:15","Vcc":3.231,"POWER":"OFF","Wifi":{"AP":1,"SSId":"******","RSSI":100,"APMac":"*******"}}
Mar 4 19:51:40 sonoff7-4686 ESP-MQT: tele/sonoff7/SENSOR = {"Time":"2018-03-04T20:51:40","Switch1":"ON"}
### Here I turned on the light manually using the rocker switch.
Mar 4 19:55:33 sonoff7-4686 ESP-MQT: stat/sonoff7/RESULT = {"POWER":"ON"}
Mar 4 19:55:33 sonoff7-4686 ESP-MQT: stat/sonoff7/POWER = ON (retained)
Mar 4 19:55:34 sonoff7-4686 ESP-CFG: Saved to flash at F9, Count 358, Bytes 1648
Mar 4 19:56:45 sonoff7-4686 ESP-RSL: tele/sonoff7/STATE = {"Time":"2018-03-04T20:56:40","Uptime":"9T10:35:15","Vcc":3.232,"POWER":"ON","Wifi":{"AP":1,"SSId":"******","RSSI":100,"APMac":"*******"}}
Mar 4 19:56:46 sonoff7-4686 ESP-RSL: tele/sonoff7/SENSOR = {"Time":"2018-03-04T20:56:45","Switch1":"OFF"}
Mar 4 19:56:47 sonoff7-4686 ESP-MQT: Attempting connection...
Mar 4 19:56:47 sonoff7-4686 ESP-MQT: Connected
Mar 4 19:56:47 sonoff7-4686 ESP-MQT: tele/sonoff7/LWT = Online (retained)
Mar 4 19:56:47 sonoff7-4686 ESP-MQT: cmnd/sonoff7/POWER =
Mar 4 19:56:47 sonoff7-4686 ESP-MQT: Subscribe to cmnd/sonoff7/#
Mar 4 19:56:47 sonoff7-4686 ESP-MQT: Subscribe to cmnd/sonoffs/#
Mar 4 19:56:47 sonoff7-4686 ESP-MQT: Subscribe to cmnd/DVES_07724E/#
Mar 4 19:56:47 sonoff7-4686 ESP-RSL: Group 0, Index 1, Command POWER, Data OFF
### Here it randomly turned off
Mar 4 19:56:47 sonoff7-4686 ESP-MQT: stat/sonoff7/RESULT = {"POWER":"OFF"}
Mar 4 19:56:47 sonoff7-4686 ESP-MQT: stat/sonoff7/POWER = OFF (retained)
Mar 4 19:56:48 sonoff7-4686 ESP-CFG: Saved to flash at F8, Count 359, Bytes 1648
### I was still in the kitchen, so I turned it back on manually.
Mar 4 19:56:51 sonoff7-4686 ESP-MQT: stat/sonoff7/RESULT = {"POWER":"ON"}
Mar 4 19:56:51 sonoff7-4686 ESP-MQT: stat/sonoff7/POWER = ON (retained)
Mar 4 19:56:52 sonoff7-4686 ESP-CFG: Saved to flash at F7, Count 360, Bytes 1648
Mar 4 20:01:46 sonoff7-4686 ESP-APP: (UTC) Sun Mar 04 20:01:46 2018, (DST) Sun Mar 25 02:00:00 2018, (STD) Sun Oct 28 03:00:00 2018
Mar 4 20:01:52 sonoff7-4686 ESP-RSL: tele/sonoff7/STATE = {"Time":"2018-03-04T21:01:47","Uptime":"9T10:40:15","Vcc":3.227,"POWER":"ON","Wifi":{"AP":1,"SSId":"******","RSSI":100,"APMac":"*******"}}
Mar 4 20:01:54 sonoff7-4686 ESP-RSL: tele/sonoff7/SENSOR = {"Time":"2018-03-04T21:01:52","Switch1":"ON"}
Mar 4 20:01:55 sonoff7-4686 ESP-MQT: Attempting connection...
Mar 4 20:01:55 sonoff7-4686 ESP-MQT: Connected
Mar 4 20:01:55 sonoff7-4686 ESP-MQT: tele/sonoff7/LWT = Online (retained)
Mar 4 20:01:55 sonoff7-4686 ESP-MQT: cmnd/sonoff7/POWER =
Mar 4 20:01:55 sonoff7-4686 ESP-MQT: Subscribe to cmnd/sonoff7/#
Mar 4 20:01:55 sonoff7-4686 ESP-MQT: Subscribe to cmnd/sonoffs/#
Mar 4 20:01:55 sonoff7-4686 ESP-MQT: Subscribe to cmnd/DVES_07724E/#
Mar 4 20:01:55 sonoff7-4686 ESP-RSL: Group 0, Index 1, Command POWER, Data OFF
### Here it randomly turned off again.
Mar 4 20:01:55 sonoff7-4686 ESP-MQT: stat/sonoff7/RESULT = {"POWER":"OFF"}
Mar 4 20:01:55 sonoff7-4686 ESP-MQT: stat/sonoff7/POWER = OFF (retained)
Mar 4 20:01:56 sonoff7-4686 ESP-CFG: Saved to flash at F6, Count 361, Bytes 1648
Mar 4 20:02:00 sonoff7-4686 ESP-MQT: tele/sonoff7/UPTIME = {"Time":"2018-03-04T21:02:00","Uptime":"9T10:40:20"}
This is only happening with this light. The rest are fine.
Its wifi signal is probably the strongest of all the other switches as it is the closest to the router.
I suspect it has something to do with the loss of connection for some reason and that line with
cmnd/sonoff7/POWER =
but not really sure what to do about that.
Thanks!