home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.2k stars 31.16k forks source link

Tasmota Devices loose their connection to HA. Previous issue now closed: 91462 #105846

Closed mmaritz closed 4 months ago

mmaritz commented 11 months ago

The problem

I have an supervised HASS.OS installation. It runs Mosquito broker as addon and all tasmota devices are using the official tasmota integration in HA. SetOption19 is 0 on all of them. https://www.home-assistant.io/integrations/tasmota

Everytime when I restart HA core (NOT the broker), all my tasmota devices became unavailable and stay so. In MQTTExplorer and the tasmota console of each device, i can see the are publishing states. Just HA is saying "unavailable" on every light, switch, sensor of every device.

image

What version of Home Assistant Core has the issue?

2023.12.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tasmota

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tasmota

Diagnostics information

https://github.com/home-assistant/core/issues/91462

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 11 months ago

Hey there @emontnemery, mind taking a look at this issue as it has been labeled with an integration (tasmota) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tasmota` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tasmota` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tasmota documentation tasmota source (message by IssueLinks)

sir-harlekin commented 9 months ago

Has there been any update on this? I guess many of us are facing the same problem without any proper solution.

rolfmcduff commented 9 months ago

I‘ve turned on MQTT message retaining and it‘s working since weeks now without any issue.

sir-harlekin commented 9 months ago

Hey there, as I just started migrating to HA and am facing this issue, could you elaborate on how and wehere to set the MQTT mesasge retaining? Thank you very much.

rolfmcduff commented 9 months ago

I‘ve downgraded Tasmota to 11.1.0 and used SetOption50 0 on the Tasmota command line. After that and a device restart all worked fine for me. The device is then visible in the MQTT Integration.

To disable MQTT No Retain in Tasmota, you can enter the following command in the console:

SetOption50 0

This command sets option 50 to 0, which means that the No Retain flag is disabled. However, please note that this is a permanent change and the device may need to be restarted for the setting to take effect.

sir-harlekin commented 9 months ago

Just to make me understand this a little bit better:

Is this option only avaiable in Tasmota 11.1.0 and below? So i downgrade is needed then, correct?

I am migrating from FHEM smarthome where I never encountered such problems, so is this a Tasmota/HA problem per se, but it must be fixed from Tasmota side?

/edit: an additional question: You say the device is then visible in MQTT, so you are not using the official Tasmota integration then?

rolfmcduff commented 9 months ago

I don‘t know the exact cause. I‘m happy it‘s working :) I don‘t use the Tasmota Integration.

sir-harlekin commented 9 months ago

For everyone ever encountering the same problem, my three parts of the solution were (i did one single test them, it may be sufficient if you dont tweak all the settings in Tasmota):

MQTT Prefix: %prefix%/homeassistant/%topic%/ Console: SetOption19 0 Console: PowerRetain on

The last one may be the solution per se.

Its working now for me (surviving restarts, host reboots, etc.) with every Tasmota device on firmware 13.4.

lucasdellasantina commented 7 months ago

image

After an update the names of the topics change, as shown in the image. you have to update them and enjoy

issue-triage-workflows[bot] commented 4 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.