SwitchBotAPI icon indicating copy to clipboard operation
SwitchBotAPI copied to clipboard

Keypad Vision - {"statusCode":190,"message":"Cannot read properties of undefined (reading 'convertToStatus')"}

Open soenkefischer opened this issue 1 year ago • 34 comments

Analysis

Hi,

I use a Homeassistant Add-On that uses this API to communicate with the switch bot API.

https://github.com/hsakoh/switchbot-mqtt

My Keypad is correctly installed and can be configured without any problems in the APP.

It is setup in that way, that it communicates via HUB mini (matter enabled).

When sendings the GET /v1.1/devices, I receive my hub and the kevisison, including all keys.

When requesting the status of the device (Keypad Vision).

GET,devices/BXXXXFE74B2F3/status

I get the following error message:

GET,https://api.switch-bot.com/v1.1/devices/BXXXXFE74B2F3/status,{"statusCode":190,"body":{},"message":"Cannot read properties of undefined (reading 'convertToStatus')"}

Same for sending a command

Send POST,devices/BXXXXFE74B2F3/commands,{"commandType":"command","command":"createKey","parameter":{"name":"123456","type":"permanent","password":"234567"}}

Response

POST,https://api.switch-bot.com/v1.1/devices/B0E9FE74B2F3/commands,{"statusCode":190,"message":"Cannot read properties of undefined (reading 'convertToThingCmd')"}

Expected Behavior

Receiving status of the device and setting up new keys or delete keys with sucess over the API

Steps To Reproduce

Sending the GET status command or POST command

Happens always

Logs

GET,devices/BXXXXFE74B2F3/status


I get the following error message:

GET,https://api.switch-bot.com/v1.1/devices/BXXXXFE74B2F3/status,{"statusCode":190,"body":{},"message":"Cannot read properties of undefined (reading 'convertToStatus')"}

Same for sending a command 

Send POST,devices/BXXXXFE74B2F3/commands,{"commandType":"command","command":"createKey","parameter":{"name":"123456","type":"permanent","password":"234567"}}


Response

POST,https://api.switch-bot.com/v1.1/devices/B0E9FE74B2F3/commands,{"statusCode":190,"message":"Cannot read properties of undefined (reading 'convertToThingCmd')"}

Configuration

Home assistant

https://github.com/hsakoh/switchbot-mqtt (the addon), believe that this is not needed to reproduce

Keypad Vision, Mini Hub matter enabled

Mini Hub cloud connected

Environment

Home assistant add on

Additional Context

No response

soenkefischer avatar Jun 08 '25 10:06 soenkefischer

It's not so much knowing who enters or how they enter; for me, the real problem is separating the door locking event from the one that happens inside manually or via a keypad button. In the first case one type of automation must be connected (perhaps), while in the second, for example, alarm and other exit-related automations must be activated. But if you can't intercept the events, this is impossible, and the lock loses at least half its usefulness (at least for me).

Sword-tm85 avatar Oct 31 '25 08:10 Sword-tm85

I don't disagree with you there. I could definitely use those features too. The fact is, Keypad Vision currently doesn't work via integration or MQTT. It's blocked with error 190, and as long as Switchbot doesn't make any changes to the API, we have to live with it. What would help is transparent communication so that sales are throttled.

svendominik avatar Oct 31 '25 11:10 svendominik

Very sad to see this not working. The button customizable as a "doorbell" alone on the vision is something that should be able to trigger an event, or some sort of API anything really... Not having any of the reporting work makes it unusable almost, since basically I can whip up my phone to do any of its main capacity. Currently I can't even ready that into any other system, and all it does is chiming on the doorbell itself, or activating a scene ONLY after unlocking the door.

We need to have at least the basic functionality of an API work for a device that is advertised to work with your API. That's the reason I bought it.

EDIT: This was opened 5 months ago??? And we haven't received a single answer from the API guys on your flagship product? What is going on at Switch Bot ?

bchevreau avatar Oct 31 '25 20:10 bchevreau

Any news?

paolofaz avatar Nov 11 '25 09:11 paolofaz

I'm still getting error 190 today after all the updates.

10:59:36 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,devices/B0E9FE6CA2AF/status,(null) 10:59:36 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/B0E9FE6CA2AF/status,{"statusCode":190,"body":{},"message":"Cannot read properties of undefined (reading 'convertToStatus')"} 10:59:36 fail: SwitchBotMqttApp.Services.MqttCoreService[0] polling KeypadVision,B0E9FE6CA2AF System.ApplicationException: {"statusCode":190,"body":{},"message":"Cannot read properties of undefined (reading 'convertToStatus')"} at SwitchBotMqttApp.Logics.SwitchBotApiClient.SendAndEnsureSuccessAsync[TBody](HttpRequestMessage requestMessage, CancellationToken cancellationToken, Int32[] additionalStatus, String bodyForLogging) in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/SwitchBotMqttApp/Logics/SwitchBotApiClient.cs:line 146 at SwitchBotMqttApp.Logics.SwitchBotApiClient.GetDeviceStatus(String deviceId, CancellationToken cancellationToken) in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/SwitchBotMqttApp/Logics/SwitchBotApiClient.cs:line 47 at SwitchBotMqttApp.Services.MqttCoreService.PollingAndPublishStatusAsync(PhysicalDevice physicalDevice, CancellationToken cancellationToken) in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/SwitchBotMqttApp/Services/MqttCoreService.cs:line 615

