merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
364 stars 62 forks source link

Dreame L10s Ultra: Dock occupancy doesn’t update #531

Closed okonet closed 7 months ago

okonet commented 9 months ago

Describe the bug I see the occupancy sensor Dock appeared but it’s status never gets updated.

Expected behavior Occupancy should change when the vacuum leaves the docking station.

Your config.json

{
            "devices": [
                {
                    "name": "Wall-E",
                    "ip": "192.168.68.81",
                    "token": "727246516a3559424438324668536467",
                    "deviceId": "639176132",
                    "model": "dreame.vacuum.r2228o",
                    "pollingInterval": 10,
                    "deepDebugLog": false,
                    "customAccessory": false,
                    "buzzerControl": false,
                    "ledControl": false,
                    "childLockControl": false,
                    "modeControl": false,
                    "actionButtons": [
                        {
                            "action": "4.1",
                            "name": "Wische Bad",
                            "params": [
                                "{\"selects\":[[3,1,2,2,1]]}"
                            ]
                        }
                    ]
                }
            ],
            "platform": "miot"
        }

Debug log Nothing there.

merdok commented 9 months ago

You would need to start homebridge in debug mode and enable the deep debug option and provide one of the property syncs which should appear in the terminal, so that I can have a look and see if the values are correctly synced.

okonet commented 9 months ago

I run with debug and that's what I'm seeing:

[05/10/2023, 21:40:08] [miot] [Wall-E] Device properties updated: 
[
  "vacuum:status: 8",
  "vacuum:fault: 68",
  "vacuum:mode: 2",
  "battery:battery-level: 100",
  "battery:charging-state: 1",
  "brush-cleaner:brush-left-time: 289",
  "brush-cleaner:brush-life-level: 96",
  "brush-cleaner10:brush-left-time: 0 | (not synced)",
  "brush-cleaner10:brush-life-level: 0 | (not synced)",
  "filter:filter-life-level: 93",
  "filter:filter-left-time: 139",
  "vacuum-extend:work-mode: 0 | (not synced)",
  "vacuum-extend:cleaning-time: 31",
  "vacuum-extend:cleaning-area: 29",
  "vacuum-extend:cleaning-mode: 0 | (not synced)",
  "vacuum-extend:mop-mode: 0 | (not synced)",
  "vacuum-extend:waterbox-status: 0 | (not synced)",
  "vacuum-extend:task-status: 0 | (not synced)",
  "vacuum-extend:break-point-restart: 0 | (not synced)",
  "vacuum-extend:carpet-press: 0 | (not synced)",
  "vacuum-extend:serial-number:  | (not synced)",
  "vacuum-extend:clean-rags-tip: 0 | (not synced)",
  "vacuum-extend:keep-sweeper-time: 0 | (not synced)",
  "vacuum-extend:faults:  | (not synced)",
  "vacuum-extend:nation-matched:  | (not synced)",
  "vacuum-extend:relocation-status: 0 | (not synced)",
  "vacuum-extend:laser-switch: 0 | (not synced)",
  "vacuum-extend:ai-switch: 0 | (not synced)",
  "vacuum-extend:clean-setting: 0 | (not synced)",
  "vacuum-extend:mop-status: 0 | (not synced)",
  "vacuum-extend:custom-enable: 0 | (not synced)",
  "vacuum-extend:child-lock: 0 | (not synced)",
  "vacuum-extend:sensitivity: 0 | (not synced)",
  "vacuum-extend:mop-way: 0 | (not synced)",
  "vacuum-extend:clean-cancel: 0 | (not synced)",
  "vacuum-extend:carpet-distinguish: 0 | (not synced)",
  "vacuum-extend:autowash-switch: 0 | (not synced)",
  "vacuum-extend:warn-status: 0 | (not synced)",
  "vacuum-extend:carpet-clean: 0 | (not synced)",
  "vacuum-extend:auto-add-detergent: 0 | (not synced)",
  "vacuum-extend:dry-time: 0 | (not synced)",
  "vacuum-extend:nowater-tips: 0 | (not synced)",
  "do-not-disturb:enable: false | (not synced)",
  "do-not-disturb:start-time:  | (not synced)",
  "do-not-disturb:end-time:  | (not synced)",
  "map:mult-map-state: 0 | (not synced)",
  "map:mult-map-info:  | (not synced)",
  "audio:volume: 0 | (not synced)",
  "audio:voice-packet-id:  | (not synced)",
  "audio:voice-change-state:  | (not synced)",
  "time:time-zone:  | (not synced)",
  "time:timer-clean:  | (not synced)",
  "clean-logs:first-clean-time: 0 | (not synced)",
  "clean-logs:total-clean-time: 625",
  "clean-logs:total-clean-times: 15",
  "clean-logs:total-clean-area: 510",
  "collect-dust:auto-collect: 0 | (not synced)",
  "collect-dust:clean-times: 0 | (not synced)",
  "collect-dust:dust-enable: 0 | (not synced)",
  "collect-dust:dust-status: 0 | (not synced)",
  "mop:mop-life-level: 0 | (not synced)",
  "mop:mop-left-time: 0 | (not synced)",
  "silver-ion:silverion-life-time: 0 | (not synced)",
  "silver-ion:silverion-life-level: 0 | (not synced)"
]
[05/10/2023, 21:40:18] [miot] [Wall-E] Preparing property poll!
[05/10/2023, 21:40:18] [miot] [Wall-E] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14
[05/10/2023, 21:40:18] [miot] [Wall-E] Chunks:  [
 [
  "vacuum:status",
  "vacuum:mode",
  "vacuum:fault",
  "battery:battery-level",
  "battery:charging-state",
  "brush-cleaner:brush-left-time",
  "brush-cleaner:brush-life-level",
  "filter:filter-life-level",
  "filter:filter-left-time",
  "vacuum-extend:cleaning-time",
  "vacuum-extend:cleaning-area",
  "clean-logs:total-clean-time",
  "clean-logs:total-clean-times",
  "clean-logs:total-clean-area"
 ]
]
[05/10/2023, 21:40:18] [miot] [Wall-E] (Protocol) Call 192.168.68.81: get_properties - [{"did":"639176132","siid":2,"piid":1},{"did":"639176132","siid":2,"piid":3},{"did":"639176132","siid":2,"piid":2},{"did":"639176132","siid":3,"piid":1},{"did":"639176132","siid":3,"piid":2},{"did":"639176132","siid":9,"piid":1},{"did":"639176132","siid":9,"piid":2},{"did":"639176132","siid":11,"piid":1},{"did":"639176132","siid":11,"piid":2},{"did":"639176132","siid":4,"piid":2},{"did":"639176132","siid":4,"piid":3},{"did":"639176132","siid":12,"piid":2},{"did":"639176132","siid":12,"piid":3},{"did":"639176132","siid":12,"piid":4}] - {}
[05/10/2023, 21:40:18] [miot] [Wall-E] (Protocol) Start handshake 192.168.68.81
[05/10/2023, 21:40:18] [miot] [Wall-E] (Protocol) 192.168.68.81 <- (2) {"method":"get_properties","params":[{"did":"639176132","siid":2,"piid":1},{"did":"639176132","siid":2,"piid":3},{"did":"639176132","siid":2,"piid":2},{"did":"639176132","siid":3,"piid":1},{"did":"639176132","siid":3,"piid":2},{"did":"639176132","siid":9,"piid":1},{"did":"639176132","siid":9,"piid":2},{"did":"639176132","siid":11,"piid":1},{"did":"639176132","siid":11,"piid":2},{"did":"639176132","siid":4,"piid":2},{"did":"639176132","siid":4,"piid":3},{"did":"639176132","siid":12,"piid":2},{"did":"639176132","siid":12,"piid":3},{"did":"639176132","siid":12,"piid":4}],"id":5}
�톙���#Gr�SyE���=0:18] [miot] [Wall-E] (Protocol) 192.168.68.81 <- !1p&
[05/10/2023, 21:40:18] [miot] [Wall-E] (Protocol) 192.168.68.81 -> Data: {"id":5,"result":[{"siid":2,"did":"639176132","piid":1,"value":8,"code":0},{"siid":2,"did":"639176132","piid":3,"value":2,"code":0},{"siid":2,"did":"639176132","piid":2,"value":68,"code":0},{"siid":3,"did":"639176132","piid":1,"value":100,"code":0},{"siid":3,"did":"639176132","piid":2,"value":1,"code":0},{"siid":9,"did":"639176132","piid":1,"value":289,"code":0},{"siid":9,"did":"639176132","piid":2,"value":96,"code":0},{"siid":11,"did":"639176132","piid":1,"value":93,"code":0},{"siid":11,"did":"639176132","piid":2,"value":139,"code":0},{"siid":4,"did":"639176132","piid":2,"value":31,"code":0},{"siid":4,"did":"639176132","piid":3,"value":29,"code":0},{"siid":12,"did":"639176132","piid":2,"value":625,"code":0},{"siid":12,"did":"639176132","piid":3,"value":15,"code":0},{"siid":12,"did":"639176132","piid":4,"value":510,"code":0}],"exe_time":11}
[05/10/2023, 21:40:18] [miot] [Wall-E] (Protocol) 192.168.68.81 -> Message: {"id":5,"result":[{"siid":2,"did":"639176132","piid":1,"value":8,"code":0},{"siid":2,"did":"639176132","piid":3,"value":2,"code":0},{"siid":2,"did":"639176132","piid":2,"value":68,"code":0},{"siid":3,"did":"639176132","piid":1,"value":100,"code":0},{"siid":3,"did":"639176132","piid":2,"value":1,"code":0},{"siid":9,"did":"639176132","piid":1,"value":289,"code":0},{"siid":9,"did":"639176132","piid":2,"value":96,"code":0},{"siid":11,"did":"639176132","piid":1,"value":93,"code":0},{"siid":11,"did":"639176132","piid":2,"value":139,"code":0},{"siid":4,"did":"639176132","piid":2,"value":31,"code":0},{"siid":4,"did":"639176132","piid":3,"value":29,"code":0},{"siid":12,"did":"639176132","piid":2,"value":625,"code":0},{"siid":12,"did":"639176132","piid":3,"value":15,"code":0},{"siid":12,"did":"639176132","piid":4,"value":510,"code":0}],"exe_time":11}
[05/10/2023, 21:40:18] [miot] [Wall-E] Successfully updated property chunk! RAW: [{"siid":2,"did":"639176132","piid":1,"value":8,"code":0},{"siid":2,"did":"639176132","piid":3,"value":2,"code":0},{"siid":2,"did":"639176132","piid":2,"value":68,"code":0},{"siid":3,"did":"639176132","piid":1,"value":100,"code":0},{"siid":3,"did":"639176132","piid":2,"value":1,"code":0},{"siid":9,"did":"639176132","piid":1,"value":289,"code":0},{"siid":9,"did":"639176132","piid":2,"value":96,"code":0},{"siid":11,"did":"639176132","piid":1,"value":93,"code":0},{"siid":11,"did":"639176132","piid":2,"value":139,"code":0},{"siid":4,"did":"639176132","piid":2,"value":31,"code":0},{"siid":4,"did":"639176132","piid":3,"value":29,"code":0},{"siid":12,"did":"639176132","piid":2,"value":625,"code":0},{"siid":12,"did":"639176132","piid":3,"value":15,"code":0},{"siid":12,"did":"639176132","piid":4,"value":510,"code":0}]

Not sure which property to look for, though.

merdok commented 9 months ago

Well the status reported by your device in the provided log is "Drying". Does the drying happen at the dock? Does it always stay like that in the "Drying" status or does it ever change to "Charging"?

okonet commented 9 months ago

Yes, "Drying" is happening in the dock. Currently, it's "vacuum:status: 13", but it's still not indicated as occupied:

CleanShot 2023-10-06 at 08 01 49@2x

From these statutes:

1 - Sweeping
2 - Idle
3 - Paused
4 - Error
5 - Go Charging
6 - Charging
7 - Mopping
8 - Drying
9 - Washing
10 - Go Washing
11 - Building
12 - Sweeping and Mopping
13 - Charging Completed
14 - Upgrading

6, 8, 9, 13, 14 are all happening in the Dock.

okonet commented 9 months ago

It feels like https://github.com/merdok/homebridge-miot/blob/021189ab53d422ba693d81267d658e45db9ceb58/lib/modules/robotcleaner/RobotCleanerAccessory.js#L55 should be able to accept multiple props with the logical OR operator.

merdok commented 9 months ago

Yes, you are correct! Currently it only checks for the "Charging" status. That would need to be extended to check multiple status values. When I have some time I will have a look at it.

okonet commented 9 months ago

🙏

merdok commented 7 months ago

Sorry for the delay, that should work now correctly. Multiple statuses are now being taken into account

okonet commented 7 months ago

Thanks a lot. Much appreciated.