virtualzone / landroid-bridge

Bridge for connecting the Worx Landroid S Lawn Mower to home automation systems like OpenHAB or FHEM.
GNU General Public License v3.0
64 stars 48 forks source link

A lot of DNS traffic from bridge. #98

Open SDeath667 opened 4 years ago

SDeath667 commented 4 years ago

After updating to the last commit from yesterday everything started working again and I get the information I want. But I am still seeing a lot of DNS traffic coming from the bridge. After about 12 hours of running now I am at 80.000 requests, this is 4x more than my 2nd device in the list with 20.000 which is my Fibaro Home Center 2 that is controlling my entire house and fetching lots of data from the internet to base my scenes on.

Why is the bridge generating so much traffic, all the traffic goes to a Amazon AWS server. Landroid Bridge 1 Landroid Bridge 2 Landroid Bridge 3

KoKia13 commented 4 years ago

Same, then AWS blacklist the client IP :/

SDeath667 commented 4 years ago

142.000 requests in 24 hours.

SDeath667 commented 4 years ago

It is now back to normal after I guess exactly 24 hours. @KoKia13 have you seen the same behaviour?

KoKia13 commented 4 years ago

When I was using the bridge I was probably blacklisted regularly. I've made some tcpdump/wireshark checks and seen lot of requests. I've tried with a cron task to stop the service during the night... Few weeks ago with the version with the new auth, same. I've completely stopped to use the bridge now. And directly with Home Assistant making a rest request every minutes and parsing the json values from the Worx api website. I'm not able to push actions via AWS, (curl commands) I'm still blacklisted, I think. But it's not my main need. My main goal is just to trigger notifications when the mower is trapped, at home, etc.

Worx support:

Good Morning, we've noticed on our backend that you're using an unofficial client to connect to the IoT. Unfortunately this is not possible at the moment, because these clients poll the Landroid way too many times per day and they generate a lot of traffic on the server side. For this reason, when the server detects such unusual amounts of messages, they shut down the client for 24 hours. We advise you to use the official app to connect to the IoT. Thank you for your understanding. Kind Regards Azzurra

ciechompl commented 4 years ago

@KoKia13 would you be so kind and share your config how do you make those rest requests directly to worx api ? To be honest I do not need a full functionality of the landroid-bridge (even if idea itself is very cool :) ) but simple status info what my mower is doing at the moment is completely enough for me and most probably for many users here :)

KoKia13 commented 4 years ago

I'm retrieving a token, but this token cannot be passed automatically to the authentication of the rest command, so I'm storing it manually in the secret file. Based on this topic : https://easydomoticz.com/forum/viewtopic.php?t=8246 I'm using his client_secret and it's works,Next, I'll try to find one of my android installed app. HA Sensors:

  - platform: rest
    name: worx_token
    json_attributes:
      - access_token
    resource: https://api.worxlandroid.com/api/v2/oauth/token
    method: POST
    headers:
      Content-Type: application/json
    payload: '{"client_id": 1, "grant_type": "password", "scope": "*", "client_secret": "nCH3A0WvMYn66vGorjSrnGZ2YtjQWDiCvjg7jNxK", "username": "<YOUR WORX EMAIL>", "password":"<YOUR WORX PASSWORD>"}'
    scan_interval: 604800 # 7j
    value_template: '{{ value_json.value }}'

  - platform: rest
    name: worx_sensors
    json_attributes:
      - cfg
      - dat
    resource: https://api.worxlandroid.com/api/v2/product-items/<YOUR LANDROID SERIAL NUMBER>/status
    method: GET
    headers:
      Content-Type: application/json
      Authorization: !secret worxtoken
      #Authorization: 'Bearer {{ states.sensor.worx_token.attributes.access_token }}'
    scan_interval: 70
    value_template: '{{ value_json.value }}'

HA secret: worxtoken: "Bearer <YOUR WORX TOKEN>"

ciechompl commented 4 years ago

it's genius :) I truly hope that your method will inspire someone smart to develop normal integration without any bridges :)

Now challenge for me how to read received data: maybe just by chance :) do you have some guide ready ? :) or should we try to guess by ourselves :)

` cfg: lg: en tm: '23:10:09' dt: 17/04/2020 sc: m: 1 p: 0 d:

image

looks like unset ... How do you know what and when to trigger when the mower is trapped or at home etc.

KoKia13 commented 4 years ago

@ciechompl To not pollute this topic, here is my complete sensors file. Maybe some optimisations could be done. Do not hesitate. https://github.com/KoKia13/HomeAssistant-Landroid Enjoy.

ciechompl commented 4 years ago

thank you :) definitely I will make use of it :)

int5749 commented 4 years ago

Hi all, while it looks like virtualzone is no longer contributing to this, which is a shame.

But you may like to look into these two projects

Bridge to connect to various home projects https://www.roboter-forum.com/index.php?thread/41158-landroid-%C3%BCber-eine-mosquitto-mqtt-bridge-steuern-am-besipiel-von-openhab/&postID=567769#post567769

Binding to integrate Landroid to openHAB https://github.com/nibi79/worxlandroid/

Hope this helps and this is not to blame anyone rather to give opportunity to use different solutions ;-)

ciechompl commented 4 years ago

https://github.com/KoKia13/HomeAssistant-Landroid

@KoKia13 last small request :) could you also share code of your HA view/card ? you will save us hours on crafting such a nice view :)

virtualzone commented 4 years ago

@int5749 As stated at the top of the readme, I actually can't contribute as I don't own a Landroid anymore. I'm still looking at pull requests, merge them and build new Docker images. Thanks for your links.

KoKia13 commented 4 years ago

@ciechompl Enjoy ;)

ciechompl commented 4 years ago

@ciechompl Enjoy ;)

super super thank you :)