[mqtt.espmilighthub] Fix things do not come ONLINE if MQTT Client Status Topic not supplied. (#14877)

* Update readme and add new thing status message.


Signed-off-by: Matthew Skinner <matt@pcmus.com>
This commit is contained in:
Matthew Skinner 2023-05-19 21:53:43 +10:00 committed by GitHub
parent 4d811691e9
commit 39e285257e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -42,6 +42,9 @@ Leave this blank.
**mqtt_state_topic_pattern:**
`milight/states/:device_id/:device_type/:group_id`
**MQTT Client Status Topic:**
`milight/status`
**group_state_fields:**
IMPORTANT: Make sure only the following are ticked:

View File

@ -487,7 +487,7 @@ public class EspMilightHubHandler extends BaseThingHandler implements MqttMessag
updateStatus(ThingStatus.ONLINE);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
"Milight Hub is not connected to your MQTT broker.");
"Waiting for 'milight/status: connected' MQTT message to be sent from your ESP Milight hub.");
}
} else {
try {
@ -537,6 +537,8 @@ public class EspMilightHubHandler extends BaseThingHandler implements MqttMessag
return;
}
this.connection = connection;
updateStatus(ThingStatus.UNKNOWN, ThingStatusDetail.CONFIGURATION_PENDING,
"Waiting for 'milight/status: connected' MQTT message to be received. Check hub has 'MQTT Client Status Topic' configured.");
connection.subscribe(fullStatesTopic, this);
connection.subscribe(STATUS_TOPIC, this);
}