Worx Landroid S with openHAB

Tags: #<Tag:0x00007faeccecee10> #<Tag:0x00007faecceceb90> #<Tag:0x00007faeccece870>

Hi,

I know there’a already a working integration of the pre-2017 Worx Landroid Lawn Mowers with openHAB. However, I didn’t find a way to integrate my 2017 Worx Landroid S with openHAB. This is why I created a little solution for myself, which I released as open source, so that others can use it too.

The relevant software is a server which receives updates from the Landroid Cloud service and publishes these as MQTT topics or via an HTTP JSON REST service. You’ll find the source here:

After starting it up (either by building from source, or by starting a pre-built Docker image), you can add items in your openHAB installation like this:

Number Landroid_ErrorCode "Error Code [%d]" <lawnmower> {mqtt="<[mqtt:landroid/status/errorCode:state:default]"}
String Landroid_ErrorDescription "Error [%s]" <lawnmower> {mqtt="<[mqtt:landroid/status/errorDescription:state:default]"}
Number Landroid_StatusCode "Status Code [%d]" <lawnmower> {mqtt="<[mqtt:landroid/status/statusCode:state:default]"}
String Landroid_StatusDescription "Status [%s]" <lawnmower> {mqtt="<[mqtt:landroid/status/statusDescription:state:default]"}
String Landroid_DateTime "Last Update [%s]" <calendar> {mqtt="<[mqtt:landroid/status/dateTime:state:default]"}

This config can be used with an MQTT Broker like Eclipse Mosquitto. Make sure you activate the MQTT binding and change openHAB’s services/mqtt.cfg before adding your items.

Right now, the server only publishes the updates it receives from the Landroid Cloud. I’ll add update functionalities shortly. My idea is to stop the robot from mowing if it just rained or if rain is to be expected.

Kind regards,
Heiner

3 Likes

Are the values polled from the Worx cloud, or linked to their mqtt ?
What is the polling period, if so?

The bridge uses the iobroker.landroid-s NPM Module, which attaches to the Landroid Cloud via MQTT.

FYI: Today I’ve published an update which allows you to start and stop the mower. It’s also possible to change the rain delay and the time extension.

I tested it today.
Great work.

It reacts the same moment things happening. I was asking, because I was googlin arround saw that there was an implementaion which was polling in the past. This was stopped because the landroid servers were overloaded.
This was strange for me, because the mqtt should be lightweight enough to do this job.

Thanks

@virtualzone: This looks very interesting, because I am about to buy a robot mower.

Do you have additional information about which models are supported?

I am currently considering WR104SI.

Best regards,
Mikkel Holm Olsen

Hello @spiff42 ,

thanks for your feedback!

The software should work with all 2017/2018 Landroid S models, including your WR104SI. Not sure about the Landroid M models. I’ve only tested with my own WR101SI yet, so I’m not completely sure about the compatibility.

I’d really like to hear from people using the software with their Landroids to find our more about the supported models.

Kind regards,
Heiner

Hi,
i´ve a problem with the installation of this bridge.
I already used an older version, this works fine for me. The new version with the Webfrontend seems to be really cool, but i cant install it:
4036 error sqlite3@4.0.0 install: node-pre-gyp install --fallback-to-build
4036 error Exit status 1
4037 error Failed at the sqlite3@4.0.0 install script ‘node-pre-gyp install --fallback-to-build’.
4037 error Make sure you have the latest version of node.js and npm installed.
4037 error If you do, this is most likely a problem with the sqlite3 package,
4037 error not with npm itself.
4037 error Tell the author that this fails on your system:
4037 error node-pre-gyp install --fallback-to-build
4037 error You can get information on how to open an issue for this project with:
4037 error npm bugs sqlite3
4037 error Or if that isn’t available, you can get their info via:
4037 error npm owner ls sqlite3
4037 error There is likely additional logging output above.

Any ideas? All packages are up2date (including sqlite), I’m using the latest openhabian-version.

Thanks,
Dustin

HI @Dustin_Schmitt,
can you post the complete output of the “npm install” command? Thanks!

I have a wr105si. Everything works like a charm! Havent tried the time svettig yet but start/stop works. And all statuses.

Hi,

sure, here you are:
[21:10:58] openhabian@openHABianPi:~/landroid-bridge$ sudo npm install
[sudo] password for openhabian:

