kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
177 stars 34 forks source link

Error code "User input malformed" when seting up Nuki Lock 3.0 Pro without bridge #7

Closed rectangular-starchaser closed 2 years ago

rectangular-starchaser commented 2 years ago

I'm using home assistant version 2021.10.6 as a container. When I try to install a Nuki 3.0 Pro without a bridge but with web access and web token as described in your tutorial, I receive the following error message:

image image

Can you advise what to do?

regards

chpego commented 2 years ago

Hi, I think it's because you're using HA 2021.10 version, see this issue it's fix in 2021.11 version

rectangular-starchaser commented 2 years ago

Hi, after update HA to 2021.11.5 same behaviour. Any other idea?

kvj commented 2 years ago

Hi,

The error is misleading, I know, but it says there were no devices fetched via Web API. Do you have any other errors in logs? @rectangular-starchaser

rectangular-starchaser commented 2 years ago

Hi, I changed my log level to debug and verified my api token externally with curl which works flawlessly. No further error logs are reported within hass logs. When setting up the integration the "user input is malformed" error remains until I fill in the form "Nuki bridge hostname or IP Address"

This behavior seems unexpected because in the setup method this parameter is set as optional: https://github.com/kvj/hass_nuki_ng/blob/16193216929746f8910ef46168404a1a60764781/custom_components/nuki_ng/config_flow.py#L78

So I assume this error is raised by hass and not by the integration itself? Best Regards!

kvj commented 2 years ago

@rectangular-starchaser

and verified my api token externally with curl which works flawlessly

Could you please share the output? The integration should work without a bridge, but something is missing in the output

rectangular-starchaser commented 2 years ago

HI, thanks for coming back on this one: That's my curl command

I've censored all privacy related date by replacing it with $var_name

kvj commented 2 years ago

Great, thanks for the output, very helpful. Nuki reports a new device type, which wasn't supported/expected. The value isn't documented yet, but other values look good.

I've pushed the change adding support of a new type. Please update to the latest version and try again

rectangular-starchaser commented 2 years ago

After updating I receive 2 devices and 15 entiteties: Device 1: Nuki Haustuer Device 2: Nuki Web API

Device 1: Nuki Haustuer

Device 2: Nuki Web API

Door Open sensor is not available Bildschirmfoto zu 2021-12-10 20-33-05

In Device 1 some sensores are not available. Is there a possibility to open and close the device with the help of the integration?

regards

kvj commented 2 years ago

@rectangular-starchaser Please update the integration once again. I've pushed some extra changes. It's a bit tough to add support without having a real device and with missing documentation

rectangular-starchaser commented 2 years ago

Thank's a lot for your support!! If you need more or more precise input from our side let us know.

I have updatetd the integration, some sensors are available others still not.

Tür9_50

The real state at this time was locked. "Control" and "Sensor" section fine, "State" of "Diagnostic" section wrong. Door Open sensor or control not available. And still an additional remark to the initial setup: I had to insert at least one character in the field: "Nuki Bridge Host Name or IP Adress". Without this character I received the reported error code "User input malformed".

Regards

kvj commented 2 years ago

@rectangular-starchaser

Door Open sensor or control not available

Now I better understand what's happening. Do you actually have the door sensor installed and configured? In the JSON output you've shared, "doorState":0 state means that the door sensor is unavailable. Do you get this value every time you call the API?

rectangular-starchaser commented 2 years ago

@kvj

The additional external door sensor to validate if the door is realy closed or opened is not installed. I only have the pure and naked Nuki 3.0 Pro installed. So if doorState is triggerd by the external sensor it is logical that is not available. If "Door Open" in the "Sensor" section and "Door Stae" and "State" in the "Diagnostic" section depend on this externel door sensor then it is clear.

With the "Lock" switch in the "Controles" section, I am able to lock and unlock the door. But there is no way to realy open the door. Is this "Open" switch missing or is this functionality not given in the integration or over the web API. With the Android APP connected to the Nuki Wep API it is possible.

Regards

kvj commented 2 years ago

@rectangular-starchaser

Ok, got it. In case of Nuki 2.0, door sensor (quite unreliable) was included into package. With Nuki 3.0, it's optional and pricey. Your setup doesn't have it, therefore those entities should not be added. I've pushed some changes, please update the component and re-add it. I've also adjusted optional config input handling, you won't need to add any chars to make Web API only setup working.

Regarding the open/unlatch function, it's supported, but unfortunately there's no Lovelace UI for that. I've adjusted the README.md with workarounds https://github.com/kvj/hass_nuki_ng#openunlatch-nuki-lock-via-ui

rectangular-starchaser commented 2 years ago

@kvj I updated in HACS; Deleted the former integration and did a new setup. I still had to enter a character in the field: "Nuki Bridge Host Name or IP Adress". Without this character I received the reported error code "User input malformed" again. Result of new set up: Nuki12-12

Next mission is to test the workaround.

Edit: Manualy calling the service works. Thanks a lot.

Regards