homebridge-switchbot: Support Request: Bot type ignored

Describe Your Problem

I configured the plugin to display my bot as a lock but it keeps showing as a switch

Relevant log output

[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail statusCode: 200
[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail headers: {"date":"Sat, 16 Sep 2023 07:57:35 GMT","content-type":"application/json","content-length":"189","connection":"keep-alive","x-amzn-requestid":"0840cbfb-bc0b-4d89-a9d0-81f6028e5602","x-amz-apigw-id":"LVvtcGNvIAMEUwA=","x-amzn-trace-id":"Root=1-65055fef-0a3606f1091e40f9791e5ee7;Sampled=0;lineage=c8c2b0f2:0|bf95bacf:0"}
[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail deviceStatus: {"statusCode":100,"body":{"deviceId":"REDACTED","deviceType":"Bot","hubDeviceId":"REDACTED","version":"V6.6","power":"on","battery":19,"deviceMode":"pressMode"},"message":"success"}
[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail deviceStatus body: {"deviceId":"REDACTED","deviceType":"Bot","hubDeviceId":"REDACTED","version":"V6.6","power":"on","battery":19,"deviceMode":"pressMode"}
[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail deviceStatus statusCode: 100
[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail statusCode: 200 & deviceStatus StatusCode: 100
[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail openAPIparseStatus
[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail On: false
[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail BatteryLevel: 19, StatusLowBattery: 0
[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail updateCharacteristic On: false
[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail updateCharacteristic BatteryLevel: 19
[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail updateCharacteristic StatusLowBattery: 0
[9/16/2023, 9:57:35 AM] [SwitchBot] [DEBUG] Bot: Portail updateCharacteristic FirmwareRevision: "V6.6"
[9/16/2023, 9:57:39 AM] [SwitchBot] [DEBUG] Bot: Portail openAPIRefreshStatus
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail body: {"_readableState":{"objectMode":false,"highWaterMark":65536,"buffer":{"head":{"data":{"type":"Buffer","data":[123,34,115,116,97,116,117,115,67,111,100,101,34,58,49,48,48,44,34,98,111,100,121,34,58,123,34,100,101,118,105,99,101,73,100,34,58,34,68,52,51,53,51,51,51,53,49,51,50,48,34,44,34,100,101,118,105,99,101,84,121,112,101,34,58,34,66,111,116,34,44,34,104,117,98,68,101,118,105,99,101,73,100,34,58,34,69,65,57,66,54,49,70,69,70,69,66,52,34,44,34,118,101,114,115,105,111,110,34,58,34,86,54,46,54,34,44,34,112,111,119,101,114,34,58,34,111,110,34,44,34,98,97,116,116,101,114,121,34,58,49,57,44,34,100,101,118,105,99,101,77,111,100,101,34,58,34,112,114,101,115,115,77,111,100,101,34,125,44,34,109,101,115,115,97,103,101,34,58,34,115,117,99,99,101,115,115,34,125]},"next":null},"tail":{"data":{"type":"Buffer","data":[123,34,115,116,97,116,117,115,67,111,100,101,34,58,49,48,48,44,34,98,111,100,121,34,58,123,34,100,101,118,105,99,101,73,100,34,58,34,68,52,51,53,51,51,51,53,49,51,50,48,34,44,34,100,101,118,105,99,101,84,121,112,101,34,58,34,66,111,116,34,44,34,104,117,98,68,101,118,105,99,101,73,100,34,58,34,69,65,57,66,54,49,70,69,70,69,66,52,34,44,34,118,101,114,115,105,111,110,34,58,34,86,54,46,54,34,44,34,112,111,119,101,114,34,58,34,111,110,34,44,34,98,97,116,116,101,114,121,34,58,49,57,44,34,100,101,118,105,99,101,77,111,100,101,34,58,34,112,114,101,115,115,77,111,100,101,34,125,44,34,109,101,115,115,97,103,101,34,58,34,115,117,99,99,101,115,115,34,125]},"next":null},"length":1},"length":189,"pipes":[],"flowing":null,"ended":true,"endEmitted":false,"reading":false,"constructed":true,"sync":true,"needReadable":false,"emittedReadable":false,"readableListening":false,"resumeScheduled":false,"errorEmitted":false,"emitClose":true,"autoDestroy":true,"destroyed":false,"errored":null,"closed":false,"closeEmitted":false,"defaultEncoding":"utf8","awaitDrainWriters":null,"multiAwaitDrain":false,"readingMore":false,"dataEmitted":false,"decoder":null,"encoding":null},"_events":{},"_eventsCount":0}
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail statusCode: 200
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail headers: {"date":"Sat, 16 Sep 2023 07:57:40 GMT","content-type":"application/json","content-length":"189","connection":"keep-alive","x-amzn-requestid":"afe263d6-f668-4233-95b3-7c854bcc6031","x-amz-apigw-id":"LVvuLEgooAMEgWQ=","x-amzn-trace-id":"Root=1-65055ff4-425bb4a8622b6f834b930b49;Sampled=0;lineage=bf95bacf:0"}
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail deviceStatus: {"statusCode":100,"body":{"deviceId":"REDACTED","deviceType":"Bot","hubDeviceId":"REDACTED","version":"V6.6","power":"on","battery":19,"deviceMode":"pressMode"},"message":"success"}
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail deviceStatus body: {"deviceId":"REDACTED","deviceType":"Bot","hubDeviceId":"REDACTED","version":"V6.6","power":"on","battery":19,"deviceMode":"pressMode"}
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail deviceStatus statusCode: 100
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail statusCode: 200 & deviceStatus StatusCode: 100
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail openAPIparseStatus
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail On: false
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail BatteryLevel: 19, StatusLowBattery: 0
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail updateCharacteristic On: false
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail updateCharacteristic BatteryLevel: 19
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail updateCharacteristic StatusLowBattery: 0
[9/16/2023, 9:57:40 AM] [SwitchBot] [DEBUG] Bot: Portail updateCharacteristic FirmwareRevision: "V6.6"
[9/16/2023, 9:57:44 AM] [SwitchBot] [DEBUG] Bot: Portail openAPIRefreshStatus

Config for homebridge-switchbot

{
            "name": "SwitchBot",
            "credentials": {
                "token": "REDACTED",
                "secret": "REDACTED",
                "notice": "Keep your Token & Secret a secret!"
            },
            "options": {
                "devices": [
                    {
                        "deviceId": "REDACTED",
                        "configDeviceName": "Portail",
                        "configDeviceType": "Smart Lock",
                        "connectionType": "OpenAPI",
                        "lock": {
                            "hide_contactsensor": true
                        },
                        "refreshRate": 5,
                        "logging": "debug"
                    }
                ]
            },
            "platform": "SwitchBot"
        }

Screenshots

No response

Device & Model

Hub Mini v3.9-2.6 + SwitchBot v6.6

Node.js Version

16.18.0

NPM Version

8.19.2

Homebridge Version

1.6.1

Homebridge SwitchBot Plugin Version

2.8.2

Homebridge Config UI X Plugin Version

No response

Operating System

Docker

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 19 (2 by maintainers)

Most upvoted comments

All good, thanks a lot for your support! Ticket can be closed!

If so your config should look like this:


{
  "name": "SwitchBot",
  "credentials": {
    "token": "REDACTED",
    "secret": "REDACTED",
    "notice": "Keep your Token & Secret a secret!"
  },
  "options": {
    "devices": [
      {
        "deviceId": "REDACTED",
        "configDeviceName": "Portail",
        "configDeviceType": "Bot",
        "connectionType": "OpenAPI",
        "bot": {
          "deviceType": "garagedoor"
        },
        "refreshRate": 5,
        "logging": "debug"
      }
    ]
  },
  "platform": "SwitchBot"
}