Geyser Sonoff losing connection

OK this is driving me nuts.

My solar geyser element is controlled via a contactor which, in turn, is switched on and off via a Sonoff Basic, running Tasmota.

It works well for most days. But recently I’ve started losing connection quite a bit.

image

Now the problem is I’m using MQTT, so it misses messages to indicate turn on, or turn off. As I use excess PV power to “boost” the water temperature, this means that it sometimes misses the message to turn on, or (worse) misses the message to turn off.

I’ve thought about turning on MQTT Retain, but I can see it work against me too - especially since the switch in Home Assistant becomes “unavailable” when the Sonoff loses connection and I am unable to even toggle the switch to “off”.

Any suggestions? I can think to try:

  1. Moving it further away from the DB (It is actually in the surface mounted DB at the moment)
  2. Adding another Unifi AP to the garage (where the VenusGX is as well, and one or two other Wifi switches)
  3. Looking for a hardwired way to control these – but I haven’t seen any Ethernet powered switches yet.
  4. I guess I could try a Sonoff RF or a Sonoff Zigbee, but not sure those will be any better.
  5. Come up with a software approach to try and compensate for it – i.e. have a “preferred state” in Home Assitant, and the sonoff tries to match it whenever it is available, but also with built in auto-turn off timers on the Tasmota side so that it doesn’t run too long at any point. Sounds messy though.

Extra notes – it is on Tasmota 8.2, might need an upgrade
Furthermore, HA is set to send MQTT messages at QOS = 1, but not sure Tasmota supports this?

Tasmata has some quirks , I have one SonOff that is still on v 5.0 and is working with out a miss then I had some 7x and 8x and had problems so I would say upgrade first and see how it goes.

I ended up changing my switch config:

From

#Geyser
switch:
  - platform: mqtt
    name: "Sonoff Geyser"
    command_topic: "cmnd/tasmota_sonoff_geyser/power"
    state_topic: "stat/tasmota_sonoff_geyser/POWER"
    availability_topic: "tele/tasmota_sonoff_geyser/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"    
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: true

to

#Geyser
switch:
  - platform: mqtt
    name: "Sonoff Geyser"
    command_topic: "cmnd/tasmota_sonoff_geyser/power"
    state_topic: "stat/tasmota_sonoff_geyser/POWER"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: true

basically without the availability. That way the switch at least is always available to be toggled and I can send a command to the geyser to say “hey when you’re back online, please switch off!”. It looks like while it was unavailable, my automations that need to turn it off basically did nothing, and then when it comes back online, it was still “on” with nothing to switch it off.

Not ideal yet, but seems to have slightly fewer issues so far.

Of course, now I can’t see whether it is actually available. So I added a binary sensor that basically just reports the state of the geyser:

sensor:
  - platform: mqtt
    name: "Geyser Sonoff State"
    state_topic: "stat/tasmota_sonoff_geyser/POWER"
    availability_topic: "tele/tasmota_sonoff_geyser/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"    
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"

image

2 Likes

Ive had this same issue with ESP8266 devices. For me the solution was to make a new SSID which is 2.4ghz only and move to another channel (no constant hopping).
Worked for me.

1 Like

Which network / Wifi are you running? Ubiquiti Unifi?

AsusWRT