-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switchbot Curtain intermittently going unavailable for less than a second #107
Comments
This is caused by the MQTT "offline" message being received on the lastwill topic Are u using the default MQTT user Id or did you create one specifically for switchbot? if you didnt create one for the esp32 switchbot I would suggest trying that |
Thanks @devWaves |
Here's a snippet of the mqtt info which I believe proves I'm on the right switchbot user(?). In my MQTT setup:
The ring devices have always seemed solid. Eufy on the other hand isn't as solid, and having a look at the last 24hrs, there is one short 'unknown' state on the Eufy device, within 60 seconds of the Switchbot's last 'unknown' state too. |
This doesn't exactly show that you are using a dedicate switchbot userId/password. It just shows you are using the 'switchbot' topic Do you have a new HA account created and you configured these values in the esp32 code ?
the issue is that something is happening with MQTT that disconnects the esp32 temporarily. Sometimes a fresh MQTT install can also fix random issues. This would also happen if the esp32 looses wifi temporarily |
I am using a MQTT user/password unique to this switchbot esp32 yes. I can't exactly rule the wifi out I suppose, but it is sitting about a metre away from the nest wifi, and I haven't noticed any issues on other wifi devices. I'd happily pull some logs off either the esp or MQTT if it'd help. Any particular logs/files you think would be worth checking, please let me know. |
You said ypu are using a nest wifi? do ypu have multiple routers in a mesh? it might be disconnecting from one and connecting to the other not sure if you van with the nest wifi, but some/most mesh routers you can bind a mac address to only connect to one of the routers another option is to change this line of the code
to this
HA is expecting 'offline' to be sent. You can manually send that yourself if you haven't heard from a device in awhile. This will stop the unavailable devices |
I do have a nest mesh (1 nest router, 1 nest 'puck' and an older google wifi)! |
Binding to a particular router seems to be more of a client concern, at least for Nest's system. @devWaves feel free to tell me to get lost, but would you happen to know if I could slap in a BSSID on this line for one of my routers?: I see it's an optional param, and from what I understand, it would only connect to the BSSID I specify: https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/station-class.html#begin Perhaps a feature addition (adding an optional BSSID to the config) for this repo for others on Mesh networks. I don't mind being a guinea pig if you think that's worth trying (I should get time this week). |
hey. no problem. most likely that is the cause then. so I did see that bssid setting, but the line of code you mentioned is only really a starter for the wifi (somewhat redundant). Feel free to try it out though and see if it helps. The wifi connection is actually maintained by the espmqttclient library. Maybe worth asking them to update and add bssid as an option https://github.com/plapointe6/EspMQTTClient and then I can update code from there |
I have an esp32 (AZ-delivery) working well with two switchbot curtains (paired).
It's less than a metre away from the curtain bots.
I haven't actually noticed any functional issues yet, but I can see it's registering as unavailable a few times throughout the day.
The link quality seems good, and I'm not having any other network issues that'd cause this as far as I'm aware.
I'm actually not 100% on how best to debug this, I can't see any logs relating to esp/Mqtt in home assistant.
Any help debugging would be much appreciated!
The text was updated successfully, but these errors were encountered: