rospogrigio / airbnk_mqtt

MQTT control of Airbnk locks.
GNU General Public License v3.0
27 stars 6 forks source link

ESP noobie #26

Open giltabibian opened 1 year ago

giltabibian commented 1 year ago

Hi, and thanks for this integration. I'm new to ESP32 and want to get started. I have the M531 using the cloud integration with HA. Working as good but I want to use the local integration. I want to monitor the battery status. Both for the lock and the fingerprint.

Already got this device: Songhe ESP8266 NodeMCU CP2102 ESP-12E 4M Bytes Internet of Things WiFi Development Board Serial Wireless Module for Arduino IDE Micropython (1PCS) https://a.co/d/a3gYer5

Few questions:

  1. Which FW should I use? I saw there are 2 options. The tasmota and custom firmware. Which is more reliable? Because I saw there are stability issues. consider i want to monitor the battery status of the lock and fingerprint.

  2. Sorry for the next noobie question here but is there any video tutorial for step up the ESP? I'm not sure how to do that... Is there any HW perferial I need except the ESP itself? (cables, pins?) How do I connect it to RPI? Wired or wireless? Also, how do I flash the FW? OTA/cable?

Once again. Thanks for all your hard work!

formatBCE commented 1 year ago

Hey there! I guess, @rospogrigio is a bit busy lately. I can answer several of your questions.

First of all, you need different chip. ESP8266 is older chip, without Bluetooth capabilities. For gateway you'll need to use ESP32.

You may use any of gateways. Reliability is comparable. Check corresponding README sections for setting up, and choose, what looks better to you. Tasmota is a great multi-tool firmware, and there's plenty videos/topics on how to install it (you can do it via browser). My custom gateway is bundled to ESPHome custom component, so to flash it, you'll have to use ESPHome add-on. Check it's documentation, it's easy to install in Home Assistant, and it's super easy to use. Also, you won't need to setup device after initial flashing. Check YouTube for "install Tasmota" or "use ESPHome with HomeAssistant" - you'll find plenty of information.

Cheers.

giltabibian commented 1 year ago

Hi @formatBCE thanks for your eleborate answer! What about stability and compatability? Which integration is more reliable? And is there any difference about the supported features?

formatBCE commented 1 year ago

Hi @formatBCE thanks for your eleborate answer! What about stability and compatability? Which integration is more reliable? And is there any difference about the supported features?

I use my own gateway, as for me Tasmota is overkill. Didn't have any issues for last year.

Can't say about Tasmota, but it seems to be stable too.

There's no difference in functions - gateway basically just transmits data to/from HA. So all functionality depends on integration itself.

giltabibian commented 1 year ago

@formatBCE got it. Thanks for your help! ‏one last thing before I order again the wrong board. https://a.co/d/c4W5rgm Does this item looks good? Do I need anything else except the usb cable for power?

formatBCE commented 1 year ago

No, that's dev display kit. It's shield to ESP.

Take this one HiLetgo https://a.co/d/bB9zmg4 or similar, there's also amazon-promoted, 3 in pack - good enough to tinker.

And don't bother too much on gateway firmware - it's easily replaceable. :)

giltabibian commented 1 year ago

@formatBCE thanks! 🙂

rospogrigio commented 1 year ago

Don't have much to add to what @formatBCE . I am personally using the ESPHome firmware, it's very easy to install and configure and can be handled directly in HA. But as he said, you can just try the different FWs and then decide which one suits you best, I believe they are pretty similar in terms of performance. Bye!

giltabibian commented 1 year ago

@formatBCE Hi again :) I'm having some trouble with steps 3-4. I already configure the ESP and decided to go with the custom firmware: image and the mqtt broker: image

now I'm not sure exactly how to link them together. what is the process to add the topic for mqtt and link to my esphome? also, what is the best way to retrieve the lock MAC. by lock you mean the wifi gateway of the lock right? the lock itself doesn't have wifi connection.

formatBCE commented 1 year ago

Hi @giltabibian. Whoa you have a lot of questions.

  1. MAC is Bluetooth MAC of the lock, not the gateway. (Yes, Bluetooth devices also have MAC addresses). You may find it by installing nRFConnect application to your Android phone, and in list of found devices (while nearby the lock) find your lock by name. MAC will be there.
  2. I assume you got MQTT add-on, and configured it to work with HA. That's good, it works automatically - you don't need to create topic, just set up gateway and HA integration with same topic name in preferences.
  3. I suggest you to install ESPHome add-on, and proceed with instructions from https://github.com/formatBCE/Airbnk-MQTTOpenGateway#esphome-recommended
  4. HA Integration should also be configured with usage of custom gateway and same topic you'll set in ESPHome.

That's it :)

giltabibian commented 1 year ago

thanks for the detailed explanation... i was able to find the ble mac and add the custom firmware within the esphome component.

i'm not sure about two things. the mqtt broker ip (not sure i configured one) maybe it's this one? core-mosquito? or it should be actual ip? or is it my HA ip?

and also not sure about the mqtt topic. where exactly should i set the topic name in mqtt borker integration?

rospogrigio commented 1 year ago

Hey @giltabibian, I suggest you obscure some of the info you posted because most of those data are something you don't want to post on the internet, like the MAC of your lock, keys and passwords....

giltabibian commented 1 year ago

@formatBCE @rospogrigio eventually, I was able to make it work! thanks a lot for your contribution and explanation :)

one last question, is there a way to monitor also the fingerprint battery status?