]> git.basschouten.com Git - openhab-addons.git/commitdiff
[mqtt.espmilighthub] Fix things do not come ONLINE if MQTT Client Status Topic not...
authorMatthew Skinner <matt@pcmus.com>
Fri, 19 May 2023 11:53:43 +0000 (21:53 +1000)
committerGitHub <noreply@github.com>
Fri, 19 May 2023 11:53:43 +0000 (13:53 +0200)
* Update readme and add new thing status message.

Signed-off-by: Matthew Skinner <matt@pcmus.com>
bundles/org.openhab.binding.mqtt.espmilighthub/README.md
bundles/org.openhab.binding.mqtt.espmilighthub/src/main/java/org/openhab/binding/mqtt/espmilighthub/internal/handler/EspMilightHubHandler.java

index 0ced3f94524f1a3c73540334873fb8c5149dfc62..3c1af7827a8a119df3b3057ab78c91b946c3b418 100644 (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:
 
index 73e3139122ddb8e5df68ac100398412f8de117cf..48fef50fdcc4aa3c3b421035472734392d39728d 100644 (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);
         }