mqtt: - light: name: AP unique_id: AP schema: template command_topic: "KC868_AP/C82E18C62428/SET" state_topic: "KC868_AP/C82E18C62428/STATE" command_on_template: > {%- if brightness is defined -%} ,{"dac1":{"value":{{(brightness / 255 * 100) | int - 1}}} {%- else -%} ,'{"dac1":{"value":99}}' {%- endif -%} command_off_template: '{"dac1":{"value":0}}' state_template: > {%- if value_json.dac1.value == 0 -%} off {%- else -%} on {%- endif -%} brightness_template: '{{(value_json.dac1.value / 99 * 255)| int}}'