andreypopov / node-red-contrib-miio-roborock

Xioami Roborock node-red nodes
Apache License 2.0
32 stars 12 forks source link

Reset consumables #45

Open paskovitch opened 2 years ago

paskovitch commented 2 years ago

What is the input node if I want to reset the main_brush_work_time?

andreypopov commented 2 years ago

I don't know, I use MiHome app

paskovitch commented 2 years ago

My goal is to completely ignore MiHome app.

Hoeby commented 1 year ago

The default "Reset consumables" didn't work for me. It sends the message with ack, but nothing happend. But i got it working by modifying the code a little (1 setting in de node)

I went to folder: nodered/data/node_modules/node-red-contrib-miio-roborock/lib/

In the folder is this file, open it to edit: miio-roborock-vocabulary.js

Go to Line211, there is this code line: reset_consumable: {name:"Reset consumables", link:"https://github.com/marcelrv/XiaomiRobotVacuumProtocol/blob/master/consumable.md", args:false},

Change the args from false to true reset_consumable: {name:"Reset consumables", link:"https://github.com/marcelrv/XiaomiRobotVacuumProtocol/blob/master/consumable.md", args:true},

Save the file. Restart nodered

When you now open the "command node" and choose for "reset consumables" there is now the option to add "payload" The payload needs to be added to reset the consumables. Payload has to be a string

What to fill in as payload

When you want to reset all 4 consumables. You need 4 separate "command nodes", each consumables has it's own node I haven't got it to work with in 1 node. For me the 4 nodes works, i am happy

Tested it an looked in nodered to the consumables value when doing "get consumables status". These went to 0. Looked in de MiHome app, the counters went back to 100%

I can't do a pull-request. I am not that good with github. But i hope the developer can have a look at it and change it in the code

Hoeby commented 1 year ago

Figured it out to make a pull request, and made the pull request. It is up to Andreypopov to merge it.