Hi @nldroid, yes I did manage to get it working. Thank you for your automation, I tried it and it worked fine, except light does not switch off completely. I am using Ikea dimmer with Ikea light.
Here is my automation:
- alias: Ikea Dimmer 2 trigger: - platform: state entity_id: sensor.ikea_dimmer action: - service: mqtt.publish data_template: topic: zigbee2mqtt/ikea_light_1/set payload_template: > {% if is_state('sensor.ikea_dimmer', '0') %} {"state":"OFF"} {% else %} {"state":"ON","brightness": {{ states("sensor.ikea_dimmer") }} } {% endif %}`