I’ve been on a journey to integrate some no-name smart plugs into my Home Assistant setup, and I wanted to share my experience in case it helps others. These plugs are Alexa compatible and offer energy monitoring, which I find really useful. However, I was initially unsure if they were Matter or Zigbee compatible, which is why I decided to dive into this project.
First, I set up an MQTT broker on my Raspberry Pi alongside Home Assistant. I then configured an ESP32 as an MQTT publisher to send sensor data. I added the following code to my configuration.yaml to test the integration:
yaml
mqtt:
sensor:
- name: “ESP32-pin 25-Volts”
state_topic: “studio/test/pin25”
unit_of_measurement: “Volts”
payload_available: “online”
payload_not_available: “offline”
force_update: true
The challenge was ensuring that the last value wouldn’t persist on the dashboard when the ESP32 went offline. After some research, I realized that adjusting the availability_topic and ensuring the broker properly handles offline states was key.
For the smart plugs themselves, I discovered that while they aren’t natively supported by all integrations, using the MQTT protocol allowed me to bridge their functionality into Home Assistant. This meant I could monitor energy consumption and control them through the dashboard.
I also explored using virtual switches and input booleans to control my automations. For instance, I set up a humidity sensor and relay switch combination to automatically turn on a dehumidifier when humidity exceeds 30% and turn it off when it drops below 20% for 10 minutes. Adding a virtual switch to toggle this automation was a great way to add flexibility.
One thing I learned is the importance of testing and documentation. I kept a log of my trials and errors, which helped me troubleshoot issues like the ESP32 going offline. I also found the Home Assistant community forums invaluable for getting advice and sharing my progress.
In the end, integrating these devices was a mix of trial and error, but it’s been incredibly rewarding to see everything working seamlessly. If anyone has questions or wants to share their own integration tips, I’d love to hear from you!