diff --git a/app.js b/app.js index d43b3cff3c4..be34c2dd580 100644 --- a/app.js +++ b/app.js @@ -213,10 +213,15 @@ app.get('/health', async function (req, res) { let zwave = false if (gw) { - mqtt = gw.mqtt ? gw.mqtt.getStatus().status : false + mqtt = gw.mqtt ? gw.mqtt.getStatus() : false zwave = gw.zwave ? gw.zwave.getStatus().status : false } + // if mqtt is disabled, return true. Fixes #469 + if (mqtt) { + mqtt = mqtt.status || mqtt.config.disabled + } + const status = mqtt && zwave res.status(status ? 200 : 500).send(status ? 'Ok' : 'Error')