Hi everyone, I wanted to share my recent experience integrating some smart home devices with Home Assistant. I’ve been using Home Assistant for a while now, but recently I decided to expand my setup by adding a couple of Tradfri power outlets and a Feit Electric RGBW bulb. While the setup process was mostly smooth, I did run into a few hiccups that I thought I’d document in case it helps anyone else.
First off, the Tradfri outlets were a breeze to set up. I used the built-in HomeKit support in Home Assistant, and they paired without any issues. The only thing that gave me a moment of pause was an error warning about the homekit-controller component not being set up properly. After a bit of research, I realized that this was just a cosmetic warning and that the devices were actually working fine. Still, it was a bit of a head-scratcher until I found some reassurance in the community forums.
The Feit Electric bulb, on the other hand, was a bit more of a challenge. I flashed it with Tasmota firmware to get more control over its features, and while it was responsive, there was a noticeable delay in the state updates within Home Assistant. I could toggle the bulb on and off, and even change colors, but the UI in Home Assistant wouldn’t always reflect the changes immediately. This was a bit frustrating at first, but after some troubleshooting, I realized it was related to how the MQTT messages were being handled.
I ended up tweaking my configuration to ensure that the state topics were being polled more frequently, which helped mitigate the issue. I also discovered that using the on_command_type setting in my MQTT configuration made a big difference in how reliably the bulb responded to commands. Here’s a snippet of the config I ended up with:
yaml
light:
- platform: mqtt
name: “Front Door Light”
command_topic: “cmnd/Front_Door_Light/POWER”
state_topic: “tele/Front_Door_Light/STATE”
state_value_template: “{{value_json.POWER}}”
availability_topic: “tele/Front_Door_Light/LWT”
brightness_command_topic: “cmnd/Front_Door_Light/Dimmer”
brightness_state_topic: “tele/Front_Door_Light/STATE”
brightness_scale: 100
on_command_type: “last”
brightness_value_template: “{{value_json.Dimmer}}”
white_value_state_topic: “tele/Front_Door_Light/STATE”
white_value_command_topic: “cmnd/Front_Door_Light/white”
white_value_scale: 100
white_value_template: “{{ value_json.Channel[3] }}”
rgb_command_topic: “cmnd/Front_Door_Light/Color2”
rgb_state_topic: “tele/Front_Door_Light/STATE”
rgb_value_template: “{{value_json.Color.split(‘,’)[0:3]|join(‘,’)}}”
effect_command_topic: “cmnd/Front_Door_Light/Scheme”
effect_state_topic: “tele/Front_Door_Light/STATE”
effect_value_template: “{{value_json.Scheme}}”
effect_list:- 0
- 1
- 2
- 3
- 4
payload_on: “ON”
payload_off: “OFF”
payload_available: “Online”
payload_not_available: “Offline”
qos: 1
retain: false
One thing I’d recommend to anyone going through a similar setup is to make sure your MQTT broker is optimized for high-frequency updates. I also found that using the last command type for on/off commands made the bulb’s state more consistent with what was being reported in Home Assistant.
Overall, I’m really happy with how everything is working now. The Tradfri outlets are seamlessly integrated into my HomeKit setup, and the Feit bulb, once I got the config dialed in, is a fantastic addition to my lighting setup. It’s been a great learning experience, and I feel more confident now in troubleshooting these kinds of issues in the future.
If anyone else has tips or tricks for optimizing MQTT-based devices in Home Assistant, I’d love to hear them! Happy automating everyone! ![]()