From fa4ba2f8b0195698302e7969a402291a0a9f2593 Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Thu, 3 Feb 2022 16:52:44 +0100 Subject: [PATCH] MQTT light support unknown state (#21419) --- source/_integrations/light.mqtt.markdown | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/source/_integrations/light.mqtt.markdown b/source/_integrations/light.mqtt.markdown index 2689d1e840a..823d513d5df 100644 --- a/source/_integrations/light.mqtt.markdown +++ b/source/_integrations/light.mqtt.markdown @@ -13,18 +13,18 @@ The `mqtt` light platform lets you control your MQTT enabled lights through one ## Comparison of light MQTT schemas | Function | [`default`](#default-schema) | [`json`](#json-schema) | [`template`](#template-schema) | -|-------------------|------------------------------------------------------------|----------------------------------------------------------------------|------------------------------------------------------------------------------| -| Brightness | ✔ | ✔ | ✔ | -| Color mode | ✔ | ✔ | ✘ | -| Color temperature | ✔ | ✔ | ✔ | -| Effects | ✔ | ✔ | ✔ | -| Flashing | ✘ | ✔ | ✔ | -| HS Color | ✔ | ✔ | ✔ | -| RGB Color | ✔ | ✔ | ✔ | -| RGBW Color | ✔ | ✔ | ✘ | -| RGBWW Color | ✔ | ✔ | ✘ | -| Transitions | ✘ | ✔ | ✔ | -| XY Color | ✔ | ✔ | ✘ | +| ----------------- | ---------------------------- | ---------------------- | ------------------------------ | +| Brightness | ✔ | ✔ | ✔ | +| Color mode | ✔ | ✔ | ✘ | +| Color temperature | ✔ | ✔ | ✔ | +| Effects | ✔ | ✔ | ✔ | +| Flashing | ✘ | ✔ | ✔ | +| HS Color | ✔ | ✔ | ✔ | +| RGB Color | ✔ | ✔ | ✔ | +| RGBW Color | ✔ | ✔ | ✘ | +| RGBWW Color | ✔ | ✔ | ✘ | +| Transitions | ✘ | ✔ | ✔ | +| XY Color | ✔ | ✔ | ✘ | ## Default schema @@ -33,9 +33,9 @@ The `mqtt` light platform with default schema lets you control your MQTT enabled ## Default schema - Configuration -In an ideal scenario, the MQTT device will have a state topic to publish state changes. If these messages are published with a `RETAIN` flag, the MQTT light will receive an instant state update after subscription and will start with the correct state. Otherwise, the initial state of the switch will be `false` / `off`. +In an ideal scenario, the MQTT device will have a state topic to publish state changes. If these messages are published with a `RETAIN` flag, the MQTT light will receive an instant state update after subscription and will start with the correct state. Otherwise, the initial state of the switch will be `unknown`. A MQTT device can reset the current state to `unknown` using a `None` payload. -When a state topic is not available, the light will work in optimistic mode. In this mode, the light will immediately change state after every command. Otherwise, the light will wait for state confirmation from the device (message from `state_topic`). +When a state topic is not available, the light will work in optimistic mode. In this mode, the light will immediately change state after every command. Otherwise, the light will wait for state confirmation from the device (message from `state_topic`). The initial state is set to `False` / `off` in optimistic mode. Optimistic mode can be forced, even if the `state_topic` is available. Try to enable it, if experiencing incorrect light operation.