Skip to content
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

[veSync] 131 and Vital Purifiers base support #15296

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

dag81
Copy link
Contributor

@dag81 dag81 commented Jul 23, 2023

Adjustments to add base support for Purifiers 131 and Vital model's
Signed-off-by: David Goodyear [email protected]

This correct's support for two 131 based models. It has been tested and updated via simulations of a proven working interface PyVeSync against the payloads generated from this updated revision.

This add's support for 2 new Vital named devices - the 100S and 200S.

Corrected humidifier mode support for 2 device models, added additional validation to humidifier support to ensure the new extra pet mode is not used, and apply restrictions based on the pyvesync lib setups.

Title

  • [veSync] Improve support for PUR131 devices
  • [veSync] Add base support for Vital 100S
  • [veSync] Add base support for Vital 200S
  • [veSync] Bug fix to stop console errors when manual scanning
  • [veSync] Add warm mist level for Oasis and 600S humidifiers models
  • [veSync] Updated Oasis and 600S to use humifier mode at protocol level for Auto in OpenHab
  • [veSync] Add's support for Oasis 1000 model

Description

This is a improvement to potentially add the support of PUR131 devices. The motivation is attempting to add missing devices to complete the support of the binding across the entire range.

This also add's base support for 2 new devices the Vital 100S and Vital 200S.

Includes bug fix, after cross checking the hue binding - added check for a null bridge reference, to prevent null pointer errors appearing.

Add's updates to support writing to the warm mist channel, tested via simulations again, against the pyvesync system.

Testing

Testing for this has been done by writing a simulator that interfaces to a know good implementation PyVeSync. The simulator then allowed cross comparison of its behaviors via this one to ensure they both interact with the external system correctly. The changes in this align the support for the PUR131 devices, so that they should work. The Vital support is based on simulations as well, and a few channel's have intentionally been removed for now, until issues in PyVeSync are closed and any adjustments made, and therefore mapped to this binding. The Vital support implemented has been confirmed as working in PyVeSync looking through the testing threads.

@dag81 dag81 marked this pull request as ready for review July 23, 2023 21:07
@dag81
Copy link
Contributor Author

dag81 commented Jul 23, 2023

I suspect the checks failed due to issues outside of this PR. The initial commit passed all checks. This one only has a README.md update, and spotless:apply locally does not change the file that was committed. How can I retry the checks for the PR, to get the necessary ticks?

@dag81 dag81 marked this pull request as draft July 23, 2023 21:34
@dag81 dag81 marked this pull request as ready for review July 23, 2023 22:31
@dag81 dag81 marked this pull request as draft July 24, 2023 01:16
@dag81
Copy link
Contributor Author

dag81 commented Jul 24, 2023

Converted back to draft, as no ones assigned yet, to save adding another PR later on, for 2 more set's of devices. Please advise on the first question however - for future reference - looks like it fixed between checkin's.

@lolodomo lolodomo added the enhancement An enhancement or new feature for an existing add-on label Jul 27, 2023
@dag81 dag81 force-pushed the bindings/vesync/pur131updates branch 2 times, most recently from 0570d7b to 554463e Compare July 28, 2023 17:13
@dag81 dag81 changed the title [veSync] PUR131 Corrections [veSync] 131 and Vital Purifiers base support Jul 28, 2023
@dag81 dag81 force-pushed the bindings/vesync/pur131updates branch from 1512491 to 61038d4 Compare July 28, 2023 17:33
@dag81 dag81 marked this pull request as ready for review July 28, 2023 18:22
@dag81 dag81 force-pushed the bindings/vesync/pur131updates branch from 2eab3b3 to 4aa47e5 Compare July 28, 2023 18:54
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/vesync-levoit-binding-help-testing-requested/144175/18

@dag81 dag81 force-pushed the bindings/vesync/pur131updates branch 3 times, most recently from 43b02e1 to 78014c0 Compare July 31, 2023 13:00
@dag81 dag81 marked this pull request as draft July 31, 2023 14:41
@dag81 dag81 force-pushed the bindings/vesync/pur131updates branch 5 times, most recently from 5707696 to 240da85 Compare August 1, 2023 11:05
@dag81 dag81 marked this pull request as ready for review August 1, 2023 11:05
@dag81 dag81 force-pushed the bindings/vesync/pur131updates branch 2 times, most recently from eb2fea9 to a01cd5a Compare August 1, 2023 11:20
@dag81 dag81 force-pushed the bindings/vesync/pur131updates branch from ce90246 to 239b3d3 Compare August 6, 2023 21:48
@lsiepel
Copy link
Contributor

lsiepel commented Feb 21, 2024

@dag81 i might review this, but before that review, this PR has to build succesfull wihtout new SAT errors or warnigs. Can you sync your branches with openhab main, fix the conflicts and try to build it? Also the license headers should change to 2024.
If you need any help with those steps, please let me know.
Edit: Thing-upgrade instructison have to be added as some existings Things have channels added. See here: https://www.openhab.org/docs/developer/bindings/thing-xml.html#updating-thing-types

[veSync] Bridge i18n support improvements
Signed-off-by: dag81 <[email protected]>
[veSync] i18n updates
Signed-off-by: dag81 <[email protected]>
[veSync] unithints corrected for correct display from devices

Signed-off-by: dag81 <[email protected]>
[veSync] httpClient clean-up

Signed-off-by: dag81 <[email protected]>
[veSync] PR Feedback

Signed-off-by: dag81 <[email protected]>
@dag81
Copy link
Contributor Author

dag81 commented Nov 23, 2024

5. Thing upgrade instructions for the added channels are mandatory for this PR.

Hi @lsiepel, Hopefully this finds you well. I was just looking through this and testing on a M4 build against the device I have, I think this likely need's to be merged asap. So will limit the clean-up's to make sure we can hopefully get this in before the cut-off - as otherwise the units switch to % with the new units model for a few bits, as this binding is a old one and my first one. Looking at it I will likely do a deeper pass on it to fully clean it all up, but figured first and most importantly the key is to have it operating like the original binding did, several releases back.

Regarding the point I've quoted - can you give an example of a binding that has these, that I can use as a reference please?

[veSync] english cleanup

Signed-off-by: dag81 <[email protected]>
[veSync] cleanups

Signed-off-by: dag81 <[email protected]>
@lsiepel
Copy link
Contributor

lsiepel commented Nov 23, 2024

  1. Thing upgrade instructions for the added channels are mandatory for this PR.

Hi @lsiepel, Hopefully this finds you well. I was just looking through this and testing on a M4 build against the device I have, I think this likely need's to be merged asap. So will limit the clean-up's to make sure we can hopefully get this in before the cut-off - as otherwise the units switch to % with the new units model for a few bits, as this binding is a old one and my first one. Looking at it I will likely do a deeper pass on it to fully clean it all up, but figured first and most importantly the key is to have it operating like the original binding did, several releases back.

Regarding the point I've quoted - can you give an example of a binding that has these, that I can use as a reference please?

Reference to the documentation: https://www.openhab.org/docs/developer/bindings/thing-xml.html#updating-thing-types

homewizard is a binding that has these instructions.

The refactoring of this binding should be a seperate PR, als try to prevent breaking changes.

@dag81
Copy link
Contributor Author

dag81 commented Nov 23, 2024

  1. Thing upgrade instructions for the added channels are mandatory for this PR.

Hi @lsiepel, Hopefully this finds you well. I was just looking through this and testing on a M4 build against the device I have, I think this likely need's to be merged asap. So will limit the clean-up's to make sure we can hopefully get this in before the cut-off - as otherwise the units switch to % with the new units model for a few bits, as this binding is a old one and my first one. Looking at it I will likely do a deeper pass on it to fully clean it all up, but figured first and most importantly the key is to have it operating like the original binding did, several releases back.
Regarding the point I've quoted - can you give an example of a binding that has these, that I can use as a reference please?

Reference to the documentation: https://www.openhab.org/docs/developer/bindings/thing-xml.html#updating-thing-types

homewizard is a binding that has these instructions.

The refactoring of this binding should be a seperate PR, als try to prevent breaking changes.

Thank you @lsiepel :) Yeah definitely trying to avoid breaking changes overall :)

[veSync] Humidifier units tuning

Signed-off-by: dag81 <[email protected]>
[veSync] protocol device id update

Signed-off-by: dag81 <[email protected]>
[veSync] protocol alignment to redundant data against pyvesync

Signed-off-by: dag81 <[email protected]>
[veSync] cleanup casting uses

