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.75k stars 417 forks source link

Add support Sonoff YM42E-WC #1528

Open wrsnk opened 5 days ago

wrsnk commented 5 days ago

Is it possible to implement support for YM42E-WC? This is a smart window that can be opened, closed, paused, and tilted inwards.

image

sonoff-01JCNG2FZXHH9TSY89TX0SANA7-客厅右侧窗户-1c9571dfa8c65422f2a6407f59d188ce.json

config_entry-sonoff-01JCNG2FZXHH9TSY89TX0SANA7 (1).json

  "data": {
    "version": "ffa7e22",
    "cloud_auth": true,
    "config": null,
    "options": {
      "mode": "cloud",
      "debug": false,
      "homes": 0
    },
    "errors": [],
    "device": {
      "uiid": 89,
      "params": {
        "version": 8,
        "sledOnline": "on",
        "ssid": "***",
        "bssid": "***",
        "rssi": -87,
        "fwVersion": "3.4.3",
        "staMac": "***",
        "op": 3,
        "per": 0,
        "dtype": 7,
        "only_device": {
          "ota": "success"
        }
      },
      "model": "YM42E-WC",
      "online": true,
      "local": null,
      "localtype": null,
      "host": null,
      "deviceid": "10013d00e9"
    }
wrsnk commented 5 days ago

debug open sonoff-01JCNG2FZXHH9TSY89TX0SANA7-客厅右侧窗户-1c9571dfa8c65422f2a6407f59d188ce2.json

AlexxIT commented 5 days ago

What kind of device is this? What does it do? You need to collect debug logs. I think it has only three useful params:

        "op": 3,
        "per": 0,
        "dtype": 7,
wrsnk commented 4 days ago

This is a hidden motor built into the casement window that can be used to control the opening and tilting of the window.I did some tests. When I use the controller to control the window, the result is as follows:

After opening op: 3 per: 100 dtype: 3

After inward opening op: 3 per: 100 dtype: 6

After closing op: 3 per: 0 dtype: 7

Press Pause while opening the window op: 3 per: 50 dtype: 3

I guess the dtype parameter means the mode and the per parameter means the degree. I'm sorry about that I don't know how to use "/api/sonoff/" to see the debuglog although I tried for a long time, hopefully the test can provide some help.

wrsnk commented 4 days ago

In addition, there are only 4 buttons on the controller: open, inverted open, close, pause