AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.74k stars 416 forks source link

Sonoff SWV goes direct OFF-status after putting ON #1497

Open brononius opened 1 month ago

brononius commented 1 month ago

I’m new to Zigbee and using a Sonoff ZB Bridge-P with a Sonoff SWV (Smart Water Valve). I’ve set up the SonoffLAN integration via HACS, connected through the ‘AUTO’ method.

The valve appears as a device in Home Assistant after adding it through the eWeLink app and refreshing HA.

The problem:

  1. When I turn the valve ON, the status in HA immediately switches to OFF, but the valve physically turns ON.
  2. Turning the valve ON again, the status in HA stays ON.
  3. Turning the valve OFF works correctly - both the status and the physical valve turn OFF.
  4. Through the eWeLink app, it seems to be working fine.

Any suggestions on how to resolve this status mismatch?

Thanks in advance for any assistance!

AlexxIT commented 1 month ago

https://github.com/AlexxIT/SonoffLAN?tab=readme-ov-file#issues

brononius commented 1 month ago

For the moment i've added a small rule to put it a second time ON. This works.

alias: SonOffKraanStatusCheck
description: ""
trigger:
  - platform: device
    type: turned_on
    device_id: 68f418251d408947863c809f26d032ed
    entity_id: 1ef333dd8c261fbe01156022326615bf
    domain: switch
condition: []
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - type: turn_on
    device_id: 68f418251d408947863c809f26d032ed
    entity_id: 1ef333dd8c261fbe01156022326615bf
    domain: switch
mode: single

I didn't found any issues in the logs that relate to this.

The diagnostics: sonoff-01J73N995EM1AQ88AF83B0VQ5J-KraanSonoff1-68f418251d408947863c809f26d032ed.json

AlexxIT commented 1 month ago

What of this params do you need in Hass? Looks like switch and battery. Maybe todayWaterUsage.

"device": {
      "uiid": 7027,
      "params": {
        "fwVersion": "1.0.3",
        "subDevRssi": -38,
        "battery": 100,
        "trigTime": "1725626515000",
        "supportPowConfig": 1,
        "switch": false,
        "realIrrigationVolume": 3,
        "realIrrigationVolumeGal": 0,
        "controlMode": "manual",
        "todayWaterUsage": 8,
        "todayWaterUsageGal": 2,
        "runningMode": 2,
        "exceptionReport": [],
        "hasException": false,
        "only_device": {
          "ota": "success",
          "ota_fail_reason": 0
        },
        "subOtaInfo": {
          "state": 0,
          "reason": 0,
          "stateTime": "1727005559000"
        },
        "endIrrigationTime": "1727011383000",
        "lastIrrigationTime": "1727010803000",
        "sledOnline": "off"
      },
      "model": "SWV",
      "online": true,
      "local": null,
      "localtype": null,
      "host": null,
      "deviceid": "a4800a275a"
    }
ramiroastur commented 1 month ago

I got the same problem with SonOff Minir4M but I can´t find a way to fix it :(

jcarugati commented 1 month ago

I'm having a similar issue with the SWV. I can turn it on from HA using cloud but the switch state never stays ON. And then I can't turn it OFF, even calling the service directly. I have to turn it off from the ewelink app 🤔

aferende commented 3 weeks ago

Same behavior. I'm just going with the suggested workaround.

I think that 3 params suggested are the best choice.

Ty for your time.