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.66k stars 414 forks source link

Local control not working for S31s #1459

Open aredon opened 1 month ago

aredon commented 1 month ago

I've been having some annoying issues with my ISP lately so I had wanted to swap my S31s over to local control but after doing that they all read "unavailable" for all entities. Is there a step I'm missing?

AlexxIT commented 1 month ago

https://github.com/AlexxIT/SonoffLAN?tab=readme-ov-file#issues https://github.com/AlexxIT/SonoffLAN?tab=readme-ov-file#common-problems-in-only-lan-mode

aredon commented 1 month ago

I didn't see anything in the home assistant logs related to the integration.

debug page.pdf

  "home_assistant": {
    "installation_type": "Home Assistant Supervised",
    "version": "2024.7.4",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "America/Chicago",
    "os_name": "Linux",
    "os_version": "6.1.0-12-amd64",
    "supervisor": "2024.06.2",
    "host_os": "Debian GNU/Linux 12 (bookworm)",
    "docker_version": "27.1.1",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "presence_simulation": {
      "documentation": "https://github.com/slashback100/presence_simulation",
      "version": "4.9",
      "requirements": []
    },
    "circadian_lighting": {
      "documentation": "https://github.com/claytonjn/hass-circadian_lighting",
      "version": "2.1.4",
      "requirements": []
    },
    "frigate": {
      "documentation": "https://github.com/blakeblackshear/frigate",
      "version": "5.3.0",
      "requirements": [
        "pytz"
      ]
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "midea_ac_lan": {
      "documentation": "https://github.com/georgezhao2010/midea_ac_lan#readme",
      "version": "v0.3.22",
      "requirements": []
    },
    "hass_agent": {
      "documentation": "https://github.com/LAB02-Research/HASS.Agent-Integration",
      "version": "2022.11.9",
      "requirements": []
    },
    "smartthinq_sensors": {
      "documentation": "https://github.com/ollo69/ha-smartthinq-sensors",
      "version": "0.39.2",
      "requirements": [
        "pycountry>=23.12.11",
        "xmltodict>=0.13.0",
        "charset_normalizer>=3.2.0"
      ]
    },
    "sonoff": {
      "documentation": "https://github.com/AlexxIT/SonoffLAN",
      "version": "3.7.3",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
    "adaptive_lighting": {
      "documentation": "https://github.com/basnijholt/adaptive-lighting#readme",
      "version": "1.22.0",
      "requirements": [
        "ulid-transform"
      ]
    },
    "pyscript": {
      "documentation": "https://github.com/custom-components/pyscript",
      "version": "1.6.1",
      "requirements": [
        "croniter==2.0.2",
        "watchdog==2.3.1"
      ]
    },
    "scheduler": {
      "documentation": "https://github.com/nielsfaber/scheduler-component",
      "version": "v0.0.0",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "sonoff",
    "name": "Sonoff",
    "codeowners": [
      "AlexxIT"
    ],
    "config_flow": true,
    "dependencies": [
      "http",
      "zeroconf"
    ],
    "documentation": "https://github.com/AlexxIT/SonoffLAN",
    "iot_class": "local_push",
    "issue_tracker": "/api/sonoff/63459b7d-7ac3-4b18-8df1-3c816232d623",
    "requirements": [
      "pycryptodome>=3.6.6"
    ],
    "version": "3.7.3",
    "is_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 0.0003943269985029474
    },
    "a518d75d0f216cd5dd47e987a98bfa65": {
      "wait_import_platforms": -0.00017370299610774964,
      "wait_base_component": -8.854339630997856,
      "config_entry_setup": 15.07989135599928
    }
  },
  "data": {
    "version": "e240aaf",
    "cloud_auth": true,
    "config": null,
    "options": {
      "mode": "local",
      "debug": true
    },
    "errors": [],
    "devices": {
      "1001fd84a3": {
        "uiid": 32,
        "params": {
          "bindInfos": "***",
          "version": 8,
          "demNextFetchTime": 1722664800000,
          "only_device": {
            "ota": "success"
          },
          "hundredDaysKwh": "get",
          "sledOnline": "off",
          "ssid": "***",
          "bssid": "***",
          "fwVersion": "3.6.0",
          "staMac": "***",
          "rssi": -52,
          "init": 1,
          "alarmType": "pcv",
          "alarmVValue": [
            -1,
            -1
          ],
          "alarmCValue": [
            -1,
            -1
          ],
          "alarmPValue": [
            -1,
            -1
          ],
          "switch": "off",
          "startup": "off",
          "pulse": "off",
          "pulseWidth": 500,
          "power": "0.00",
          "voltage": "121.61",
          "current": "0.00",
          "rstReason": 0,
          "exccause": 0,
          "epc1": 0,
          "epc2": 0,
          "epc3": 0,
          "excvaddr": 0,
          "depc": 0,
          "oneKwh": "stop",
          "uiActive": 60,
          "timeZone": -6
        },
        "model": "S31TPB(US)",
        "online": true,
        "local": null,
        "localtype": null,
        "host": null
      },
      "1001fd8276": {
        "uiid": 32,
        "params": {
          "bindInfos": "***",
          "version": 8,
          "demNextFetchTime": 1722664800000,
          "only_device": {
            "ota": "success"
          },
          "hundredDaysKwh": "get",
          "sledOnline": "on",
          "ssid": "***",
          "bssid": "***",
          "fwVersion": "3.6.0",
          "staMac": "***",
          "rssi": -42,
          "init": 1,
          "alarmType": "pcv",
          "alarmVValue": [
            -1,
            -1
          ],
          "alarmCValue": [
            -1,
            -1
          ],
          "alarmPValue": [
            -1,
            -1
          ],
          "switch": "off",
          "startup": "stay",
          "pulse": "off",
          "pulseWidth": 500,
          "power": "0.00",
          "voltage": "120.25",
          "current": "0.00",
          "rstReason": 0,
          "exccause": 0,
          "epc1": 0,
          "epc2": 0,
          "epc3": 0,
          "excvaddr": 0,
          "depc": 0,
          "oneKwh": "stop",
          "uiActive": 60,
          "timeZone": -6,
          "endTime": "2023-12-24T02:18:18.725Z",
          "startTime": "2023-12-24T02:17:59.803Z"
        },
        "model": "S31TPB(US)",
        "online": true,
        "local": null,
        "localtype": null,
        "host": null
      },
      "1001f80ca3": {
        "uiid": 32,
        "params": {
          "bindInfos": "***",
          "version": 8,
          "demNextFetchTime": 1722664800000,
          "only_device": {
            "ota": "success"
          },
          "hundredDaysKwh": "get",
          "sledOnline": "on",
          "ssid": "***",
          "bssid": "***",
          "fwVersion": "3.6.0",
          "staMac": "***",
          "rssi": -40,
          "init": 1,
          "alarmType": "pcv",
          "alarmVValue": [
            -1,
            -1
          ],
          "alarmCValue": [
            -1,
            -1
          ],
          "alarmPValue": [
            -1,
            -1
          ],
          "switch": "on",
          "startup": "stay",
          "pulse": "off",
          "pulseWidth": 500,
          "power": "159.77",
          "voltage": "123.00",
          "current": "1.43",
          "rstReason": 0,
          "exccause": 0,
          "epc1": 0,
          "epc2": 0,
          "epc3": 0,
          "excvaddr": 0,
          "depc": 0,
          "oneKwh": "stop",
          "uiActive": 60,
          "timeZone": -6
        },
        "model": "S31TPB(US)",
        "online": true,
        "local": null,
        "localtype": null,
        "host": null
      },
      "1001f80c75": {
        "uiid": 32,
        "params": {
          "bindInfos": "***",
          "version": 8,
          "demNextFetchTime": 1722664800000,
          "only_device": {
            "ota": "success"
          },
          "hundredDaysKwh": "get",
          "sledOnline": "on",
          "ssid": "***",
          "bssid": "***",
          "fwVersion": "3.6.0",
          "staMac": "***",
          "rssi": -47,
          "init": 1,
          "alarmType": "pcv",
          "alarmVValue": [
            -1,
            -1
          ],
          "alarmCValue": [
            -1,
            -1
          ],
          "alarmPValue": [
            -1,
            -1
          ],
          "switch": "on",
          "startup": "stay",
          "pulse": "off",
          "pulseWidth": 500,
          "power": "4.81",
          "voltage": "122.74",
          "current": "0.10",
          "rstReason": 0,
          "exccause": 0,
          "epc1": 0,
          "epc2": 0,
          "epc3": 0,
          "excvaddr": 0,
          "depc": 0,
          "oneKwh": "stop",
          "uiActive": 60,
          "timeZone": -6,
          "endTime": "2023-11-30T22:36:17.289Z",
          "startTime": "2023-11-30T22:36:12.962Z"
        },
        "model": "S31TPB(US)",
        "online": true,
        "local": null,
        "localtype": null,
        "host": null
      }
    }
  }
}
aredon commented 1 month ago

Investigating further it looks like my network just doesn't support mulitcast at this time.

AlexxIT commented 1 month ago

This devices should support local protocol. But local and host params for all your devices empty. It's network or Hass setup issue.

aredon commented 1 month ago

This devices should support local protocol. But local and host params for all your devices empty. It's network or Hass setup issue.

Would multicast being disabled on the network manifest like that? The devices work fine when I set the integration to "auto" but not when set to "local". I'm still investigating how to go about multicast on my network since I run opnsense and it's not really part of the core offering.

AlexxIT commented 2 weeks ago

https://github.com/AlexxIT/SonoffLAN?tab=readme-ov-file#common-problems-in-only-lan-mode