sqlite3@4.0.0 install /home/openhabian/landroid-bridge/node_modules/sqlite3
node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.0/node-v51-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@4.0.0 and node@7.10.1 (node-v51 ABI, glibc) (falling back to source compile with node-gyp)
gyp WARN EACCES user “root” does not have permission to access the dev dir “/root/.node-gyp/7.10.1”
gyp WARN EACCES attempting to reinstall using temporary dev dir “/home/openhabian/landroid-bridge/node_modules/sqlite3/.node-gyp”
make: Entering directory ‘/home/openhabian/landroid-bridge/node_modules/sqlite3/build’
make: *** No rule to make target ‘…/.node-gyp/7.10.1/include/node/common.gypi’, needed by ‘Makefile’. Stop.
make: Leaving directory ‘/home/openhabian/landroid-bridge/node_modules/sqlite3/build’
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:194:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.9.35-v7+
gyp ERR! command “/usr/bin/nodejs” “/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “build” “–fallback-to-build” “–module=/home/openhabian/landroid-bridge/node_modules/sqlite3/lib/binding/node-v51-linux-arm/node_sqlite3.node” “–module_name=node_sqlite3” “–module_path=/home/openhabian/landroid-bridge/node_modules/sqlite3/lib/binding/node-v51-linux-arm” “–node_abi_napi=node-v51”
gyp ERR! cwd /home/openhabian/landroid-bridge/node_modules/sqlite3
gyp ERR! node -v v7.10.1
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/openhabian/landroid-bridge/node_modules/sqlite3/lib/binding/node-v51-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/openhabian/landroid-bridge/node_modules/sqlite3/lib/binding/node-v51-linux-arm --node_abi_napi=node-v51’ (1)
node-pre-gyp ERR! stack at ChildProcess. (/home/openhabian/landroid-bridge/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:194:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:899:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 4.9.35-v7+
node-pre-gyp ERR! command “/usr/bin/nodejs” “/home/openhabian/landroid-bridge/node_modules/sqlite3/node_modules/.bin/node-pre-gyp” “install” “–fallback-to-build”
node-pre-gyp ERR! cwd /home/openhabian/landroid-bridge/node_modules/sqlite3
node-pre-gyp ERR! node -v v7.10.1
node-pre-gyp ERR! node-pre-gyp -v v0.9.0
node-pre-gyp ERR! not ok
Failed to execute ‘/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/openhabian/landroid-bridge/node_modules/sqlite3/lib/binding/node-v51-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/openhabian/landroid-bridge/node_modules/sqlite3/lib/binding/node-v51-linux-arm --node_abi_napi=node-v51’ (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“arm”})
npm WARN landroid-bridge@0.1.0 No repository field.
npm ERR! Linux 4.9.35-v7+
npm ERR! argv “/usr/bin/nodejs” “/usr/bin/npm” “install”
npm ERR! node v7.10.1
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! sqlite3@4.0.0 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@4.0.0 install script ‘node-pre-gyp install --fallback-to-build’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sqlite3
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /root/.npm/_logs/2018-05-12T19_12_02_478Z-debug.log

Thanks!

@Dustin_Schmitt

There seems to be an issue with the sqlite3 module on ARM: https://github.com/mapbox/node-sqlite3/issues/933

Here are hints for building from source: https://github.com/mapbox/node-sqlite3#source-install
Unfortunately, I have no Pi around for trying things out… Hope this still helps.

@virtualzone: Thanks, I will try it and give you a feedback.

Hi,
seems to be a problem with nodejs. I found an entry in roboter-forum.
With the following commands i could install nodejs, after that the build works fine.
“curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -” und “sudo apt install -y nodejs”
I build sqlite3 from source too.
The installation of the bridge then only works as root on openhabian, some directory cannot be created even when using sudo and an other user.
But i cannot start the bridge:

Loading config from /home/openhabian/landroid-bridge/config.json
internal/modules/cjs/loader.js:550
throw err;
^

Error: Cannot find module ‘iobroker.landroid-s/lib/landroid-cloud-2’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
at Function.Module._load (internal/modules/cjs/loader.js:475:25)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at Object. (/home/openhabian/landroid-bridge/dist/LandroidS.js:3:23)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)

Thanks!

Hi @Dustin_Schmitt ,
the landroid-s library got lost during the build-prod command. I’ve fixed the issue with a new version. Can you please pull it from GitHub, re-run “npm install && npm run build-prod” and check if it works?
Thanks!

Hi @virtualzone,
thanks, this works now! I can start the bridge and see the frontend. Cool, thanks.
Now my problem is wunderground:
To improve our services and enhance our relationship with our users, we will no longer provide free weather API keys as part of our program.
:frowning_face:

Best regards,
Dustin

Deleted

Hi @Dustin_Schmitt, it’s really bad that I’ve overseen Weatherground is not providing new API keys anymore (I’ve already had one which is still working). I’ll try to add a second weather provider shortly.

Hi @Jorgen_Johannessen, glad to see it’s working for you - thanks for the feedback! :slight_smile:

Hi @virtualzone,
they changed this just a few days ago, so nothing you could have seen bevor.
Would be fine, thanks for your great work!