Code Monkey home page Code Monkey logo

landroid-bridge's Introduction

Landroid Bridge

Publishes readings from the Worx Landroid S Lawn Mower via HTTP (REST, JSON) and MQTT.

Setup

Prerequisites

  • If you want to use MQTT instead of HTTP, you need to have an MQTT Broker like Eclipse Mosquitto installed.
  • If you want to build from source, make sure you have Node.js installed.
  • If you want to use the pre-built Docker image, you need to have Docker up and running.

Using Docker

  1. Create a config.json file (see template in source).
  2. Run the image like this (assuming you want to link it with your MySQL container):
    docker run \
        -p 3000:3000 \
        --name landroid_bridge \
        --link mqtt:mqtt \
        -v /tmp/config.json:/usr/src/app/config.json \
        weweave/landroid-bridge
    

Building from source

  1. Make sure you have Node.js installed (tested with Node.js v8).
  2. Check out the source code and build it:
    git clone https://github.com/weweave/landroid-bridge.git
    cd landroid-bridge
    npm install
    npm run build-prod
    
  3. Update config.json to match your environment.
  4. Run the server:
    node dist/server.js
    

Connecting to OpenHAB

To connect this Landroid Bridge to OpenHAB, add the following configurations to your OpenHAB installation after Landroid Bridge is up and running successfully (see above):

  1. Install the MQTT Binding in OpenHAB (e.g. using the Paper UI).
  2. Add an MQTT configuration in services/mqtt.cfg:
    mqtt.url=tcp://mqtt:1883
    mqtt.user=MQTT_USERNAME
    mqtt.pwd=MQTT_PASSWORD
    
  3. Add items (e.g. in items/mower.items):
    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]"}
    

HTTP REST URLs

  • Get status: /landroid-s/status

MQTT Topics

  • landroid/status/language
  • landroid/status/dateTime
  • landroid/status/macAddress
  • landroid/status/firmware
  • landroid/status/wifiQuality
  • landroid/status/active
  • landroid/status/rainDelay
  • landroid/status/timeExtension
  • landroid/status/serialNumber
  • landroid/status/totalTime
  • landroid/status/totalDistance
  • landroid/status/totalBladeTime
  • landroid/status/batteryChargeCycle
  • landroid/status/batteryCharging
  • landroid/status/batteryVoltage
  • landroid/status/batteryTemperature
  • landroid/status/batteryLevel
  • landroid/status/errorCode
  • landroid/status/errorDescription:
  • landroid/status/statusCode
  • landroid/status/statusDescription

landroid-bridge's People

Contributors

maartendamen avatar

Watchers

 avatar  avatar

Forkers

mechamonk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.