Signed-off-by: dag81 <[email protected]>
@dag81 dag81 marked this pull request as ready for review November 24, 2024 19:31
@dag81
Copy link
Contributor Author

dag81 commented Nov 24, 2024

  1. Thing upgrade instructions for the added channels are mandatory for this PR.

Hi @lsiepel, Hopefully this finds you well. I was just looking through this and testing on a M4 build against the device I have, I think this likely need's to be merged asap. So will limit the clean-up's to make sure we can hopefully get this in before the cut-off - as otherwise the units switch to % with the new units model for a few bits, as this binding is a old one and my first one. Looking at it I will likely do a deeper pass on it to fully clean it all up, but figured first and most importantly the key is to have it operating like the original binding did, several releases back.
Regarding the point I've quoted - can you give an example of a binding that has these, that I can use as a reference please?

Reference to the documentation: https://www.openhab.org/docs/developer/bindings/thing-xml.html#updating-thing-types

homewizard is a binding that has these instructions.

The refactoring of this binding should be a seperate PR, als try to prevent breaking changes.

I've opened the PR as Ready, I have just got to look through this and add these bits. I did this in case you wanted to check anything else, while I add this final bit, then its open and ready, to save to time going to and fro. @lsiepel

[veSync] air purifier update instructions pass 1

Signed-off-by: dag81 <[email protected]>
[veSync] air purifier options attempt 1

Signed-off-by: dag81 <[email protected]>
[veSync] air humidifier update template base

Signed-off-by: dag81 <[email protected]>
[veSync] readme updates

Signed-off-by: dag81 <[email protected]>
[veSync] update script updates

Signed-off-by: dag81 <[email protected]>
[veSync] update script updates

Signed-off-by: dag81 <[email protected]>
@dag81
Copy link
Contributor Author

dag81 commented Nov 25, 2024

  1. Thing upgrade instructions for the added channels are mandatory for this PR.

Hi @lsiepel, Hopefully this finds you well. I was just looking through this and testing on a M4 build against the device I have, I think this likely need's to be merged asap. So will limit the clean-up's to make sure we can hopefully get this in before the cut-off - as otherwise the units switch to % with the new units model for a few bits, as this binding is a old one and my first one. Looking at it I will likely do a deeper pass on it to fully clean it all up, but figured first and most importantly the key is to have it operating like the original binding did, several releases back.
Regarding the point I've quoted - can you give an example of a binding that has these, that I can use as a reference please?

Reference to the documentation: https://www.openhab.org/docs/developer/bindings/thing-xml.html#updating-thing-types
homewizard is a binding that has these instructions.
The refactoring of this binding should be a seperate PR, als try to prevent breaking changes.

I've opened the PR as Ready, I have just got to look through this and add these bits. I did this in case you wanted to check anything else, while I add this final bit, then its open and ready, to save to time going to and fro. @lsiepel

@lsiepel

I've had a first pass at the upgrade instructions file's. I will have to test them out over the next couple of days. (If its doing what I think that's really nice - I always hated having to say sorry just remote it and re-add then it should appear). In regards to these update scripts my "interpretation" which please correct if I'm wrong, is that the systems caching at a thing id level. So its applying these to its cache used for all defined devices, on boot up, to apply the updates so the channels / updates appear.

What I'm not sure about was the options bit. I've redefined it as I suspect it overwrites whatever it has based on what's defined, so the update to add the pet mode will add it once it runs?

Finally, a few channels types are re-used between two things. As my guess / interpretation is that the system duplicates the data for each thing the instructions are for, so if a typeId is re-used, this should be updated in every thing update definition, as its keyed to those thing's in the cache. Is this correct do you know?

I'll test anyway - but if you know the answers to above that would be great just to find out if its working how I suspect, in order to ensure those instructions have precisely what is required.

I think its ready for another pass now 🤞, so will change the PR status.

Hopefully you had a good weekend, and thanks for all the help in getting these PR's through, hopefully before the next release :)

@dag81 dag81 requested a review from lsiepel November 25, 2024 00:16
[veSync] Air purifier update modifications

Signed-off-by: dag81 <[email protected]>
[veSync] Air humidifier update modifications

Signed-off-by: dag81 <[email protected]>
@dag81
Copy link
Contributor Author

dag81 commented Nov 27, 2024

@lsiepel this one is ready again when you are ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[vesync] Levoit Vital 100s Air Purifier support
4 participants