sorry but every 2 to 3 update cause 2 simple switches to stop working again, and now lovelace default is gone and discovery was enabled again.
Youâre going to have to provide more information and details. None of us know your setup or what youâre referring to.
Home Assistant
0.89.1
configuration yaml
add mqtt switches
switch:
-
platform: mqtt
name: âTurtle Tank Lightsâ
command_topic: âcmnd/sonoff61/powerâ
state_topic: âstat/sonoff61/POWERâ
qos: 1
payload_on: âONâ
payload_off: âOFFâ
retain: true -
platform: mqtt
name: âTurtle Tank Outletâ
command_topic: âcmnd/sonoff52/powerâ
state_topic: âstat/sonoff52/POWERâ
qos: 1
payload_on: âONâ
payload_off: âOFFâ
retain: true
automation.yaml
-
alias: âTurtle Tank Lights Onâ
hide_entity: True
trigger:
platform: time
at: â14:05:00â
action:- service: homeassistant.turn_on
entity_id: switch.turtle_tank_lights
- service: homeassistant.turn_on
-
alias: âTurtle Tank Lights Offâ
hide_entity: True
trigger:
platform: time
at: â21:30:00â
action:- service: homeassistant.turn_off
entity_id: switch.turtle_tank_lights
- service: homeassistant.turn_off
both sonoff basic and th on 6.4.1
YAML is whitespace sensitive. The way your code currently looks, as posted, itâs impossible to tell if it will work. Iâm sure in your file the white space is different, but nobody on the forum can tell if itâs correct.
Copy and paste your code in, then highlight all of the code, then press the </>
symbol. Or put a â```â before and a â```â after your code. That will also format it correctly in the forum.
90% of your problems are because you use retain: true. You need to delete that and then remove the persistence database. Use MQTT explorer to delete the retain flag.
There is also a video showing how to correctly setup retain and power-on status. Thereâs a link to this here Sonoff Tasmota S26 Constantly Disconnecting
You should also look at using MQTT discovery.
There are issues with 6.4.1.x if you are using core 2.4.2 of Tasmota as well. Try going to either core 2.3.0 or 2.5.0. I have stability issues with everything but core 2.3.0.
thank you for your response. I have complete int instruction but no luck.
i just noticed something weird
in sonoff tasmota i see this:
00:00:00 Project sonoff Sonoff52 (Topic sonoff52, Fallback DVES_0DCFCF, GroupTopic sonoffs) Version 6.2.1-2_3_0
00:00:00 WIF: Connecting to AP1 wlan-g in mode 11N as sonoff52-4047âŚ
funny the mqtt information and name of the device is Sonoff52
Do you have MQTT discovery enabled?
discovery is back enabled and restart still no luck. tomorrow i will start from scratch again re-flash sonoff and rebuild HA again, this would be 3 times in 2 months.
You donât need to rebuild HA again! Just fix the problem!
Reflash? Why? This is mostlikely a configuration problem although if you are using Tasmota 2.4.1 I would recommend flashing with the latest dev version and 2.3.0 core (not 2.4.2 which is the default)
I use MQTT discovery. MQTT discovery is probably why the switches are showing as they are.
Look⌠remove all MQTT from the configuration including the switch definitions. Use the default broker settings (make sure that Tasmota is using a valid home assistant username and password for the broker - I just created a home assistant user with the username and password I was using previously with Tasmota - then you can just use default settings in the broker)
Use the MQTT integration with discovery enabled.
You need to get rid of the retain flag out of the persistence database⌠this is 90% of your grief.
Steps to follow:
- comment out all mqtt: settings and switches from config yaml
- remove the mosquitto broker from HA. If using a username and password in Tasmota, make sure that is a home assistant user.
- Remove the MQTT integration
- Flash latest dev 2.3.0 core to devices and enable MQTT discovery SetOption19 On
- Restart Home Assistant
- Add the broker and leave at the default settings
- Add the MQTT integration and check Discovery
- Check states and see your switchesâŚ
Then you can change their names etcâŚ
i clear the flash a rebuilt down to 6.2.1 then use a backlog to reset everything hostname, ip etcâŚ
itâs weird itâs works for a little while then a updates mess everything up.
I donât understand what you mean by thisâŚ
Are you doing a reset 5 from the console?
It will ârememberâ any settings you made when you compiled the firmware⌠What is a backlog? Never done that.
I have always edited user_config.h to enter all my settings and then compiled my own firmwareâŚ
There is a definite issue with 6.4.1 if you just used core 2.4.2âŚ
i did in the beginning. i had atom crash too many time.
i use latest easy and fast method I easy8266 to flash with standard bin then i open terminate and use a backlog configuration and example Backlog mqtthost ; mqttuser ; mqttpassword . I have a notepad++ file with each device hostname and ipaddress, then i have satndard like ,ssid, password, default gateway, dns, mqtt, etc.
I can do a sonoff from start to finish in about 2 minutes.
.
Same but all my MQTT and WLAN and set options all via the firmware file⌠Anyway doesnât matter⌠I think your firmware is one issue and the retain another⌠See steps to fix both above.
even clean install 89.1 and clean 6.2.1 sonoff tasmota canât coneect to mqtt, iâm done!
after the third attempt evening was working for 14 hours until 89.2 was installed
now I canât connect to mqt server anymore