Closed oglodyte closed 5 years ago
It looks like device name used for MQTT discovery gets corrupt. Here is what I get in the MQTT after some time:
homeassistant/light/ARILUX_LC11_RGBWW_000EDAA8/config {"name":"Arilux LC11 RGBWW LED Controller{\"state\":\"OFF\",\"brightness\":255,\"white_value\":118,\"color\":{\"r\":245,\"g\":3,\"b\":0}}","platform":"mqtt_json","state_topic":"RGBWW/000EDAA8/json/state","command_topic":"RGBWW/000EDAA8/json/set","brightness":true,"rgb":true,"white_value":true}
instead of
homeassistant/light/ARILUX_LC11_RGBWW_000EDAA8/config {"name":"Arilux LC11 RGBWW LED Controller 000EDAA8","platform":"mqtt_json","state_topic":"RGBWW/000EDAA8/json/state","command_topic":"RGBWW/000EDAA8/json/set","brightness":true,"rgb":true,"white_value":true}
IMO the problem is char friendlyName[32]; as length of "Arilux LC11 RGBWW LED Controller 000EDAA8" is > 32
char friendlyName[32];
I simply changed it to char friendlyName[48];
char friendlyName[48];
will see if it fixes the problem.
It looks like device name used for MQTT discovery gets corrupt. Here is what I get in the MQTT after some time:
homeassistant/light/ARILUX_LC11_RGBWW_000EDAA8/config {"name":"Arilux LC11 RGBWW LED Controller{\"state\":\"OFF\",\"brightness\":255,\"white_value\":118,\"color\":{\"r\":245,\"g\":3,\"b\":0}}","platform":"mqtt_json","state_topic":"RGBWW/000EDAA8/json/state","command_topic":"RGBWW/000EDAA8/json/set","brightness":true,"rgb":true,"white_value":true}
instead of
homeassistant/light/ARILUX_LC11_RGBWW_000EDAA8/config {"name":"Arilux LC11 RGBWW LED Controller 000EDAA8","platform":"mqtt_json","state_topic":"RGBWW/000EDAA8/json/state","command_topic":"RGBWW/000EDAA8/json/set","brightness":true,"rgb":true,"white_value":true}
IMO the problem is
char friendlyName[32];
as length of "Arilux LC11 RGBWW LED Controller 000EDAA8" is > 32I simply changed it to
char friendlyName[48];
will see if it fixes the problem.