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.58k stars 406 forks source link

RFBridge: A Binary_Sensor visible in HA but does not see state changes from ewelink #528

Closed sabbrowne closed 3 years ago

sabbrowne commented 3 years ago

Hi AlexxIT, I have been using this HACS addon for ages now and in most cases it it has worked flawlessly. Recently I added a new RF door sonoff sensor (DW1) to the RFBridge and although I can see the binary sensor in HA it never changes state to on when the sensor is actuated. I have 7 other RF door sensors that work as expected in HA as binary sensors. I also have Sonoff Camera and cover devices. The Ewelink app shows the state of change but for some strange reason this one sensor will not change state in HA. Any ideas why? I have included my yaml config and the debug (pasted and attached file) info from the supervisor logs, HA logs show no no errors or warnings at all for sonoff or other errors. I also monitored the sonoff.remote event triggers and interesting it sees the event.. Pasted below For the record I have tried removing sensor from ewelink app, uninstalling the Sonoff addon and reinstalling to no no avail.

This is the sensor that does not work, and yes the sensor ID is the same as the ewelink app

Work Shop Entry Door Sensor:
  name: Work Shop Entry Door Sensor
  device_class: door
  timeout: 30

Supervisor debug log: (turned on to debug mode in yaml)

2021-06-13 18:20:56 DEBUG (MainThread) [custom_components.sonoff] SysInfo: {'version': '2021.6.4', 'dev': False, 'hassio': True, 'virtualenv': False, 'python_version': '3.8.9', 'docker': True, 'arch': 'armv7l', 'os_name': 'Linux', 'os_version': '5.4.83-v7l', 'supervisor': '2021.06.0', 'host_os': 'Home Assistant OS 5.11', 'docker_version': '19.03.13', 'chassis': 'embedded'}
2021-06-13 18:20:56 DEBUG (MainThread) [custom_components.sonoff] AUTO mode start
2021-06-13 18:20:59 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] Redirect to region: us
2021-06-13 18:21:02 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 7 devices loaded from the Cloud Server
2021-06-13 18:21:02 DEBUG (MainThread) [custom_components.sonoff] 10009d42a2 == Init | {'uiid': 1, 'extra': {'manufacturer': 'SANTTONG', 'model': 'SANTTON_3', 'sw_version': 'PSF-B01-GL v3.5.0'}, 'params': {'bindInfos': {'gaction': ['484beeb8-3159-4c44-9978-01b52c28a2a0_ewelinkGoogleHome']}, 'version': 8, 'sledOnline': 'on', 'switch': 'off', 'fwVersion': '3.5.0', 'rssi': -64, 'staMac': 'D8:F1:5B:C9:A8:5D', 'startup': 'off', 'init': 1, 'pulse': 'off', 'pulseWidth': 0, 'only_device': {'ota': 'success'}, 'ssid': 'Nova_1', 'bssid': 'e8:65:d4:bc:5d:19', 'cloud': 'online'}}
2021-06-13 18:21:02 DEBUG (MainThread) [custom_components.sonoff] 1000a41910 == Init | {'uiid': 1, 'extra': {'manufacturer': 'SONOFF', 'model': 'MINI', 'sw_version': 'PSF-BD1-GL v3.6.0'}, 'params': {'bindInfos': {'gaction': ['484beeb8-3159-4c44-9978-01b52c28a2a0_ewelinkGoogleHome']}, 'version': 8, 'sledOnline': 'on', 'switch': 'off', 'fwVersion': '3.6.0', 'rssi': -41, 'staMac': 'D8:F1:5B:84:1E:3A', 'startup': 'off', 'init': 1, 'pulse': 'off', 'pulseWidth': 500, 'swMode': 2, 'swCtrlReverse': 'off', 'cloud': 'online'}}
2021-06-13 18:21:02 DEBUG (MainThread) [custom_components.sonoff] 1000a46472 == Init | {'uiid': 1, 'extra': {'manufacturer': 'SONOFF', 'model': 'MINI', 'sw_version': 'PSF-BD1-GL v3.6.0'}, 'params': {'bindInfos': {'gaction': ['484beeb8-3159-4c44-9978-01b52c28a2a0_ewelinkGoogleHome']}, 'version': 8, 'sledOnline': 'on', 'switch': 'on', 'fwVersion': '3.6.0', 'rssi': -48, 'staMac': 'D8:F1:5B:8E:50:6A', 'startup': 'off', 'init': 1, 'pulse': 'off', 'pulseWidth': 500, 'swMode': 2, 'swCtrlReverse': 'off', 'cloud': 'online'}}
2021-06-13 18:21:02 DEBUG (MainThread) [custom_components.sonoff] 1000a402a7 == Init | {'uiid': 1, 'extra': {'manufacturer': 'SONOFF', 'model': 'MINI', 'sw_version': 'PSF-BD1-GL v3.6.0'}, 'params': {'bindInfos': {'gaction': ['484beeb8-3159-4c44-9978-01b52c28a2a0_ewelinkGoogleHome']}, 'version': 8, 'sledOnline': 'on', 'switch': 'off', 'fwVersion': '3.6.0', 'rssi': -47, 'staMac': 'D8:F1:5B:8E:50:A4', 'startup': 'off', 'init': 1, 'pulse': 'off', 'pulseWidth': 500, 'swMode': 2, 'swCtrlReverse': 'off', 'cloud': 'online'}}
2021-06-13 18:21:02 DEBUG (MainThread) [custom_components.sonoff] 1000a56e5c == Init | {'uiid': 1, 'extra': {'manufacturer': 'SONOFF', 'model': 'MINI', 'sw_version': 'PSF-BD1-GL v3.6.0'}, 'params': {'bindInfos': {'gaction': ['484beeb8-3159-4c44-9978-01b52c28a2a0_ewelinkGoogleHome']}, 'version': 8, 'sledOnline': 'on', 'switch': 'off', 'fwVersion': '3.6.0', 'rssi': -60, 'staMac': 'D8:F1:5B:C9:3B:E9', 'startup': 'off', 'init': 1, 'pulse': 'off', 'pulseWidth': 500, 'swMode': 2, 'swCtrlReverse': 'off', 'cloud': 'online'}}
2021-06-13 18:21:02 DEBUG (MainThread) [custom_components.sonoff] a620001e2e == Init | {'uiid': 87, 'extra': {'manufacturer': 'coolkit', 'model': 'GK-200MP2B', 'sw_version': 'GK-200MP2B'}, 'params': {'bindInfos': {'gaction': ['484beeb8-3159-4c44-9978-01b52c28a2a0_ewelinkGoogleHome']}, 'version': 7, 'romVersion': '24520191030', 'cmd': 'left', 'cloud': 'online'}}
2021-06-13 18:21:02 DEBUG (MainThread) [custom_components.sonoff] 1000bd645a == Init | {'uiid': 28, 'extra': {'manufacturer': 'SONOFF', 'model': 'RFBridge', 'sw_version': 'PSF-BRA-GL v3.5.0'}, 'params': {'bindInfos': {'gaction': ['484beeb8-3159-4c44-9978-01b52c28a2a0_ewelinkGoogleHome']}, 'sledOnline': 'on', 'init': 1, 'fwVersion': '3.5.0', 'rssi': -25, 'version': 8, 'staMac': 'C8:2B:96:43:49:69', 'setState': 'arm', 'rfList': [{'rfChl': 0, 'rfVal': '30DE01D604BAD49AFE'}, {'rfChl': 1, 'rfVal': '43BC023A06A462A856'}, {'rfChl': 2, 'rfVal': '300C01AE04B06D17A9'}, {'rfChl': 3, 'rfVal': '122A00BE01C2555500'}, {'rfChl': 4, 'rfVal': '328201B8050084E929'}, {'rfChl': 5, 'rfVal': '313801AE04D822D669'}, {'rfChl': 6, 'rfVal': '314C01B804D849B569'}, {'rfChl': 7, 'rfVal': '31A601A404E20F42A9'}, {'rfChl': 8, 'rfVal': '325A01AE04ECB3AC69'}, {'rfChl': 9, 'rfVal': '330401D604EC6CFEA9'}], 'cmd': 'trigger', 'rfChl': 9, 'rfTrig0': '2021-06-13T07:24:37.000Z', 'rfTrig1': '2021-06-06T03:44:22.000Z', 'timers': [], 'rfTrig2': '2021-06-13T07:10:21.000Z', 'rfTrig3': '2021-06-13T07:23:14.000Z', 'rfTrig6': '2021-06-13T07:45:34.000Z', 'rfTrig4': '2021-06-13T02:09:52.000Z', 'only_device': {'ota': 'success'}, 'ssid': 'Nova_1', 'bssid': 'e8:65:d4:bc:5d:09', 'rfTrig5': '2021-06-13T07:38:46.000Z', 'rfTrig7': '2021-06-13T07:41:10.000Z', 'rfTrig8': '2021-06-13T08:17:43.000Z', 'rfTrig9': '2021-06-13T02:08:27.000Z', 'cloud': 'online'}}
2021-06-13 18:21:02 DEBUG (Sonoff_LAN) [custom_components.sonoff.sonoff_local] 1000a56e5c <= Local1 | {'switch': 'off', 'startup': 'off', 'pulse': 'off', 'sledOnline': 'on', 'fwVersion': '3.6.0', 'pulseWidth': 500, 'rssi': -60} | 17
2021-06-13 18:21:02 DEBUG (Sonoff_LAN) [custom_components.sonoff.sonoff_local] 1000a402a7 <= Local1 | {'switch': 'off', 'startup': 'off', 'pulse': 'off', 'pulseWidth': 500, 'rssi': -47} | 16
2021-06-13 18:21:02 DEBUG (Sonoff_LAN) [custom_components.sonoff.sonoff_local] 1000bd645a <= Local1 | {'sledOnline': 'on', 'arming': True, 'rfTrig8': '2021-06-13T08:17:43.000Z', 'ssid': 'Nova_1', 'bssid': 'e8:65:d4:bc:5d:09'} | 272
2021-06-13 18:21:02 DEBUG (Sonoff_LAN) [custom_components.sonoff.sonoff_local] 10009d42a2 <= Local1 | {'switch': 'off', 'startup': 'off', 'pulse': 'off', 'sledOnline': 'on', 'pulseWidth': 0, 'rssi': -64, 'ssid': 'Nova_1', 'bssid': 'e8:65:d4:bc:5d:19'} | 35
2021-06-13 18:21:02 DEBUG (Sonoff_LAN) [custom_components.sonoff.sonoff_local] 1000a41910 <= Local1 | {'switch': 'off', 'startup': 'off', 'pulse': 'off', 'pulseWidth': 500, 'rssi': -41} | 15
2021-06-13 18:21:02 DEBUG (Sonoff_LAN) [custom_components.sonoff.sonoff_local] 1000a46472 <= Local1 | {'switch': 'on', 'startup': 'off', 'pulse': 'off', 'sledOnline': 'on', 'fwVersion': '3.6.0', 'pulseWidth': 500, 'rssi': -48} | 29
2021-06-13 18:21:06 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] Cloud init: {'error': 0, 'apikey': '63a92774-b3f3-45f9-80fb-70b43bd8ae78', 'config': {'hb': 1, 'hbInterval': 145}, 'sequence': '1623572465942'}

