Zigbee2Mqtt IKEA Tradfri control elements

I have recently bought some IKEA Tradfri light bulbs and some IKEA Tradfri smart plugs, which I have integrated into Home Assistant via Zigbee2mqtt and Mosquitto. The problem that I am facing is that I don’t get very useful control elements in Home Assistant. I can only control the power-on behavior for both the light bulbs and the smart plugs. That means that right now, I can only control these devices either in the Zigbee2mqtt web interface or through MQTT publishes, which is not really elegant.

Did I miss something, or is this the way that it is supposed to work? What’s the best way to get the control elements so I can see the current status and control my devices through the dashboard?

I run everything (Home Assistant, Mosquitto, Zigbee2mqtt) in Docker.

Any help is very much appreciated.

converted from ZHA to Zigbee2mqtt yesterday and got the same problem, control is there in the zigbee2mqtt though.

Is the MQTT integration added to your Home Assistant installation?
The MQTT integration will autodiscover the devices from Z2M and add them as entities which you can use on your dashboards.

Yes, the MQTT integration is added to Home Assistant, and the devices are being discovered, but the default entities don’t offer things like switching on, switching off, or setting brightness.

I’ve already solved my problem with the bulbs. When I add the following chunk to configuration.yaml, the bulbs work like a charm:

    schema: json
    name: rgb01
    state_topic: "zigbee2mqtt/rgb01"
    command_topic: "zigbee2mqtt/rgb01/set"
    brightness: true
    color_mode: true
    supported_color_modes: ["rgb"]

However, I haven’t solved the problem with the smart plugs quite yet. When I add the following to configuration.yaml, I can switch the plug on and off, but for some reason, Home Assistant is not able to determine the current state of the switch (it shows “unknown”). I can see that switching it on and off is working in the Z2M web interface.

    unique_id: plug01
    name: Klima
    state_topic: "zigbee2mqtt/plug01"
    command_topic: "zigbee2mqtt/plug01/set"
    payload_on: "ON"
    payload_off: "OFF"
    state_on: "ON"
    state_off: "OFF"
    optimistic: false

Strange, I get all control elements by default…
I have at least 4 different trådfri bulb versions and also switches.
Using latest versions of Mosquitto and zigbee2mqtt.
What zigbee controller do you use? (but if it work inside zigbee2mqtt it should work in home assistant)

I have around 30 devices in Z2M and all the controll entities automatically show up in HA

If I understood your first post correctly you run everything in docker. Have you configured Z2M tonsend the auto discovery topics to Home Assistant like described here:

1 Like

I’ve found the problem: I just updated HA from 2023.4.0 to 2023.11.1 and everything is working as expected without any additional configuration in configuration.yaml.

Thank you for your time.