@Urieth I could possibly look into supporting the plug. there is documentation for it now. Not sure when ill have time to look into it, but I should be able to copy most of the bot code since I think it is just on/off and power levels.
I was hoping switchbot would send me some samples, but they haven’t contacted me back yet. I don’t have the pull like all the youtubers do to promote the products
the plug actually has an esp32 built into it that can be converted to tasmota. in theory, the plug itself could host my esp32 code while still being a plug
@neveroffline did you also remove lastmotion? they should work the same way
glad you got something working u like though. the reason I am broadcasting lastcontact is for anyone that wants to account for a contact message that could have been missed (if BLE reception is bad). BLE can work well, but has that issue with bad signal. BLE is not guaranteed delivery
I was hoping to be able to get the power usage data into home assistant too, but if by documentation you are talking about the API here (https://github.com/OpenWonderLabs/SwitchBotAPI) I don’t see that listed.
Let me know if there is anything i can do to help, am very much a noob at this stuff but should be able to follow directions
Hi. I am seeing two esp32 entry in HA. Is this correct? I only have one esp32 running. In one of the esp32, it has control with no entry. The other has sensor with rssi value.
Also, I was relying on the rssi entry to tell me if the esp32 is currently running or not. I am realizing that isn’t accurate. The state of the rssi will be the last which is just the wifi strength signal. I remember a few version back when the esp32 is disconnected to wifi, the strength is blank which is more of a real presentation of the device not connected any longer.
Would the lastwill: online be a better choice instead?
@duceduc If you used multiple esp32s and when you configured them you used ‘esp32’ as the host name this will occur. Just delete one of them if no longer used. The HA discovered esp32 device use the esp32 MAC address in the unique ID of the device
if using multiple esp32s at the same time, they need to use different host names otherwise your router will try to assign the same host name to 2 different devices and you will have issues with network connections
Yes the lastwill is the primary topic that tells you if the esp32 is connected to the MQTT broker. It is possible that you get a disconnect for a few milliseconds so you can just watch for anything longer than 5 seconds or something. When the last will message is received all devices under that esp32 will show as unavailable
the lastwill message is sent by the MQTT broker, not by the esp32. It does this when it thinks the esp32 lost connection to the broker.
Power
byte 18[0-6] Power MSB
byte 18[0-7] Power LSB
Plug Mini current power value of the load
So it is doable. I would need to treat the plug similar to the motion sensor and contact sensor as those are scanned for all the time which is what would be needed for this
@devWaves, Its been a while, thought id check some new things out. Glad your still on the ball!!
Is it still an issue regarding updating the NimBLE library component? After updating all and using v1.3.8 it appears my esp32 crashes or Bluetooth functionality breaks
Mentioned here…
This particular esp32 I’m using does have a meter attached with 4 other bots.
I guess I’m overloading the esp32 pcb with this particular library?
v1.3.1 works fine on your v6.3 code. Have not tried v1.3.1 on v6.10 though, but will try.
**
update: v1.3.1 NimBLE on v6.10 works fine with my devices, not when using v1.3.8.
Thank you for the awesome work on this @devWaves! New to this but I managed to feed some of my switchbot devices into HA and can start automation. One question though, do you have any idea why only some of the devices worked being added? I’ve 2 bots, 2 contact sensors and 2 meters, but I’m missing a bot and a contact sensor in the list
On a different note…Regarding the Switchbot device, a repair job had to be done on one of my bots today.
Think this must be a common problem, the finger coming away from the shaft (notice the crack on the end). This is my second bot that has failed on me with same problem.
hey @evnvc I see that you have devices upstairs and downstairs. BLE can have interference and may not work that far, but it can. Mine does. But my house isnt huge
best thing to try is place the esp32 close to the devices and boot it. if it finds the devices, then your configuration is good and most likely just too far where u have the esp32
Good point about the distance thing devWaves forgot about that one
Using multiple esp32’s solves my issues with that.
My coffee machine bot failed last time and the one above is for triggering blinds, this time of year it would get actioned about 4-6 times a day but has been in action for over a year… Working hard!
Weirdly enough, after another flash, it managed to find the missing sensor, but no luck on the downstair bot, even thought I’m sitting right next to it. Even renamed them all to 1 word lowercase (upbot, downbot etc) This is doing my head in
bot v6.2 firmware? anything later if available I haven’t tested with. v6.2 is the latest offering I see for bots
if you have a password set bit not in the code, it should still find it, but firmware and hold secs value cant be pulled as those require a connection+ password
It shows firmware version 4.9 in the Switchbot app . After a quick search, seems I can request newest firmware via the app? I’ve been having a hard time with the bots since buying them so perhaps this might it! many thx for the support will give this a go