gormanb / homebridge-connector-hub

A HomeBridge plugin to expose Connector Motor Hub blinds, shades, curtains and similar devices to Homekit
Apache License 2.0
14 stars 4 forks source link

Binary state device response is mistaken as invalid #17

Closed devnpatel22 closed 1 year ago

devnpatel22 commented 1 year ago

Describe Your Problem:

Logs:

[09/08/2023, 04:43:27] [homebridge-connector-hub] Error received from hub. App key may be invalid: { msgType: 'ReadDeviceAck', mac: '083a8dca38ab', deviceType: '22000000', msgID: '20230809034302480', data: { operation: 2, direction: 2, targetPosition: 100, currentState: 0, switchMode: 0, controlMode: 0, RSSI: -46 } }

Plugin Config:


{
    "hubIps": [
        "192.168.1.205"
    ],
    "connectorKey": "6e3b5766-8073-43",
    "enableDebugLog": true,
    "_bridge": {
        "username": "0E:41:32:3F:AE:03",
        "port": 55953
    },
    "platform": "ConnectorHub"
}
**Screenshots:**
<img width="1264" alt="Screenshot 2023-08-08 at 11 52 02 PM" src="https://github.com/gormanb/homebridge-connector-hub/assets/141799921/a6e3090e-14b8-4060-b9bb-2b5ab73eb54d">

**Environment:**

* **Plugin Version**: 1-1-1
* **Homebridge Version**: <!-- homebridge -V -->
* **Node.js Version**: <!-- node -v -->
* **NPM Version**: <!-- npm -v -->
* **Operating System**: <!-- Raspbian  -->

<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->
gormanb commented 1 year ago

Hi @devnpatel22: I believe this is a bug that was introduced in version 1.1.1. I've just published 1.1.2, please try it and let me know if it fixes this issue.

devnpatel22 commented 1 year ago

10/08/2023, 03:39:09] [homebridge-connector-hub] [DEBUG] Discovered device: { msgType: 'ReadDeviceAck', mac: '083a8dca38ab', deviceType: '22000000', msgID: '20230810023429141', data: { operation: 2, direction: 2, targetPosition: 100, currentState: 0, switchMode: 0, controlMode: 0, RSSI: -47 } } [10/08/2023, 03:39:09] [homebridge-connector-hub] [DEBUG] Creating handler for accessory: Wi-Fi Curtain 01-083a8dca38ab [10/08/2023, 03:39:09] [homebridge-connector-hub] [DEBUG] Latest Wi-Fi Curtain 01-083a8dca38ab state: { msgType: 'WriteDeviceAck', mac: '083a8dca38ab', deviceType: '22000000', msgID: '20230810023909059', data: { operation: 2, direction: 2, targetPosition: 100, currentState: 0, switchMode: 0, controlMode: 0, RSSI: -47 } } [10/08/2023, 03:39:09] [homebridge-connector-hub] Failed to sanitize device state: { msgType: 'WriteDeviceAck', mac: '083a8dca38ab', deviceType: '22000000', msgID: '20230810023909059', data: { operation: 2, direction: 2, targetPosition: 100, currentState: 0, switchMode: 0, controlMode: 0, RSSI: -47 } } [10/08/2023, 03:39:09] [homebridge-connector-hub] Updating position: [ 'Wi-Fi Curtain 01-083a8dca38ab', 0 ] [10/08/2023, 03:39:14] [homebridge-connector-hub] [DEBUG] Latest Wi-Fi Curtain 01-083a8dca38ab state: { msgType: 'ReadDeviceAck', mac: '083a8dca38ab', deviceType: '22000000', msgID: '20230810023909059', data: { operation: 2, direction: 2, targetPosition: 100, currentState: 0, switchMode: 0, controlMode: 0, RSSI: -47 } } [10/08/2023, 03:39:19] [homebridge-connector-hub] Error received from hub. App key may be invalid: { msgType: 'ReadDeviceAck', mac: '083a8dca38ab', deviceType: '22000000', msgID: '20230810023909059', data: { operation: 2, direction: 2, targetPosition: 100, currentState: 0, switchMode: 0, controlMode: 0, RSSI: -47 } }

gormanb commented 1 year ago

Hi @devnpatel22 - thanks for following up! It looks like your curtain is not explicitly reporting the currentPosition field that the plugin expects to see. I've just published a new beta version, 1.1.3-beta.0, which I believe should be able to work around this and deduce the position of the curtain. Please give it a try and let me know how it works!

devnpatel22 commented 1 year ago

Hi @gormanb . Thank you so much for your help. it works now. i understand that the problem was the physical limit was not set on the motor properly.