Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rectangular-starchaser opened this issue Nov 28, 2021 · 14 comments

Comments

@rectangular-starchaser
Copy link

rectangular-starchaser commented Nov 28, 2021

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
Copy link
Contributor

chpego commented Dec 2, 2021

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
Copy link
Author

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

@kvj
Copy link
Owner

kvj commented Dec 6, 2021

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
Copy link
Author

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:

vol.Optional("address", default=user_input.get("address", "")): cv.string,

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

@kvj
Copy link
Owner

kvj commented Dec 10, 2021

@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
Copy link
Author

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

  • curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer API_KEY_HERE' 'https://api.nuki.io/smartlock'
    which yields:
    [{"smartlockId":$id,"accountId":$accountid,"type":4,"lmType":0,"authId":$authid,"name":"Haustuer","favorite":false,"config":{"name":"Haustür","latitude":%lat_data,"longitude":$long_data,"autoUnlatch":true,"liftUpHandle":false,"pairingEnabled":true,"buttonEnabled":true,"ledEnabled":false,"ledBrightness":1,"timezoneOffset":0,"daylightSavingMode":0,"fobPaired":false,"fobAction1":4,"fobAction2":0,"fobAction3":0,"singleLock":false,"advertisingMode":0,"keypadPaired":false,"homekitState":1,"timezoneId":37,"deviceType":4,"wifiEnabled":true},"advancedConfig":{"totalDegrees":696,"singleLockedPositionOffsetDegrees":0,"unlockedToLockedTransitionOffsetDegrees":0,"unlockedPositionOffsetDegrees":0,"lockedPositionOffsetDegrees":0,"detachedCylinder":false,"batteryType":1,"autoLock":false,"autoLockTimeout":300,"autoUpdateEnabled":true,"lngTimeout":20,"singleButtonPressAction":1,"doubleButtonPressAction":5,"automaticBatteryTypeDetection":true,"unlatchDuration":3},"webConfig":{"batteryWarningPerMailEnabled":false},"state":{"mode":2,"state":3,"trigger":0,"lastAction":3,"batteryCritical":false,"batteryCharging":false,"batteryCharge":60,"keypadBatteryCritical":false,"doorsensorBatteryCritical":false,"doorState":0,"ringToOpenTimer":0,"nightMode":false},"firmwareVersion":196648,"hardwareVersion":2817,"serverState":0,"adminPinState":0,"virtualDevice":false,"creationDate":"2021-11-25T18:49:46.524Z","updateDate":"2021-12-10T15:53:02.527Z"}]

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

@kvj
Copy link
Owner

kvj commented Dec 10, 2021

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
Copy link
Author

rectangular-starchaser commented Dec 10, 2021

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
Copy link
Owner

kvj commented Dec 11, 2021

@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
Copy link
Author

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
Copy link
Owner

kvj commented Dec 11, 2021

@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
Copy link
Author

@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
Copy link
Owner

kvj commented Dec 12, 2021

@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
Copy link
Author

rectangular-starchaser commented Dec 12, 2021

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants