normen / homebridge-landroid

Homebridge plugin to control Worx Landroid robo mowers through the Worx Cloud
25 stars 8 forks source link

battery and mower data readout not correct #14

Closed ghdbwise closed 4 years ago

ghdbwise commented 4 years ago

Hi, since firmware 3.52 the battery data in homekit is not correct. See my config:

        {
            "email": "pxxxx@kxxxxxxx.de",
            "pwd": "password",
            "debug": true,
            "landroids": [
                {
                    "name": "Robert",
                    "dev_name": "1"
                }
            ],
            "platform": "Landroid"
        }

and the corresponding debug output:

[Landroid][DEBUG] DATA: {
    "cfg": {
        "id": 57548,
        "lg": "it",
        "tm": "12:48:01",
        "dt": "24/03/2020",
        "sc": {
            "m": 1,
            "p": 0,
            "d": [
                ["11:00", 0, 0],
                ["11:00", 135, 0],
                ["11:00", 135, 1],
                ["11:00", 135, 0],
                ["11:00", 135, 0],
                ["11:00", 135, 1],
                ["11:00", 0, 0]
            ]
        },
        "cmd": 0,
        "mz": [0, 0, 0, 0],
        "mzv": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        "rd": 240,
        "sn": "2x1x3x1x0x0x0x3x8xAx"
    },
    "dat": {
        "mac": "FxFx6x8x0x6x",
        "fw": 3.52,
        "bt": {
            "t": 22.7,
            "v": 19.61,
            "p": 69,
            "nr": 255,
            "c": 1,
            "m": 0
        },
        "dmp": [-0.8, 0.2, 338.8],
        "st": {
            "b": 5787,
            "d": 85697,
            "wt": 6039
        },
        "ls": 1,
        "le": 0,
        "lz": 7,
        "rsi": -54,
        "lk": 0
    }
}

As you can see under "dat:bt" you can find the battery data. As i interpret t - battery temperature v - voltage p - percentage nr - number of load cicles c - charging

sn and fw could be used for serial number and firmware information in Homekit.

I'm not familiar with coding javascript. So i thing it depends on you. If you find time please help us. regards Peter K.

normen commented 4 years ago

Thanks for the report and the detailed information.

What exactly do you mean by "not correct"? My Landroids have 3.52 too and I see the correct battery percentage in HomeKit. The code already uses the "dat.bt.p" value for the battery percentage (as it did all along).

DietmarHoch commented 4 years ago

Hi,

same Problem here since FW 3.52, Battery of the Mower says 0% in Eve app, in the Landroid app it is correct (something between 90 and 100%).

normen commented 4 years ago

What do the Apple Home App / Siri say? What mower is it? Did you try updating in the Landroid app first and then looking in HomeKit?

DietmarHoch commented 4 years ago

Apples Home app says also 0% i have a Landroid S (WR101Si) Landroid app is up to date (1.1.18)

normen commented 4 years ago

And the dat.bt.p value is zero as well when you enable debug output?

normen commented 4 years ago

If the debug display shows the correct value then it sounds like both of you didn't configure the name correctly. At some point in the log there should be a message like "Mower [name] configured. (#[name])". If there is no such message and you only see "Found mower [name] in Landroid Cloud" in the log then the name isn't set up correctly, set the name to "[name]" instead of "1", of course replacing [name] with the actual name.

Another hint that you didn't set up the correct name would be that you can't control the mower...

DietmarHoch commented 4 years ago

here is my debug output:

homebridge | [3/29/2020, 11:40:42 AM] [Landroid] [DEBUG] DATA: {"cfg":{"id":1,"lg":"it","tm":"11:40:41","dt":"29/03/2020","sc":{"m":1,"p":0,"d":[["12:00",0,0],["12:00",0,0],["12:00",0,0],["12:00",15,0],["12:00",0,0],["12:00",0,0],["12:00",0,0]]},"cmd":0,"mz":[0,0,0,0],"mzv":[0,0,0,0,0,0,0,0,0,0],"rd":120,"sn":"30174102170106030203"},"dat":{"mac":"F0FE6B205436","fw":3.52,"bt":{"t":16.5,"v":19.6,"p":100,"nr":1875,"c":0,"m":1},"dmp":[0.8,-1.8,308.9],"st":{"b":29630,"d":564761,"wt":33791},"ls":1,"le":0,"lz":1,"rsi":-53,"lk":0}}

normen commented 4 years ago

Yeah, so the value is transferred. Is there a "Mower X configured" message in your log? I suppose not then.

DietmarHoch commented 4 years ago

nope but there are some errors: 0|homebridge | [3/29/2020, 11:40:30 AM] [Landroid] Initializing Landroid platform... 0|homebridge | [3/29/2020, 11:40:30 AM] [Landroid] WARNING: No account configured, please set email and password of your Worx account in config.json! 0|homebridge | [3/29/2020, 11:40:30 AM] [Landroid] WARNING: Per-Landroid email/pass is not supported anymore. 0|homebridge | [3/29/2020, 11:40:30 AM] [Landroid] WARNING: Please update your config.json to use a global email and password in the Landroid platform. 0|homebridge | [3/29/2020, 11:40:30 AM] [Landroid] WARNING: The login data of the first Landroid will be used for the global login for now. 0|homebridge | [3/29/2020, 11:40:30 AM] [Landroid] WARNING: dev_sel parameter not supported anymore, use dev_name (usually dev_sel + 1) 0|homebridge | [3/29/2020, 11:40:30 AM] [Landroid] WARNING: Automatically creating name "1" for mower 0|homebridge | [3/29/2020, 11:40:30 AM] [Landroid] Initializing platform accessory 'My Landroid'...

DietmarHoch commented 4 years ago

updated my config, so the Warnings are gone, but there is no message like "Mower X configured"

normen commented 4 years ago

Please activate the thinking cap and read what I wrote, also what I wrote in those warning messages you just posted. You are still using an old configuration, thats why theres warnings.

So please fix those, disable debug mode and then use the dev_name that the plugin reports in the "Found mower [dev_name here] in Landroid Cloud" message on startup. Then it should work.

I guess that is your issue as well @ghdbwise - the mower dev_name is simply wrong and thats why the mower in HomeBridge doesn't show the updates and probably can't be controlled either.

DietmarHoch commented 4 years ago

got it

problem was the "dev_name", not the "name" the dev_name has to set to the "name" value in the debug log (......"name":"S"......), in my case "S".

Problem here, this name is only shown in the debug output (only there?)

And its a little bit confusing that the "dev_name" come from the debug log "name", and the "name" in the homebridge config can be anything like "My Landroid".

normen commented 4 years ago

Well the difference between name and dev_name is described in the README and the log always shows all mower names from the cloud - as described in the README as well. But anyway, if I get around to implementing #13 then setting a name won't be necessary anymore.

Closing this as there hasn't been any answer from OP either.

DietmarHoch commented 4 years ago

@normen: thanks for your help. @all: stay healthy