Are you looking to create a centralized solution to connect to Bluetooth devices and collect their sensor data in Home Assistant? Alex, one of our customers, recently shared his experience using our ESPGateway and ESPHome to do just that. He set up the device as a Bluetooth proxy and successfully collected air quality data from multiple BLE sensors in his apartment. Let’s dive into how Alex achieved this and learn from his journey.
Alex’s Setup: Overview and Challenges
Alex began with the Bluetooth Proxy project provided by ESPHome. This ready-made solution allowed him to set up the ESPGateway as a Bluetooth proxy with networking via Wi-Fi. However, Alex wanted a more robust and reliable connection using Ethernet instead of Wi-Fi, especially for a centrally placed device in his apartment.
Here’s where things got interesting. Alex encountered some challenges while configuring Ethernet, particularly around understanding the correct pin mappings for the hardware. But instead of giving up, he found inspiration in the OpenMQTTGateway project, which natively supports the ThingPulse ESPGateway and provides helpful configuration examples.
Finding the Solution: Combining ESPHome and OpenMQTTGateway Insights
To solve the Ethernet configuration issue, Alex turned to the OpenMQTTGateway repository. He found a specific environment configuration that included the necessary Ethernet setup for the ESPGateway.
Using this as a reference, Alex adapted the default ESPHome Bluetooth Proxy configuration to include Ethernet instead of Wi-Fi. Here’s the final ESPHome YAML configuration that worked for him:
esphome:
name: esp32-bluetooth-proxy-626540
friendly_name: Bluetooth Proxy 626540
min_version: 2024.6.0
name_add_mac_suffix: false
esp32:
board: esp32dev
framework:
type: esp-idf
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO16_OUT
phy_addr: 0
power_pin: GPIO5
api:
encryption:
key: <redacted>
logger:
ota:
- platform: esphome
id: ota_esphome
esp32_ble_tracker:
scan_parameters:
active: false
bluetooth_proxy:
active: true
button:
- platform: safe_mode
id: button_safe_mode
name: Safe Mode Boot
- platform: factory_reset
id: factory_reset_btn
name: Factory reset
Key Takeaways and Additional Notes
- Ethernet vs. Wi-Fi
Alex noted that only one networking component (either Ethernet or Wi-Fi) can be active at a time in ESPHome. For his use case, Ethernet was the better choice due to its reliability and his centralized device placement. - Hardware-Specific Configurations
The pin mappings for the Ethernet component were derived from the OpenMQTTGateway project. If you’re setting up your ESPGateway, make sure to check similar repositories for detailed pin configurations tailored to your hardware. - Status LEDs
Alex didn’t configure the status LEDs on his device but mentioned that this is something you can explore further if needed.
The Result: Seamless Integration with Home Assistant
With his ESPGateway configured as an Ethernet-based Bluetooth proxy, Alex was able to collect sensor data from all his BLE air quality monitors and make it available in Home Assistant. The setup worked flawlessly, and Alex was thrilled with the outcome, calling it a “great product, highly recommended!”
Why This Matters
This example highlights the power of the ESPGateway combined with ESPHome’s flexibility. Whether you’re a home automation enthusiast or a professional looking for reliable Bluetooth data collection, the ability to adapt and integrate with other projects like OpenMQTTGateway can be a game-changer.
If you’re inspired by Alex’s journey, consider trying it yourself. Whether you opt for Ethernet or Wi-Fi, the ESPGateway is a robust solution for enhancing your smart home setup.
Let us know if you have any questions or need help configuring your device! We’d love to hear about your projects and how you’re using the ESPGateway in creative ways.