-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[miio] Add support for Xiaomi Vacuum Mop 2S #12723
Conversation
I would not call that lazy at all ;-) I think you essentially recreated another version of the miot file creator, right? which uses this to do most of the conversion: The intention is that this can be even triggered by users if there is an unsupported device. triggering the 'create experimental support' channel aims do make a json file from the online spec. |
Wrt to the contribution, looks good. Suggest to try if your device accepts a For the regular vacuums I marked several of the channels as 'advanced' but that is currently not possible with the json file created channels. Suggest to keep them unless they don't produce any data or they are really useless. (e.g. I can imagine the download progress channels are not really something that is usable for normal users) Would be great if you can also run the readme maker, so that the miio readme is updated with the right channels/info |
Oh... I didn't know it already existed... Would you suggest that I regenerate the json file using the referenced generator instead? I'll also have a look whether or not all channels returns something or not |
Yes, That is always good to do. It will also help with creating the comments for the readme file. What I normally do is to run the automatic thing and do a comparison with a similar device for validation. The typical final result is 90% auto generated and 10% manual edits/fixes etc. |
@marcelrv do you know if there is a way I can convert properties like this in a boolean in openhab?
I guess if I just put "boolean" it won't work as it'll send a boolean to the vacuum |
I think you can just make it a switch as type. in that case remove the statedescription section |
Just set to something like 4 or 5, that is accepted by most devices. If it gives strange responses (e.g. leave out responses or timeouts )you known it is too high |
Yes, looks like something is off. There are a few shortcuts in the conversion. I have seen the -1 before. I assumed it had something to do with unsigned vs signed number formats, but so far never really digged deep. I mostly remove max like that as it is not useful |
fd3986f
to
02f41bc
Compare
Ok, I've tried my best to provide the cleanest mapping possible. You can now review it to merge it Thanks for the guidances |
bundles/org.openhab.binding.miio/src/main/resources/database/ijai.vacuum.v19-miot.json
Outdated
Show resolved
Hide resolved
"piid":1, | ||
"friendlyName":"Disturb - Dnd Enable", | ||
"channel":"dnd_enable", | ||
"type":"Contact", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this not be a switch? Is the contact working properly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bundles/org.openhab.binding.miio/src/main/resources/database/ijai.vacuum.v19-miot.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few small comments. But looks good.
as I don't have commit rights, I added another reviewer. |
@Tiller You requested to merge your code into the |
No possible backport I guess? :( |
Signed-off-by: Tiller <github.me@tiller.fr>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks!
…nhab#12723) Signed-off-by: Tiller <github.me@tiller.fr>
…nhab#12723) Signed-off-by: Tiller <github.me@tiller.fr>
…nhab#12723) Signed-off-by: Tiller <github.me@tiller.fr> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
…nhab#12723) Signed-off-by: Tiller <github.me@tiller.fr>
…nhab#12723) Signed-off-by: Tiller <github.me@tiller.fr>
Hello,
I needed support for the new Xiaomi Vacuum Mop 2S but it didn't exist yet. So I tried to add support by myself and ended-up with this result.
This is not a complete PR as it's missing at the very least an entry in the README, but I wanted your feedback before proceeding.
As I'm quite lazy, I did not write the JSON spec file myself. I extracted the JSON model from https://home.miot-spec.com/spec?type=urn:miot-spec-v2:device:vacuum:0000A006:ijai-v19:1 and wrote this little script to do the conversion for me:
And it seems to work (I had time to only test some actions, but it did work).
But! I ended-up with a lot of actions and channels. A lot more than the others vacuums. So my main question is : how do I filter the actions / channels? Is there a criteria I could use? What's the rule on that usually? Can I keep them all?
Thanks
Note: the script could be used to import other devices from miot-spec.com :)