Creation of Vorwerk Kobold Component

Current Neato component is dropping support for Vorwerk Kobold robot vacuums, Pull request 44031, due to different authentication method. Pybotvac already supports the new authentication method used by Vorwerk.
Can someone help in the creation of the component?

I really hope this would be picked up, as it is basically the same product, just way more expensive. Lesson: donā€™t get a vorwerk, get a neato.

I kept going with Vorwerk VR200 vacuum cleaner until the new version of HA (or the new integration of Neato) got rid of that, yesterday.
Now I am stuck

you can use it as custom component. That is what Iā€™m doing right now. At least I still have 2 more months.

Mainly the neato integration should be copied and added with the auth of the new servers.

On homebridge side it works verry well.

There was a decision taken by HA developers to drop the support of Vorwerk. They state that needs to be created a separate component. I donā€™t know how to program, so unless a programmer picks this topic we will not have any solution.

I am happy to help anyone who wants to start a new integration. Pybotvac supports the new auth flow. All platforms (sensor, switch, vacuum and camera) can be copied from neato. Only initialization and config flow need to be recreated.

I just wonā€™t do it myself, as I donā€™t have a Vorwerk vacuum and therefore canā€™t support these devices accordingly in the long term.

I have a Vorwerk VR200 vacuum and I do use HA. I am going to try Pybotvac to connect to it using Python.
If (actually big IF) I achieve that, I am afraid I will need some help on what exactly needs to be done to create an ā€œinitialization and config flowā€ for HA integration.
Anyway, Iā€™ll be happy to try.

In short:

  • Read and understand the important parts of OAuth2 and Openid Connect
  • Create a new integration using a scaffolding script Most likely this one
  • Complete in the missing parts
  • Add one platform for the beginning, you can add more later
  • Think about a possible config flow, eg:
    1. User starts config flow
    2. User has to enter itā€™s E-Mail address
    3. User receives an one-time-password via E-Mail
    4. User enters this password
    5. Integration is set up
  • You now have all the required information together (access_token, id_token, refresh_token) - save them in your configuration entry

Iā€™m really not sure about the last part. You may have to overwrite LocalOAuth2Implementation, since HA mainly supports plain OAuth2 and not the passwordless flow used by vorwerk.

Additional information: https://developers.home-assistant.io/docs/api_lib_auth/#oauth2

alright: I just tried before bedtime
I started chasing serial number and secret code using the passwordless session method, as suggested by Pybotvac-github for Vorwerk / MyKobold stuff andā€¦ I did receive the auth code by email AND got the Pyjton program to respond with my Robotā€™s serial number and secret code (consistently as I tried twice).

Unfortunately when I then tried to control the robot through Python (or just inquiring its name through print(robot)), I only get an error

ā€œpybotvac.exceptions.NeatoRobotException: Unable to communicate with robotā€

soā€¦ bad start I am afraid, but now itā€™s bedtime and Iā€™ll probably have to stop playing with this until next weekend

1 Like

Not at all. Just set a debug point and take a look whatā€™s going wrong. Please take a look at this branch of it works for you: Validiate responses by Santobert Ā· Pull Request #68 Ā· stianaske/pybotvac Ā· GitHub

Any updates? Could help with testing and loggingā€¦ for VR200 and VR300.
For Homebridge there is a working implementationā€¦

If you need testing I have a vr200 and can help to

Hi,

I did some testing with the neato component. The current pybotvac implementation doesnā€™t support token refresh with passwordless authentication. Iā€™m currently reading the documentation of Auth0. But as long as pybotvac doesnā€™t support refresh_tokens in the passwordless session I donā€™t think this will work.

I found out that the robot control API is not secured by OAuth. It uses the Serial and a Secret for each robot.

I will create a new Vorwerk Integration that will just store Serial and Secret of each robot to control it. That should be enough to bring back vacuum, sensor and switch. Only the camera needs an OAuth secureted API call.

When this is working I will dig into the Passwordless OAuth in pybotvac to add the missing refresh_token support.

Bye

Michael

5 Likes

Do you mean local control of the robot or cloud control?

The REST-API in the cloud to start the robot is not secured by OAuth. See: https://github.com/stianaske/pybotvac#robot

You just need serial and secret of the robot for cloud control.

By the way, I think I found a way to get the OAuth token via passwordless authentication.

1 Like

Hi,

I created a pull request for my vorwerk integration:

