SwitchBot bot/curtain/meter/contact/motion MQTT ESP32 bridge - Local control

Hi,
Do you know what is this error about? Trying to update to V.6


C:\Users\Duc\Documents\Arduino\SwitchBot-BLE2MQTT-ESP32\SwitchBot-BLE2MQTT-ESP32.ino: In function 'void setup()':

SwitchBot-BLE2MQTT-ESP32:1744:5: error: 'whiteListAdd' is not a member of 'NimBLEDevice'

     NimBLEDevice::whiteListAdd(NimBLEAddress(anAddr));

SwitchBot-BLE2MQTT-ESP32:1758:5: error: 'whiteListAdd' is not a member of 'NimBLEDevice'

     NimBLEDevice::whiteListAdd(NimBLEAddress(anAddr));

SwitchBot-BLE2MQTT-ESP32:1772:5: error: 'whiteListAdd' is not a member of 'NimBLEDevice'

     NimBLEDevice::whiteListAdd(NimBLEAddress(anAddr));

SwitchBot-BLE2MQTT-ESP32:1786:5: error: 'whiteListAdd' is not a member of 'NimBLEDevice'

     NimBLEDevice::whiteListAdd(NimBLEAddress(anAddr));

SwitchBot-BLE2MQTT-ESP32:1800:5: error: 'whiteListAdd' is not a member of 'NimBLEDevice'

     NimBLEDevice::whiteListAdd(NimBLEAddress(anAddr));

Multiple libraries were found for "WiFiClient.h"

 Used: C:\Users\Duc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\libraries\WiFi

 Not used: D:\x86\Arduino\libraries\WiFi

exit status 1

'whiteListAdd' is not a member of 'NimBLEDevice'

I got the sameā€¦update your Arduino library, that should sort it. :slight_smile:

update ā€œNimBLE-Arduinoā€ library that is.

1 Like

ok. Yea, it has been awhile since I updated any of the libraries. Just updated the NimBLEDevice v1.31 and no errors after compiling.

if you dont have contact or motion sensor, v5.2 is a solid version

v6.0 just came out and I donā€™t own contact sensors or motion sensor but got confirmation things were working from someone that does. the code needed some big changes to scan all the time. v6.0 seems to be running without issues though

the only changes in v6 for other devices would be an esp32 rssi wifi value, new HA icons and a low battery warning error

ya sorry. forgot I updated those libraries that gave some new features

the only changes for other devices would be an esp32 rssi wifi value, new HA icons and a low battery warning error

This change is in V6 and not v5.2??

correct. in v6

Thank you

Nice seeing Esp32 wifi link quality.

I seem to have a issue with my Meter now since upgrading to v6. 0, only seem to be populating battery and Humidity entities! No temperature and rssi link.
Tried the usual device removal in HA and reboot of espā€¦

I am picking up temp/rssi messages on the attributes topics though.

  • Received 7:36:37

    • QoS: 0
    • Payload:

rssi: -44
scale: c
batt: 30
C: 23.1
F: 73.6
hum: 52

I donā€™t think anything changed for meter but Iā€™ll take a look later if you are still having issues. If you are getting the attributes messages then looks like it is an MQTT discovery thing.

when the esp boots up look for the MQTT discovery message on topic homeassistant/#

I have had it where I needed to reboot HA to fix discovered devices before. give HA a reboot also

Hi devWaves,

Yeh still having issues even after multiple HA reboots, addon restarts. Only Battery/Humidity entities appear.
If you wouldnā€™t mind double checking code.

When I get home Ill look into deeper, could just be my ever growing setup.

Thanks

ya not sure. I just tried with v6 and meter works for me. I had to fake a meter though, but it shouldnā€™t matter. HA auto discovers no problem. The values donā€™t make sense so ignore those in the screenshotā€¦

**edit: wait ya I found an issue where it isnā€™t updating meter as frequently as it should. I will fix that tonight

you shouldnā€™t be having an issue with auto discovery though. That part is working for me, I am just not sending the data every 60 seconds like it should. The data is only being sent when another device triggers the scan. Should be an easy fix. I will release a v6.1

At the very least you see get meter updates after an ESP32 reboot

Cool WD!

Very weird with the discovery thing. Ill try your updated version and re flash to see what it does.

I did set my meter for a 30 second scanā€¦I think.

Iā€™ve been using this ā€œappā€ for a few months with my Curtain Bots. Works really well (apart from some annoying issues with the Curtain Bots themselves). :slight_smile:

@devWaves:

  1. Would it be possible for you to create releases on Github if a new version is available? Itā€™s easier to watch for Releases on Github rather than all repo changes or this topic.
  2. Is it possible to somehow separate the user-configurable settings from the source?
    As long as no new variables are introduced that are mandatory / do not have a default value this should make upgrading a lot easier.

@syphernl

  1. ya I can add a release tag
  2. I havenā€™t separated the files because of that reason. I am still adding new variables and donā€™t want people to have issues mixing up files etc. When switchbot releases documentation for new devices I need new variables. In v6 I actually just fixed some variables by adding ā€˜constā€™ to save memory. Diagnosing those issues with someone elseā€™s setup would be a pain for me. 1 file makes it simple.

Hiya,

I have gone backwards to v5.2 and all looks good now, entities showing and data is updating using meter and bots.

Looks good usingā€¦

Who knows, could be something wrong in the code or something I did differently while uploading.

image

**When v6.1 is ready Iā€™ll give it a go, tempted to try again with v6.0 to see what happensā€¦ :wink:

edit: wait ya I found an issue where it isnā€™t updating meter as frequently as it should. I will fix that tonight

The code by default, does a scan every minute for the meter bot? I thought it does not and I have been add`ing it manually from here. I do not need it?

static std::map<std::string, int> botScanTime = {
  { "meter", 180 }
};

@duceduc

Are you on v6.0 and seeing any issue with your meter?

Im adding a 30 sec scan Interval to my meter but I do not think it makes any difference.
You are right, default seems to scan every minute, with temperature its clear to see.

I am on V6.0 and I donā€™t think I am having any issue as you described above. Though I had manually created mqtt sensors for batteries in the pass and now since it has been added by default, I noticed there are 2 sensors with same names. Anyways, I will fix this. Here is my meter. Seems ok and all there. The firmware maybe an issue. The other unknown maybe normal since the meter does not support it?

The firmware maybe an issue.

Looking into some more, I did not see setting where it shows the firmware, holdsec, etc.
2021-09-22_7-25-55

Must be something odd going on with discovery on v6.0.
Because youā€™ve manually created your entities, your device looks so different to mine, LoL.