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

wrong API calls for MINI R3 DIY #1136

Closed sebcsaba closed 1 year ago

sebcsaba commented 1 year ago

custom_components/sonoff/core/ewelink/local.py

AlexxIT commented 1 year ago

Show device diagnostics

sebcsaba commented 1 year ago

device diagnostics:

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.3.6",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.10",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Budapest",
    "os_name": "Linux",
    "os_version": "5.15.84-v8",
    "supervisor": "2023.03.3",
    "host_os": "Home Assistant OS 9.5",
    "docker_version": "20.10.22",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "sonoff": {
      "version": "3.3.1",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
  "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.3.1",
    "iot_class": "local_push",
    "is_built_in": false
  },
  "data": {
    "version": "229d93a",
    "cloud_auth": false,
    "config": null,
    "options": {},
    "errors": [],
    "device": {
      "uiid": 1,
      "params": {
        "configure": [
          {
            "startup": "on",
            "outlet": 0
          },
          {
            "startup": "on",
            "outlet": 1
          },
          {
            "startup": "on",
            "outlet": 2
          },
          {
            "startup": "on",
            "outlet": 3
          }
        ],
        "pulses": [
          {
            "pulse": "off",
            "switch": "off",
            "outlet": 0,
            "width": 0
          },
          {
            "pulse": "off",
            "switch": "off",
            "outlet": 1,
            "width": 0
          },
          {
            "pulse": "off",
            "switch": "off",
            "outlet": 2,
            "width": 0
          },
          {
            "pulse": "off",
            "switch": "off",
            "outlet": 3,
            "width": 0
          }
        ],
        "sledOnline": "on",
        "fwVersion": "1.4.3",
        "staMac": "***",
        "switches": [
          {
            "switch": "off",
            "outlet": 0
          },
          {
            "switch": "on",
            "outlet": 1
          },
          {
            "switch": "on",
            "outlet": 2
          },
          {
            "switch": "on",
            "outlet": 3
          }
        ]
      },
      "model": "MINI DIY",
      "online": null,
      "localtype": "diy_plug",
      "deviceid": "1001439f62"
    }
  }
}

Furted, from shell: ~$ curl -X POST -d '{"deviceid": "1001439f62", "data":{"switches":[{"switch":"off","outlet":0}]}}' http://192.168.1.200:8081/zeroconf/switches {"seq":88,"error":0} ~$ curl -X POST -d '{"deviceid": "1001439f62", "data":{"switch":"off"}}' http://192.168.1.200:8081/zeroconf/switches {"seq":89,"error":400} ~$ curl -X POST -d '{"deviceid": "1001439f62", "data":{"switch":"off"}}' http://192.168.1.200:8081/switches curl: (52) Empty reply from server ~$

AlexxIT commented 1 year ago

Fixed

AlexxIT commented 1 year ago

https://github.com/AlexxIT/SonoffLAN/releases/tag/v3.5.1

sebcsaba commented 1 year ago

https://github.com/AlexxIT/SonoffLAN/releases/tag/v3.5.1

Thanks! :)