Mqtt light - availabilty_topic - Online and online

Hi,

coming from here: https://github.com/arendst/Sonoff-Tasmota/issues/4652#issuecomment-447880655

I upgraded my sonoffs too 6.4.0. I use the german files and before 6.3.0 the LWT state was reported as ‘online’ and ‘offline’.
With the new version (to make it consistent with other languages, which always uses Online/Offline) the LWT state is reported with the first letter in upper case (Online, Offline).

With this change my lights became unavailable because I use the availability_topic, and this function only looks for online and offline in lower case letters.

So most of you guys won’t have the german version of tasmota and so you always hat Online/Offline.
How do you use the availability topic?

The workaround now for me is to comment out the availability topic (but this is a step back, and we all want to move forward with our smart homes)

Already found the solution.

Had to add those lines:

Had to add those lines:

    payload_available: "Online"
    payload_not_available: "Offline"

The default values are lower case.

This is the typical template I’ve used for quite some time. Just change yours to what you want/need.

switch:
  - platform: mqtt
    name: "Sonoff Basic1"
    state_topic: "stat/sonoff/POWER"
    command_topic: "cmnd/sonoff/POWER"
    availability_topic: "tele/sonoff/LWT"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: false
1 Like

Thank you! I missed that the payload_available and not available are linked to availability topic.

Works as expected (again).

After upgrade to 6.4.1, my devices constantly become unavailable in HomeAssistant. I already have “Online” and “Offline” in my configuration. It was working on 6.3.0 until I upgraded to 6.4.0 and 6.4.1

- platform: mqtt
  name: "Basement Light 1"
  state_topic: "stat/hass-1/basement/light1/POWER"
  command_topic: "cmnd/hass-1/basement/light1/POWER"
  availability_topic: "tele/hass-1/basement/light1/LWT"
  payload_on: "ON"
  payload_off: "OFF"
  payload_available: "Online"
  payload_not_available: "Offline"
  retain: false
  qos: 1

I think I have the same issue. Did not notice it before. Seems like it is only an issue of the basic’s. A TH16 doesn’t have these issues.

I have the issue with Sonoff Basic and slampher.