Yaml config:

sonoff:
  username: 'user@mail.com'
  password: 'password'
  debug: True
  devices:
    1000a402a7: # TV Lights
      device_class: light
    1000a41910: # Family Lights
      device_class: light
    1000a46472: # Kitchen Lights
      device_class: light
    1000a56e5c: # Entry Lights
      device_class: light
    10009d42a2: # Garage Door
      device_class: switch
  rfbridge:
    Front Door Motion:
      name: Front Door Motion
      device_class: motion 
      timeout: 60 
    Alfresco Door Sensor:
      name: Alfresco Door Sensor
      device_class: door
      timeout: 60
    Garage Entry Door Sensor:
      name: Garage Entry Door Sensor
      device_class: door
      timeout: 60
    Workshop Smoke Detector:
      name: Workshop Smoke Detector
      device_class: smoke
      timeout: 5
    Front Doorbell:
      name: Front Doorbell
      device_class: sound
      timeout: 30
    Ensuite Window Sensor:
      name: Ensuite Window Sensor
      device_class: window
      timeout: 30
    Work Shop Entry Door Sensor:
      name: Work Shop Entry Door Sensor
      device_class: door
      timeout: 30
    Front Door Sensor:
      name: Front Door Sensor
      device_class: door
      timeout: 60
    Alfresco Bifold Sensor:
      name: Alfresco Bifold Sensor
      device_class: door
      timeout: 60
    Alfresco Window Sensor:
      name: Alfresco Window Sensor
      device_class: window
      timeout: 30

Event Log using sonoff.remote

Event 1 fired 17:27:
{
    "event_type": "sonoff.remote",
    "data": {
        "command": 8,
        "ts": "2021-06-14T07:27:11.000Z",
        "name": "Alfresco Bifold Sensor",
        "entity_id": "remote.sonoff_1000bd645a"
    },
    "origin": "LOCAL",
    "time_fired": "2021-06-14T07:27:10.783790+00:00",
    "context": {
        "id": "7859d876e4d42ead4c2d766e1cceccb6",
        "parent_id": null,
        "user_id": null
    }
}
Event 0 fired 17:26:
{
    "event_type": "sonoff.remote",
    "data": {
        "command": 7,
        "ts": "2021-06-14T07:26:30.000Z",
        "name": "Workshop Entry Door Sensor",
        "entity_id": "remote.sonoff_1000bd645a"
    },
    "origin": "LOCAL",
    "time_fired": "2021-06-14T07:26:29.583613+00:00",
    "context": {
        "id": "ab289a67753d83a2b139db1f2c678c4d",
        "parent_id": null,
        "user_id": null
    }
}

binary sensor states sonoff debug.txt

AlexxIT commented 3 years ago

Work Shop => Workshop