Openhab-addons: Binding Request: Worx Landroid S (Modell 2017)

Created on 17 Jul 2017  ·  13Comments  ·  Source: openhab/openhab-addons

Deleted on request from the manufacturer.

All 13 comments

Hi,
I own the hardware as well and would be more than happy to contribute :-)
I had iobroker installed but don't like to use different automation tools.

Hi,
I also interested on a binding for Landroid S Model 2017 and can test and debug.

Deleted on request from the manufacturer.

Hi,
I also interested on a binding for Landroid S Model 2017 and can test.

@Silencer80 , would you pleeease help me with your soulution via teamwiever?
I always have troubles reciving certificates

Is it possible to install a Mosquitto-Server as Bridge and as Broker on the same System?
Can I have more than one config File on Mosquitto?

Hi,
I have the «pkcs12» Certifikate from my Landroid.
{
"pkcs12":"MIIRTERAzCCCV8G ………….B\/uxcECNtYBiY+Jv4V"
}
How can I convert this to a “.pem” file?

Deleted on request from the manufacturer.

@Silencer80
Hi Boris
My only problem is, which part of the PKCS12 do i need to save in which file. In p12, pxf or cer?
I tried it with Windows and a Base64 online decoder.
Tobi

Finally got this working to domotics (testing purposes) but battery is missing from 2017 model?

Certificate retrieved
Fetching root CA
Connecting to MQTT broker
Connected to MQTT broker - subscribing to DB510/F0FE6B207FB4/commandOut
Landroid status: {"state":"Home","errorMessage":null,"batteryPercentage":null,"totalMowingHours":35.8,"totalDistance":28249,"noOfAlarms":0}
Landroid status: {"state":"Home","errorMessage":null,"batteryPercentage":null,"totalMowingHours":35.8,"totalDistance":28249,"noOfAlarms":0}
Landroid status: {"state":"Home","errorMessage":null,"batteryPercentage":null,"totalMowingHours":35.8,"totalDistance":28249,"noOfAlarms":0}
Landroid status: {"state":"Home","errorMessage":null,"batteryPercentage":null,"totalMowingHours":35.8,"totalDistance":28249,"noOfAlarms":0}
Landroid status: {"state":"Home","errorMessage":null,"batteryPercentage":null,"totalMowingHours":35.8,"totalDistance":28249,"noOfAlarms":0}
Landroid status: {"state":"Home","errorMessage":null,"batteryPercentage":null,"totalMowingHours":35.8,"totalDistance":28249,"noOfAlarms":0}
Landroid status: {"state":"Home","errorMessage":null,"batteryPercentage":null,"totalMowingHours":35.8,"totalDistance":28249,"noOfAlarms":0}
Landroid status: {"state":"Home","errorMessage":null,"batteryPercentage":null,"totalMowingHours":35.8,"totalDistance":28249,"noOfAlarms":0}
Landroid status: {"state":"Home","errorMessage":null,"batteryPercentage":null,"totalMowingHours":35.8,"totalDistance":28249,"noOfAlarms":0}

thanks @Silencer80 !!!

Here some notes for others to complete/clear up the how to:

  • only copy string without the "" form the certificate to a empty file
  • convert the certificate with openssl in to a cert and key file (hint: import password is empty so just hit enter)
    openssl pkcs12 -in cert.pkcs12 -out cert.pem -clcerts -nokeys
    openssl pkcs12 -in cert.pkcs12 -out key.pem -nocerts -nodes
    (where cert.pkcs12 is your converted file you downloaded via POSTMAN as above)
  • download the ROOT CA file for Verisign (here) and rename to vs-ca.pem

  • install mosquitto server (Linux apt-get: install mosquitto)

  • copy both certificate files(key.pem and cert.pem) to /etc/mosquitto/certs
  • copy the verisign certificate (vs-ca.pem) file to etc/mosquitto/ca-certificates
  • create a new config file in /etc/mosquitto/conf.d/ named landroid.conf
    then paste this content:
connection landroid
bridge_cafile /etc/mosquitto/ca_certificates/vs-ca.pem
bridge_keyfile /etc/mosquitto/certs/key.pem
bridge_certfile /etc/mosquitto/certs/cert.pem
bridge_insecure false
address a1optpg91s0ydf.iot.eu-west-1.amazonaws.com:8883
local_clientid **Your Android ID here**
cleansession true
start_type automatic
notifications false
try_private false
topic commandOut in 0 DB510// DB510/**YOUR_MAC_GOES_HERE**/
topic commandIn out 0 DB510// DB510/**YOUR_MAC_GOES_HERE**/

