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

Error in console #8

Closed DaniFoldi closed 10 months ago

DaniFoldi commented 1 year ago

Describe The Bug:

:wave: Hi! Thank you for creating this plugin, I last checked a few years ago and couldn't find anything that supported my blinds. I tried adding my bridge to Homebridge, but receive an error every 5 seconds, and no blinds show up - I should have 2 connected.

To Reproduce:

Expected behavior:

Both blinds show up in Home app.

Logs:

These lines are repeated every 5 seconds, when I enabled debug logging:

[4/14/2023, 3:58:22 PM] [homebridge-connector-hub] [DEBUG] Returning position: [ 'Roller Blinds MAC ADDRESS', 0 ]
[4/14/2023, 3:58:22 PM] [homebridge-connector-hub] [DEBUG] Returning pos state: [ 'Roller Blinds MAC ADDRESS', 2 ]
[4/14/2023, 3:58:22 PM] [homebridge-connector-hub] [DEBUG] Returning target: [ 'Roller Blinds MAC ADDRESS', 0 ]
[4/14/2023, 3:58:26 PM] [homebridge-connector-hub] [DEBUG] Finished looking for stale accessories to remove
[4/14/2023, 3:58:26 PM] [homebridge-connector-hub] Failed to sanitize device state: {
  msgType: 'ReadDeviceAck',
  mac: 'MAC ADDRESS',
  deviceType: '10000000',
  msgID: '20230414135403178',
  data: { type: 1, operation: 2, wirelessMode: 0 }
}

Plugin Config:

Showing only the section of homebridge-connector-hub

        {
            "hubIps": [
                "192.168.0.250"
            ],
            "connectorKey": "KEY",
            "enableDebugLog": false,
            "_bridge": {
                "username": "A MAC ADDRESS",
                "port": 45242
            },
            "platform": "ConnectorHub"
        }

Screenshots:

Environment:

fasif07 commented 1 year ago

Hi @DaniFoldi

I noticed in your plugin Config:

"connectorKey": "KEY",

This KEY needs to be replaced with the KEY of connector. Launch Connector, Go to About (where it displays version) and tap 5 times on the screen.

That key needs to up there:

"connectorKey": "XXXXXXXX-XXXX-XX",

DaniFoldi commented 1 year ago

Hi, thanks for your reply. I've changed the key per the instructions, in the issue I replaced the actual value with KEY.

gormanb commented 1 year ago

Hi @DaniFoldi - from the logs, I see the following:

Failed to sanitize device state: {
  msgType: 'ReadDeviceAck',
  mac: 'MAC ADDRESS',
  deviceType: '10000000',
  msgID: '20230414135403178',
  data: { type: 1, operation: 2, wirelessMode: 0 }
}

In the above, the data.wirelessMode:0 implies that your devices are uni-directional, which means that they do not report a percentage position value, or accept a percentage target position - they can only support binary open/close commands. I have come across these devices before and updated the plugin to accommodate them (see Issue #2, in particular this comment and this comment).

But in Issue #2, the data.operation field always gave the current state of the device; 0 for closed and 1 for open. Strangely, in the case of your blinds it's 2, which simply means "not moving." There is therefore no information at all in this response which would allow the plugin to convert the operation value into the actual position of the blinds. That's what the error message "failed to sanitize device state" means.

A couple of questions:

gormanb commented 1 year ago

Hi @DaniFoldi - any update on the questions I asked above?

DaniFoldi commented 1 year ago

Hi @gormanb, sorry for the silence, I missed your last response. I'm currently not at the same place as the blinds, but I've set up a reminder to gather some information when I do in ~2 weeks time, I hope that's alright.

gormanb commented 1 year ago

Hi @DaniFoldi - any news? Have you had a chance to test out the blinds again?

gormanb commented 1 year ago

Closing this issue as stale since we haven't been able to progress the investigation. @DaniFoldi please feel free to re-open this or create a new issue if you have more details about your blinds!

gormanb commented 10 months ago

Hi @DaniFoldi - another user experienced the same problem as you in #24. We were able to track down the issue, and it has now been fixed in v1.1.6.