diff --git a/lib/controller.js b/lib/controller.js index e13fce3e7..225bde039 100644 --- a/lib/controller.js +++ b/lib/controller.js @@ -550,10 +550,10 @@ class Controller { const callback = (error) => { // Devices do not report when they go off, this ensures state (on/off) is always in sync. - if (!error && key.startsWith('state')) { + if (!error && (key.startsWith('state') || key === 'brightness')) { const msg = {}; - const _key = topicPrefix ? `${key}_${topicPrefix}` : key; - msg[_key] = json[key]; + const _key = topicPrefix ? `state_${topicPrefix}` : 'state'; + msg[_key] = key === 'brightness' ? 'ON' : json['state']; this.mqttPublishDeviceState(device, msg, true); } };