diff --git a/lib/controller.js b/lib/controller.js index fb4a2be09..8e2a7a81e 100644 --- a/lib/controller.js +++ b/lib/controller.js @@ -130,7 +130,11 @@ 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 === 'state') { - this.mqtt.publish(friendlyName, JSON.stringify({state: json[key]}), true); + this.mqtt.publish( + friendlyName, + JSON.stringify({state: json[key]}), + settings.get().devices[deviceID].retain, + ); } };