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

Support for ewelink smart plug with energy monitor #1159

Open gfucka opened 1 year ago

gfucka commented 1 year ago

Please someone can say me if it works with generic ewelink smart plug with energy monitor like this

Thanks

sipimokus commented 1 year ago

I have very similar device, I use latest master branch and it's work.

image
gfucka commented 1 year ago

Thank you for reply. So the one I want to buy must be work? Can I just install it by HACS? Or I need to do something special?

itwasmattgregg commented 1 year ago

My Energy reading never changes.

gfucka commented 1 year ago

My Energy reading never changes.

Sorry what do you mean?

Killerherts commented 1 year ago

I have s40tpb and my energy still says unavailable on latest update. Is there more information i could provide

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.4.1",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.10",
    "docker": true,
    "arch": "x86_64",
    "timezone": "America/Chicago",
    "os_name": "Linux",
    "os_version": "5.15.90",
    "supervisor": "2023.04.0",
    "host_os": "Home Assistant OS 9.5",
    "docker_version": "20.10.22",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "sonoff": {
      "version": "3.5.1",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
    "reolink_discovery": {
      "version": "1.2.0",
      "requirements": []
    },
    "hacs": {
      "version": "1.31.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "nest_protect": {
      "version": "0.3.8",
      "requirements": []
    },
    "nodered": {
      "version": "1.2.0",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "sonoff",
    "name": "Sonoff",
    "config_flow": true,
    "documentation": "https://github.com/AlexxIT/SonoffLAN",
    "issue_tracker": "https://github.com/AlexxIT/SonoffLAN/issues",
    "codeowners": [
      "@AlexxIT"
    ],
    "dependencies": [
      "http",
      "zeroconf"
    ],
    "requirements": [
      "pycryptodome>=3.6.6"
    ],
    "version": "3.5.1",
    "iot_class": "local_push",
    "is_built_in": false
  },
  "data": {
    "version": "122751c",
    "cloud_auth": true,
    "config": null,
    "options": {
      "mode": "auto",
      "debug": false,
      "homes": 1
    },
    "errors": [],
    "devices": {
      "10018007fd": {
        "uiid": 182,
        "params": {
          "bindInfos": "***",
          "version": 8,
          "demNextFetchTime": 1680930000000,
          "rssi": -51,
          "fwVersion": "1.4.1",
          "switches": [
            {
              "switch": "off",
              "outlet": 0
            },
            {
              "switch": "off",
              "outlet": 1
            },
            {
              "switch": "off",
              "outlet": 2
            },
            {
              "switch": "off",
              "outlet": 3
            }
          ],
          "configure": [
            {
              "startup": "off",
              "outlet": 0
            }
          ],
          "pulses": [
            {
              "pulse": "off",
              "switch": "off",
              "outlet": 0,
              "width": 1000
            }
          ],
          "sledOnline": "on",
          "ssid": "***",
          "bssid": "***",
          "power": "0.00",
          "voltage": "0.00",
          "current": "0.00",
          "alarmType": "pcv",
          "alarmVValue": [
            -1,
            -1
          ],
          "alarmCValue": [
            -1,
            -1
          ],
          "alarmPValue": [
            -1,
            -1
          ],
          "uiActive": 60,
          "timeZone": -5,
          "only_device": {
            "ota": "success",
            "ota_fail_reason": 0
          },
          "appPower": "0.00",
          "reactPower": "0.00",
          "dayKwh": "0.00",
          "dayWorkTime": 0,
          "hundredDaysKwh": "get"
        },
        "model": "S40TPB",
        "online": true,
        "local": true,
        "localtype": "plug",
        "host": "10.88.88.168:8081"
      },
      "10017fe790": {
        "uiid": 182,
        "params": {
          "bindInfos": "***",
          "version": 8,
          "demNextFetchTime": 1680930000000,
          "rssi": -47,
          "fwVersion": "1.4.1",
          "switches": [
            {
              "switch": "off",
              "outlet": 0
            },
            {
              "switch": "off",
              "outlet": 1
            },
            {
              "switch": "off",
              "outlet": 2
            },
            {
              "switch": "off",
              "outlet": 3
            }
          ],
          "configure": [
            {
              "startup": "off",
              "outlet": 0
            }
          ],
          "pulses": [
            {
              "pulse": "off",
              "switch": "off",
              "outlet": 0,
              "width": 1000
            }
          ],
          "sledOnline": "off",
          "ssid": "***",
          "bssid": "***",
          "power": "0.00",
          "voltage": "0.00",
          "current": "0.00",
          "alarmType": "pcv",
          "alarmVValue": [
            -1,
            -1
          ],
          "alarmCValue": [
            -1,
            -1
          ],
          "alarmPValue": [
            -1,
            -1
          ],
          "uiActive": 60,
          "timeZone": -5,
          "hundredDaysKwh": "get",
          "only_device": {
            "ota": "success",
            "ota_fail_reason": 0
          },
          "appPower": "0.00",
          "reactPower": "0.00",
          "dayKwh": "0.00",
          "dayWorkTime": 0
        },
        "model": "S40TPB",
        "online": true,
        "local": true,
        "localtype": "plug",
        "host": "10.88.88.167:8081"
      },
      "10017fe080": {
        "uiid": 182,
        "params": {
          "bindInfos": "***",
          "version": 8,
          "rssi": -62,
          "fwVersion": "1.4.1",
          "switches": [
            {
              "switch": "off",
              "outlet": 0
            },
            {
              "switch": "off",
              "outlet": 1
            },
            {
              "switch": "off",
              "outlet": 2
            },
            {
              "switch": "off",
              "outlet": 3
            }
          ],
          "configure": [
            {
              "startup": "off",
              "outlet": 0
            }
          ],
          "pulses": [
            {
              "pulse": "off",
              "switch": "off",
              "outlet": 0,
              "width": 1000
            }
          ],
          "sledOnline": "off",
          "ssid": "***",
          "bssid": "***",
          "power": "614.19",
          "voltage": "118.28",
          "current": "5.50",
          "alarmType": "pcv",
          "alarmVValue": [
            -1,
            -1
          ],
          "alarmCValue": [
            -1,
            -1
          ],
          "alarmPValue": [
            -1,
            -1
          ],
          "uiActive": 60,
          "only_device": {
            "ota": "success",
            "ota_fail_reason": 0
          },
          "appPower": "650.79",
          "reactPower": "215.16",
          "dayKwh": "0.88",
          "dayWorkTime": 115,
          "timeZone": -5,
          "demNextFetchTime": 1680930000000,
          "hundredDaysKwh": "get"
        },
        "model": "S40TPB",
        "online": true,
        "local": true,
        "localtype": "plug",
        "host": "10.88.88.166:8081"
      }
    }
  }
}
sipimokus commented 1 year ago

Similar problem here too for almost all wifi power meter. About to 2023.04.06. was good.

I use 2 different account for HASS and eWelink app. HASS is working some minutes, and it suddenly stops power / current sensors.

If I open the eWelink app, and select any power meter, the sensors are good again in HASS.

image

Cloud ERROR: {'error': 504, 'reason': 'Request Timeout', 'deviceid': 'XXXXXXXX', 'apikey': 'e64cdea4-XXXX-XXXX-9c7b-51003ac9318a', 'sequence': '168093309XXXX'}

I recently had a power blackout and the wifi "crashed", maybe this is the problem for me.

Update: I removed the /config/.storage/sonoff/email.json file, and restart the HASS, now everything works good.