How to have the normal view as Light using MQTT light?

Hi

I’m currently trying to get a group of light using MQTT light.
I defined a MQTT group into Zigbee2MQTT and get it back in HA using:

- platform: mqtt
  schema: json
  name: Livingroom Lights
  unique_id: livingroom_lights
  command_topic: zigbee2mqtt/Z2M_lights/set
  color_temp: true
  brightness: true
  effect: true
  xy: true
  brightness_scale: 254

however in the UI I have this
image
Why I didn’t have a toggle ? like others ?

Intead of this:
image

The same when I click on it (with TURN ON state):
With the Z2M group (MQTT) I have this:

And with a normal light (light group in HA) I have this:
With XY value it’s not the same display. What I miss ?

Thank you :slight_smile:

Please define the state_topic in your configuration and see.

1 Like

sory bad copy paste (remove one line without see it) , there is a state_topic:

it’s

state_topic: zigbee2mqtt/Z2M_livingroom_lights

Edit: I restarted HA and it’s appears again… I think I made a mistake but don’t know when, the state ON / OFF is fixed thank you :slight_smile:

However I didn’t have effect and xy value when the panel is open :slight_smile:

1 Like

Define xy_command_topic and xy_state_topic in the config.

Seems to not be allowed or maybe I don’t undertsand how to use it:

- platform: mqtt
  schema: json
  name: Livingroom Lights
  unique_id: livingroom_lights
  xy_command_topic: zigbee2mqtt/Z2M_livingroom_lights/set
  xy_state_topic: zigbee2mqtt/Z2M_livingroom_lights
  color_temp: true
  brightness: true
  effect: true
  xy: true
  brightness_scale: 254

Logs:
Invalid config for [light.mqtt]: [xy_command_topic] is an invalid option for [light.mqtt]. Check: light.mqtt->xy_command_topic. (See ?, line ?).

And for effects ? :slight_smile: a command topic should be added ? ON the documentation I don’t see nothing except the boolean attribute.

Sorry xy_command_topic and xy_state_topic is with default schema. I didnt notice your schema is json. Thats why you got the error. Here again I dont see the state_topic set. Try it after that. Maybe xy is not coming up as this is working in optimistic mode.

according to the doc

That why I replaced state_topic with xy_state_topic. Maybe again a misunderstood of me :wink: