How do you reset an installed switch?
Opened this issue · 8 comments
I have a RGB switch installed and it was working just fine. Then my WiFi power got turned off. When that happened, the little LED on the RGB switch started blinking red. When the WiFi came back on, the switch's little LED continued blinking red and I count connect to its IP, nor was the switch broadcasting an access point. I tried power cycling the switch (via the power circuit it's on circuit breaker), and that didn't change anything. Also, the switch seems to be stuck in "always on" mode.
Is there are way to reset the switch without completely removing it from the wall?
How up to date is the switch? An updated switch should put the AP back up if you hold the button down for 30 seconds. Does your new Wi-Fi network have the exact same credentials as the old one? Does it have 2.4 GHz with those credentials?
@bkaufx Yeah, the 30 second hold did the trick. I got the AP and reset the credentials. I have create a 2.4 GHz-only SSID for my IOT in my house, so the credential it originally had should hd been fine.
On a possibly related note, when I did the power cycle I described above, I noticed this and other RGB switches I have lost some of their other settings, specifically the Office Switch Relay Config
was reset to Always On
and Office Switch Button Config
was reset to Toggle on Single Press
. Is settings change expected behavior?
OK this issue (the switch just reseting itself and losing WiFi connection) just happened to me again. This time I was sitting in my office where the switch was at the time, it happened without a power outage or wifi outage occurring. It reverted to AP mode. I think I may have a clues to what is happening now.
When I connected to the switch's AP, it gave me the list of viewable SSIDs. It listed my IOT SSID twice. I do have two access points (they are Unifi Ads set to roaming mode). So, does the underlying software handle AP roaming correctly? I am guessing for what ever reason, a romain handoff happened for the switch between my two wifi APs and this triggered the problem.
Any, the switch then never connects. I can connect to the switch's AP, and it has both the hard code credentials from my building the software in ESPhome, and the software-configured credentials I enter, and it still doesn't connect to the WiFi. Any idea here?
The software version I have on the device is 1.335(y).
You might try setting fast_connect: false
in the wifi:
section of your yaml as in the example below. It will change the way the switch connects to multi-AP networks. I'm not really sure how this would help since it should be connecting fine either way, but something to try.
Your multi-AP shows up as two networks since it is seen as two networks with the same SSID. What the device does when it sees that depends on fast_connect. If true, it connects to the first one it sees without taking time to do a scan, so it would never see there are two in the first place (this is default since I turned on fast_connect by default). If fast_connect is false, the switch does a scan and connects to whichever has the higher signal strength. Maybe the scan from disabling fast_connect will cause the switch to reconnect. Does your Wi-Fi network change its mac periodically or something? With fast_connect true, the switch may get locked into a mac address it wants to connect to and never reconnect if it doesn't see the mac come back.
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: false
Logs might help but it can be a challenge to get them at the time when the error occurs, and impossible to get over wifi if the switch is not connected to wifi. One thing you may be able to try is to use the esphome command to output logs to a text file in a background process that just runs forever until the error occurs.
Might also be interesting to see if just resetting the plug gets the plug to successfully reconnect to wifi. Might have to toggle breaker for that unfortunately. Were you able to hold the switch 30 seconds and get the switch back on your network again?
I'll let you know if I think of anything else.
I'll try that, but one update here ... after about 15, maybe 20 minutes, the unit reconnected to the original WiFi again on its one. But then the Relay Config changed itself to "always on" and the Button Config changed itself to "Toggle on Release" (the same problem I describe above). Strangely, I could reconfigure these settings in Home Assistant, but I couldn't connect directly to the device's web UI to change the setting. The browser is saying the connection was refused.
I was not able to add fast_connect
setting as you suggest because the upload timed out:
INFO Successfully compiled program.
INFO Connecting to 192.168.2.81
INFO Uploading /config/.esphome/build/switch-office/.pioenvs/switch-office/firmware.bin (533728 bytes)
INFO Compressed to 365524 bytes
Uploading: [======= ] 11%
ERROR Error sending data: timed out
After that time out, it would seem the device reset, as everything worked perfectly from there (the web ui, the settings, etc). However, the " Relay Config" and the "Button Config" got changed yet again.
It would seem the device gets itself into some sort of bad state that clears out on a complete reboot. Product idea: add a reset button to the device ;-)
I so I went through an updated all my switches (I have a number) with the fast_connect
. It is worth noting two strange things:
- Some (not all) reset the " Relay Config" and the "Button Config" settings as described previously.
- Some (not all) would not let me visit the web UI and instead imitated some sort of download in response to my browser visit to the switch's IP. For these cases, I successfully used Home Assistant to reconfigure the options that got changed as described in number 1 (above).
BTW, my full version information is:
Firmware version 1.335(y) made using [ESPHome](https://esphome.io/) version 2023.2.0.
I notice your office release is based on ESPHome v 2022.11.1. I wonder if anything changed since then such that your config doesn't work. I do notice in =ESPhome's release listing that they have had breaking changes since then.
Is there a way to lock the ESPhome version used when building a config?
This just keeps on happening on about a daily basis. The switch looses its wifi connection and reverts to AP mode. I re-enter the wifi credentials, and it reconnects but now that it is reconnected I cannot connect to the switch's web UI. Nonetheless, it does reconnect to Home Assistant just fine and I can control it through Home Assistant even though I cannot connect to the switch's web UI directly.
OK, I think have narrowed in on a root cause via elimination. As highlighted before, it would seem my multi-AP WiFi environment is creating issues for the RGB switch when the switch "roams" from one AP to another.Since I an using a Unifi WiFi setup, can can lock a given wifi client to a specific AP in the Unifi controller. I've done this and I have had no further problems (as described above) with this RGB switch. While this experiential rather than conclusive evidence, I will say I was having daily problems with this switch until I locked it to a single AP.