svendominik avatar Nov 11 '25 10:11 svendominik

I have the same issue... Would love to get some feedback from the API team

viab23 avatar Nov 24 '25 18:11 viab23

I agree with the previous speakers. Unfortunately, I have the same problem. Is there already an (unofficial) solution?

Bjoern3D avatar Nov 28 '25 20:11 Bjoern3D

short answer, no

svendominik avatar Nov 29 '25 10:11 svendominik

I have the same issue.

StefanBW1984 avatar Dec 11 '25 21:12 StefanBW1984

Good morning and best wishes to everyone.

Some developments: after months of stable conditions, since a week, now I've been able to detect some data from the keypad, such as the ID, DeviceType, and LastUpdate.

Still nothing regarding the information from the webhook, such as EventName, etc. Does anyone know what has changed and what is being done to completely resolve the situation?

Thanks everyone.

Sword-tm85 avatar Dec 26 '25 09:12 Sword-tm85

Same here i get only deviceId, deviceType, hubDeviceId and Status Lastupdate.

Image

DeepHyperspace avatar Feb 19 '26 19:02 DeepHyperspace

Can anyone please check again? The SwitchBot support thinks this issue is solved.

alien80 avatar May 19 '26 17:05 alien80

eventname is still unknow. it would be cool if eventname reported "unlock by key, by finger etc". I could disarm the alarm while I open the door!

paolofaz avatar May 20 '26 20:05 paolofaz

Update (21. May 2026): statusCode 190 is gone, but body is still empty

After testing today with the v1.1 API, the statusCode: 190 error described in this issue no longer occurs. However, the response body for GET /v1.1/devices/{deviceId}/status on a Keypad Vision is still incomplete.

Response received:

{
  "statusCode": 100,
  "body": {
    "deviceId": "B0XXXXXXXXXX",
    "deviceType": "Keypad Vision",
    "hubDeviceId": "F9XXXXXXXXXX"
  },
  "message": "success"
}

All actual status fields (battery level, connection status, key list, etc.) are missing. The crash appears to be fixed on the server side, but the status mapping for the Keypad Vision device type still returns no meaningful data.

Setup:

  • Keypad Vision connected via Hub Mini (cloud connected)
  • API v1.1
  • Tested via curl on Windows 10 CMD

Logs:

Command: Get device list C:>curl --ssl-no-revoke -X GET "https://api.switch-bot.com/v1.1/devices" -H "Authorization: [REDACTED]" -H "sign: [REDACTED]" -H "t: 1779354019904" -H "nonce: 9574ko" -H "Content-Type: application/json" Response: json{"statusCode":100,"body":{"deviceList":[{"deviceId":"B0E9FXXXXXXX","deviceName":"Lock Ultra B8","deviceType":"Smart Lock Ultra","enableCloudService":true,"hubDeviceId":"F9BC3XXXXXXX","group":false,"master":true,"lockDevicesIds":[]},{"deviceId":"B0E9FE9XXXXX","deviceName":"Keypad Vision","deviceType":"Keypad Vision","enableCloudService":true,"hubDeviceId":"F9BC3XXXXXXX","lockDeviceId":"B0E9FXXXXXXX","keyList":[{"id":11,"name":"[REDACTED]","type":"permanent","status":"normal","createTime":1749654618000,"password":"[REDACTED]","iv":"[REDACTED]"}]},{"deviceId":"F9BC3XXXXXXX","deviceName":"Hub Mini E2","deviceType":"Hub Mini","enableCloudService":true,"hubDeviceId":"000000000000"}],"infraredRemoteList":[]},"message":"success"} Works great! (battery level, connection status, key list, etc. are displayed)

Command: Get device status (Keypad Vision) C:>curl --ssl-no-revoke -X GET "https://api.switch-bot.com/v1.1/devices/B0E9FE9XXXXX/status" -H "Authorization: [REDACTED]" -H "sign: [REDACTED]" -H "t: 1779354633066" -H "nonce: njmvsk" -H "Content-Type: application/json" Response: json{"statusCode":100,"body":{"deviceId":"B0E9FE9XXXXX","deviceType":"Keypad Vision","hubDeviceId":"F9BC3XXXXXXX"},"message":"success"} Works, but all actual status fields (battery level, connection status, key list, etc.) are missing!

alien80 avatar May 21 '26 09:05 alien80