VR200 is working. VR300 should work to, but without the map functionality as this needs OAuth and the current Vorwerk + Auth0 setup is somehow strange. It uses the id_token in a Auth0Bearer Authorization Header. And when calling a token refresh Python complains about the scope of the new token.

Itā€™s possible to configure the integration by the User Config Flow in the UI (E-Mail and Code) or by adding the SERIAL+SECRET_KEY of the robot in your configuration.yml.

As far as I can see the id_token has only a life time of 10h (https://auth0.com/docs/tokens/id-tokens#id-token-lifetime).
Neato uses the access_token combined with a refresh_token to update the access_token when needed. The id_token is use less after 10h. There is also a refresh_token but, Pybotvac and node-kobold-oauth donā€™t have the refresh logic implemented. So home assistant canā€™t receive the robot list after 10h.

Thankyou very much for your efforts getting this up and running - install process went smoothly with a couple of logged warnings;

2021-01-31 11:46:44 WARNING (SyncWorker_33) [pybotvac.robot] Invalid response from https://nucleo.ksecosys.com/vendors/vorwerk/robots/4QQ9VPPT-985DAD82042F/messages: required key not provided @ data[ā€˜stateā€™]. Got: {ā€˜versionā€™: 1, ā€˜reqIdā€™: ā€˜1ā€™, ā€˜resultā€™: ā€˜koā€™, ā€˜errorā€™: ā€˜ui_alert_invalidā€™}
2021-01-31 11:47:41 WARNING (SyncWorker_7) [pybotvac.robot] Invalid response from https://nucleo.ksecosys.com/vendors/vorwerk/robots/4QQ9VPPT-985DAD82042F/messages: required key not provided @ data[ā€˜stateā€™]. Got: {ā€˜versionā€™: 1, ā€˜reqIdā€™: ā€˜1ā€™, ā€˜resultā€™: ā€˜koā€™, ā€˜errorā€™: ā€˜ui_alert_invalidā€™}
2021-01-31 11:52:32 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140058723240784] Client unable to keep up with pending messages. Stayed over 512 for 5 seconds
2021-01-31 11:58:07 WARNING (SyncWorker_8) [pybotvac.robot] Invalid response from https://nucleo.ksecosys.com/vendors/vorwerk/robots/4QQ9VPPT-985DAD82042F/messages: required key not provided @ data[ā€˜stateā€™]. Got: {ā€˜versionā€™: 1, ā€˜reqIdā€™: ā€˜1ā€™, ā€˜resultā€™: ā€˜koā€™, ā€˜errorā€™: ā€˜ui_alert_invalidā€™}
2021-01-31 12:04:32 WARNING (SyncWorker_38) [pybotvac.robot] Invalid response from https://nucleo.ksecosys.com/vendors/vorwerk/robots/4QQ9VPPT-985DAD82042F/messages: required key not provided @ data[ā€˜stateā€™]. Got: {ā€˜versionā€™: 1, ā€˜reqIdā€™: ā€˜1ā€™, ā€˜resultā€™: ā€˜koā€™, ā€˜errorā€™: ā€˜ui_alert_invalidā€™}
2021-01-31 12:04:46 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140058912286656] Client unable to keep up with pending messages. Stayed over 512 for 5 seconds
2021-01-31 12:10:09 WARNING (SyncWorker_9) [pybotvac.robot] Invalid response from https://nucleo.ksecosys.com/vendors/vorwerk/robots/4QQ9VPPT-985DAD82042F/messages: required key not provided @ data[ā€˜stateā€™]. Got: {ā€˜versionā€™: 1, ā€˜reqIdā€™: ā€˜1ā€™, ā€˜resultā€™: ā€˜koā€™, ā€˜errorā€™: ā€˜ui_alert_invalidā€™}
2021-01-31 12:10:56 WARNING (SyncWorker_12) [pybotvac.robot] Invalid response from https://nucleo.ksecosys.com/vendors/vorwerk/robots/4QQ9VPPT-985DAD82042F/messages: required key not provided @ data[ā€˜stateā€™]. Got: {ā€˜versionā€™: 1, ā€˜reqIdā€™: ā€˜1ā€™, ā€˜resultā€™: ā€˜koā€™, ā€˜errorā€™: ā€˜ui_alert_invalidā€™}

How did you configured your robot? Through the UI or using configuration.yank?
It looks like the endpoint url is wrong. The Port is 4443 for my robot. I think it should be: https://nucleo.ksecosys.com:4443