To test the communication under Linux, install mosquitto-clients apt-get install mosquitto-clients, then run this command:

mosquitto_pub --cafile /etc/mosquitto/ca_certificates/vs-ca.pem --cert /etc/mosquitto/certs/cert.pem --key /etc/mosquitto/certs/key.pem -h a1optpg91s0ydf.iot.eu-west-1.amazonaws.com -p 8883 -q 1 -d -t DB510/**YOUR_LANDROID_MAC_ADDRESS**/commandOut -i **YOUR_ANDROID_ID**

Here some example items which all uses JSONPATH:

Number  Landroid_BAT_TEMP       "Battery Temp: [%.1f °C]"                       {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.dat.bt.t)]"}
Number  Landroid_BAT_VOLT       "Battery Voltage: [%.1f Volt]"                  {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.dat.bt.v)]"}
Number  Landroid_CHARGE_STATE   "is Recharging [MAP(landroid_charging.map):%s]" {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.dat.bt.c)]"}
Number  Landroid_Wifi_Signal    "WiFi-Signal: [%s dBm]"                         {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.dat.bt.rsi)]"} 
Number  Landroid_WI             "Worktime: [%.1f h]"                            {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.dat.st.wt)]]"}
Number  Landroid_WT_Blade       "Worktime Blade: [%.1f min]"                    {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.dat.st.b)]"}
Number  Landroid_Travel         "Traveled: [%.1f m]"                            {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.dat.st.d)]"}
Number  Landroid_RechargeCycles "Recharge Cycles: [%s]"                         {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.dat.bt.nr)]"}
Number  Landroid_Error          "Error State: [MAP(landroid_error.map):%s]"     {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.dat.le)]"}
Number  Landroid_State          "Statw: [MAP(landroid_status.map):%s]"          {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.dat.ls)]"}
Number  Landroid_MAC            "MAC Adresse: [%s]"                             {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.dat.mac)]"}
Number  Landroid_SN             "Serial No: [%s]"                               {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.cfg.sn)]"}
Number  Landroid_Firmware       "Firmware: [%s]"                                {mqtt="<[landroid:DB510//commandOut:state:JSONPATH($.dat.fw)]")

Update:
content of landroid_status.map:. put this file under /openhab2/conf/transform

0=Idle 
2=Start sequence
3=Leaving home
4=Follow wire
5=Searching home
6=Searching wire 
7=Mowing
8=Lifted
9=Trapped
10=Blade blocked
11=Debug
12=Remote control

content of landroid_error.map:. put this file under /openhab2/conf/transform

0=Everything is fine
1=Trapped
2=Lifted
3=Wire missing
4=Outside wire
5=Raining
6=Close door to mower
7=Close door to go home
8=Blade motor blocked
9=Wheel motor blocked
10=Trapped timeout
11=Upside down
12=Battery low
13=Reverse wire
14=Charge error
15=Timeout finding home

To Poll the Status more frequently, create a shell script (/opt/openhab2/etc/get_landroid_state.sh):

#!/bin/sh
mosquitto_pub --cafile /etc/mosquitto/ca_certificates/vs-ca.pem --cert /etc/mosquitto/certs/cert.pem --key /etc/mosquitto/certs/key.pem -h a1optpg91s0ydf.iot.eu-west-1.a$st-1.amazonaws.com -p 8883 -q 1 -d -t DB510/**YOUR_LANDROID_MAC_ADDRESS**/commandIn -i **YOUR_ANDROID_ID** -m '{}'

and add this to your crontab ( crontab -e) :

5 * * * * /opt/openhab2/etc/get_landroid_state.sh >/dev/null 2>&1

Hey @Silencer80 ,
is it possible that you could upload or post your map and js files? This would be nice as i dont have any Clou what i should put in there ;-)

Thanks!

Hey @All,

the manufacturer has informed me that this solution is bothering its systems. Above all, the polling function mentioned here by others causes considerable problems and costs.

So please do not use that anymore and refrain from polling.

Thank you!
-Boris

Was this page helpful?
0 / 5 - 0 ratings

Related issues

martinvw picture martinvw  ·  5Comments

smyrman picture smyrman  ·  4Comments

gk4 picture gk4  ·  3Comments

DanielMalmgren picture DanielMalmgren  ·  5Comments

openPhiL picture openPhiL  ·  5Comments