switchbot-mqtt icon indicating copy to clipboard operation
switchbot-mqtt copied to clipboard

Keypad Vision all sensors unknown / Cannot read properties of undefined (reading 'convertToStatus')

Open ahaghshenas opened this issue 6 months ago • 17 comments

I have an issue with keypad vision, all sensors are showing unknown.

Info from the log:

trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/B0xxxxxxxx20/status,{"statusCode":190,"body":{},"message":"Cannot read properties of undefined (reading 'convertToStatus')"}

fail: SwitchBotMqttApp.Services.MqttCoreService[0] polling KeypadVision,B0xxxxxxxx20 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 605

Image

ahaghshenas avatar Jun 05 '25 10:06 ahaghshenas

The issue is caused by the SwitchBot API returning an error.

I don’t know why that error is occurring. I recommend opening an issue on the OpenWonderLabs/SwitchBotAPI repository.

Besides the KeyPadVision, what other devices do you have? Do you own any devices that act as a bridge to the internet, such as the Hub series?

hsakoh avatar Jun 05 '25 12:06 hsakoh

I have the Lock Ultra and the Hub Mini as the bridge.

The Lock Ultra is working as it should.

Image

ahaghshenas avatar Jun 05 '25 14:06 ahaghshenas

I initially thought the issue was due to KeyPad Vision data not being uploaded to the SwitchBot server, but since you seem to have a hub, that may not be the case.

Can you operate the KeyPad Vision using the smartphone app with Bluetooth turned off? If you can control the device via the SwitchBot server, it might resolve the abnormal state.

It is highly likely that the issue stems from a server-side abnormality or an API bug on SwitchBot’s end, and it is difficult to address this problem with the add-on alone.

hsakoh avatar Jun 05 '25 14:06 hsakoh

Hello,

I have exactly the same problem. Is there any way to support to solve this problem?

Any debug code or testing I can deliver or do?

Sönke

soenkefischer avatar Jun 06 '25 21:06 soenkefischer

If the API response does not change, there is nothing the add-on side can do. Please contact SwitchBot support or create an issue on the API repository side.

hsakoh avatar Jun 07 '25 00:06 hsakoh

Opened a issue on the API respority side.Hpe they will answer.

soenkefischer avatar Jun 08 '25 10:06 soenkefischer

I own a (standalone) Keypad Vision together with a Hub Mini and have the same Problem.

alien80 avatar Jun 13 '25 16:06 alien80

https://github.com/OpenWonderLabs/SwitchBotAPI/issues/408

hsakoh avatar Jun 13 '25 16:06 hsakoh

Also have the same issue.

Image

JohnLough avatar Jun 25 '25 03:06 JohnLough

Hello,

same problem here... Just purchased a Switchbot Lock Ultra Vsion and cannot get any state from Keypad Vision.

Any news frome somewhere?

Thanks in advice.

Sword-tm85 avatar Jul 01 '25 10:07 Sword-tm85

same problem here... Just purchased a Nuki Smart Lock Pro Vsion and cannot get any state from Keypad Vision.

I guess you purchased a Switchbot Smart Lock? Otherwise you are in the wrong repo.

smartmatic avatar Jul 01 '25 12:07 smartmatic

same problem here... Just purchased a Nuki Smart Lock Pro Vsion and cannot get any state from Keypad Vision.

I guess you purchased a Switchbot Smart Lock? Otherwise you are in the wrong repo.

:-) Of course yes... Sorry :-P I updated the comment.

Sword-tm85 avatar Jul 01 '25 13:07 Sword-tm85

Same issue here. Any news?

paolofaz avatar Jul 10 '25 20:07 paolofaz

I also facing the same issue in homeassistant. I’ve configured SwitchBot2MQTT with webhook support and verified that my Smart Lock Ultra is working as expected. However, the Keypad Vision does not send any webhook events, even though it is correctly listed and enabled in switchbot_config.json. Webhook is correctly set up (tested with ngrok), and MQTT discovery works in homeassistant, though all entities show "unkown" status. No messages are received on switchbot/xyc/status. SwitchBot2MQTT Logs show: "statusCode":190,"body":{},"message":"Cannot read properties of undefined (reading 'convertToStatus'[...] when polling the keypad. It seems either webhook events are not sent by the device, or the API does not (yet?) support full event payloads for Keypad Vision.

Is a known API limitation or a bug?

battle566 avatar Jul 12 '25 21:07 battle566

I also facing the same issue in homeassistant. I’ve configured SwitchBot2MQTT with webhook support and verified that my Smart Lock Ultra is working as expected. However, the Keypad Vision does not send any webhook events, even though it is correctly listed and enabled in switchbot_config.json. Webhook is correctly set up (tested with ngrok), and MQTT discovery works in homeassistant, though all entities show "unkown" status. No messages are received on switchbot/xyc/status. SwitchBot2MQTT Logs show: "statusCode":190,"body":{},"message":"Cannot read properties of undefined (reading 'convertToStatus'[...] when polling the keypad. It seems either webhook events are not sent by the device, or the API does not (yet?) support full event payloads for Keypad Vision.

Is a known API limitation or a bug?

I hope it's just a bug and that it will be fixed soon. I also tried with Python getting the same error. We have only to wait for a solution. But I dont know if anyone is working into it…

paolofaz avatar Jul 12 '25 22:07 paolofaz

Since this issues root cause is within the „SwitchBot API“, please look here: https://github.com/OpenWonderLabs/SwitchBotAPI/issues/408 See also my comment from last week.

alien80 avatar Jul 12 '25 22:07 alien80

I have similar problem I have lock Ultra + Vision Pad + Hub mini 2

Image

pbo23 avatar Sep 08 '25 06:09 pbo23