-
Notifications
You must be signed in to change notification settings - Fork 29
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
Tutorial: Equiva key-ble Smart Lock and Integration with Home Assistant using keyble and keyble-mqtt #50
Comments
DIRECT INTEGRATION TUTORIAL with Home Assistant for esp32 bridge device (not raspberry) can be found here |
Hi @Strange-Panda sorry for reacting so late, somehow I did not even see this GitHub issue until a few seconds ago when I got aware of it because of the posting by @mccoy88f Your tutorial seems very helpful, I would like to add it to the project. Could you maybe create a PR for it? Maybe as a file called |
Hello @oyooyo , No problem, I will review and add it in a few days. |
Or just use my esphome integration :) https://github.com/digaus/esphome-components-eqiva Btw @oyooyo I also implemented setting change. So users do not really need the app anymore. |
Ho @digaus seems that using your repo with Just esphome directly and an esp32 we can control equiva lock. |
I am posting my progress in the Mikrocontroller Forum. Still need to do some code cleanup and yeah write a readme. However there is an example yaml which you can just start with. |
Great Job! I will test it today. Do you know if, if the router restarts and then the esp32 disconnects, the esp32 tries to automatically reconnect to the wifi or if it activates fallback and gets stuck like that? |
It will try to connect back to WiFi and reboot after 15 min or you can specify the behaviour yourself. |
Equiva key-ble Smart Lock Integration with Home Assistant using keyble and keyble-mqtt
Hey there! Are you struggeling to integrate your eqiva smart lock into your smart home and control it using Home Assistant? Don't worry, there's a solution called keyble that allows you to control the Equiva key-ble Smart Lock using your computer and integrate it with Home Assistant.
This tutorial enables the integration of the Equiva key-ble Smart Lock into the Home Assistant system using keyble and keyble-mqtt. It allows you to conveniently control the door lock through the Home Assistant interface and trigger automated actions. You can lock, unlock, and open the door, as well as monitor the lock's status. However, it's important to note that the smart lock cannot handle two concurrent Bluetooth connections. If the manufacturer's official smartphone app is connected to the lock, keyble will not be able to connect to it simultaneously. Therefore, make sure to close the smartphone app for keyble to function properly.
Before we begin, I want to emphasize that making a door lock accessible over the network or the internet comes with certain security risks. If you choose to follow this guide, please be aware of the risks involved and take appropriate measures to secure your network and Home Assistant installation.
Alright, let's get started! I'll walk you through the steps on how to set up the Equiva key-ble Smart Lock with keyble and keyble-mqtt on a Raspberry Pi and integrate it with Home Assistant. Please note that you should already have a running Home Assistant instance and an MQTT broker installed. I won't cover the installation of these components in detail in this guide.
All Glory to https://github.com/oyooyo for developing key-ble!
Prerequisites
Before we begin, make sure you meet the following prerequisites:
Ensure that your Raspberry Pi is connected to the internet and update the system to have the latest updates and patches.
Installation of keyble
To install keyble, open a terminal window on your Raspberry Pi and execute the following commands:
These commands perform the following actions:
Make sure the installation process completes without any errors.
Registering a User with keyble-registeruser
To control the Equiva key-ble Smart Lock, you'll need a user ID and the corresponding 128-bit user key. Since the manufacturer's official app doesn't provide a way to retrieve this information, you'll first need to register a new user. For that, we'll use the keyble-registeruser tool.
Use the following command to register a new user:
Replace
homeassistant
with your desired username andM0123456789ABK0123456789ABCDEF0123456789ABCDEFNEQ1234567
with the information encoded in the QR code of the lock's "Key Card." Hold down the "Unlock" button until the yellow light flashes to activate the pairing mode. The tool will register the user and provide the necessary arguments you'll need to control the smart lock. If you encounter any issues with setting the name, you can cancel the action with Ctrl+C. Nevertheless, the user should still be registered, and you can verify it in the manufacturer's smartphone app.Note down the MAC address of the smart lock (
address
), the user ID (user_id
), and the user key (user_key
) provided by the keyble-registeruser tool.Installation of keyble-mqtt
keyble-mqtt is an MQTT client that allows you to control the Equiva key-ble Smart Lock via MQTT. Install keyble-mqtt by executing the following command:
Ensure that the installation completes without any errors.
Running keyble-mqtt as a Service
To run keyble-mqtt as a service on your Raspberry Pi and ensure it starts automatically on system startup, we can create a systemd service file.
Create a new file named
keyble-mqtt.service
in the directory/etc/systemd/system/
with:and insert the following content:
Make sure to replace the MAC address of the smart lock (
01:23:45:67:89:ab
) and the user data (1
andca78ad9b96131414359e5e7cecfd7f9e
) in theExecStart
line.Save the file and execute the following commands to enable and start the service:
keyble-mqtt will now run as a service and automatically start on system startup. To ensure that the service started correctly, you can use the following command:
Configuration in Home Assistant
To integrate the Equiva key-ble Smart Lock into Home Assistant, you'll need to edit the Home Assistant configuration file.
Open the
configuration.yaml
file of Home Assistant and add the following YAML code:Make sure to replace the MAC address of the smart lock (
01:23:45:67:89:ab
) in thestate_topic
andcommand_topic
properties. You can also adjust the name of the lock (Front Door
).Save the
configuration.yaml
file and restart Home Assistant to apply the configuration changes.Creating a Button Card to Control the Smart Lock
To control the Equiva key-ble Smart Lock in Home Assistant, we'll create a button card. Open the Lovelace configuration file of Home Assistant and add the following YAML code:
Ensure that you replace the MAC address of the smart lock (
01:23:45:67:89:ab
) in thetopic
properties of the button card.Save the Lovelace configuration file and refresh the Home Assistant interface. You should now see a button card that allows you to lock, unlock, and open the smart lock.
Conclusion
Congratulations! You have successfully integrated the Equiva key-ble Smart Lock with keyble and keyble-mqtt in Home Assistant. You can now control the smart lock through the Home Assistant interface and trigger automated actions. Explore further features of Home Assistant and expand your smart home control.
Enjoy controlling your Equiva key-ble Smart Lock in your smart home!
The text was updated successfully, but these errors were encountered: