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] Add support for wifi outlets #17844

Merged
merged 8 commits into from
Dec 19, 2024

Conversation

marcelGoerentz
Copy link
Contributor

[VeSync] Add outlets to the supported devices

This enhancement will let you get information about your smart plug (outlet) and give the oppurtunity to control it.

Description

This is improvement will let you control your outlets that are uplinked to you VeSync account.
As I have smart plug which delivers information about the used energy and the current energy and is also contolable via the VeSync App, I wanted to observe and control it via openHAB. Therefore I decided to develop this improvement.
There are no changes done to the old functionality of this binding, there will only be features added.
To add a plug to your running system it will follow the same flow as it was for the humidifier and purifier.
So all you have to do is waiting for an automatic scan or trigger it by yourself.

Testing

Unfortunately I only have one smart plug (GreenSun Wifi Smart plug) that I could test with and this is working with firmware version 1.0.02.
So it would be great if someone else could test this binding with his/hers outlets to confirm its working properly.

You will find the jar file here: https://github.com/marcelGoerentz/openhab-addons/releases/tag/v0.0.2

Discussion

You can Discuss with me about this binding here: https://community.openhab.org/t/vesync-smart-plug/148039

@marcelGoerentz
Copy link
Contributor Author

This is follow up PR to the broken one here: #15343

@marcelGoerentz
Copy link
Contributor Author

@lsiepel @dag81 Please review my PR.

@marcelGoerentz marcelGoerentz changed the title [VeSync]Add support for wifi outlets [VeSync] Add support for wifi outlets Dec 4, 2024
Copy link
Contributor

@dag81 dag81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcelGoerentz : Looks really nice and clean :) Just building this one locally to cross check no unusual bits with that new subDevice field although I doubt it. I've added a few trivial points in, other that that it looks really nice overall - Thank you!!! :)

@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label Dec 4, 2024
@dag81
Copy link
Contributor

dag81 commented Dec 4, 2024

Looks good comm's wise with the new field :) So from my side, just the minor bits commented above. No SAT errors or compiler warnings noticed 👍 Pretty much there with the minor tweaks, to use %units% on the patterns, I think from my side. Just looking at that time calculation to see if it need's possibly mapping or is just local time 0200 based.

@marcelGoerentz
Copy link
Contributor Author

@dag81 thank you for feedback.

It is almost a year ago that I’ve written this code so I need to check why I used the offset for the time. The point with the unit hints will be fixed tomorrow.

Again, thanks a lot for your effort.

@dag81
Copy link
Contributor

dag81 commented Dec 4, 2024

@dag81 thank you for feedback.

It is almost a year ago that I’ve written this code so I need to check why I used the offset for the time. The point with the unit hints will be fixed tomorrow.

Again, thanks a lot for your effort.

No prob's thanks for expanding it with new devices! :) . I was just looking through the repo trying to figure out the time-zone bits, and saw they now have payload's in there for some of the devices, although its still not clear yet to me. Some of that is app sim placebo data def, just for the servers to accept the requests.

@marcelGoerentz
Copy link
Contributor Author

marcelGoerentz commented Dec 4, 2024

If I remember correctly, I found the value via try and error. Because I was getting an offset of the actual time when retrieving the values. I’m -0100 from UTC so this is maybe something else. Maybe the location of their servers? Unfortunately I didn’t get any feedback from other users.

@marcelGoerentz marcelGoerentz requested a review from dag81 December 5, 2024 07:45
Copy link
Contributor

@dag81 dag81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for quickly updating :) this LGTM @marcelGoerentz.

@dag81
Copy link
Contributor

dag81 commented Dec 5, 2024

@lsiepel from myside this LGTM. I guess it need's someone from the maintainers now to spin through quickly, so it can be merged.

Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contineuing on this PR. I left some comments to consider. Otherwise LGTM

marcelGoerentz and others added 7 commits December 9, 2024 11:01
Signed-off-by: Marcel Goerentz <m.goerentz@t-online.de>
Signed-off-by: Marcel Goerentz <m.goerentz@t-online.de>
Signed-off-by: Marcel Goerentz <m.goerentz@t-online.de>
…inding/vesync/internal/handlers/VeSyncDeviceOutletHandler.java

Co-authored-by: lsiepel <leosiepel@gmail.com>
Signed-off-by: Marcel Goerentz <57457529+marcelGoerentz@users.noreply.github.com>
Signed-off-by: Marcel Goerentz <m.goerentz@t-online.de>
…inding/vesync/internal/handlers/VeSyncDeviceOutletHandler.java

Co-authored-by: lsiepel <leosiepel@gmail.com>
Signed-off-by: Marcel Goerentz <57457529+marcelGoerentz@users.noreply.github.com>
Signed-off-by: Marcel Goerentz <m.goerentz@t-online.de>
…inding/vesync/internal/handlers/VeSyncDeviceOutletHandler.java

Co-authored-by: lsiepel <leosiepel@gmail.com>
Signed-off-by: Marcel Goerentz <57457529+marcelGoerentz@users.noreply.github.com>
Signed-off-by: Marcel Goerentz <m.goerentz@t-online.de>
Signed-off-by: Goerentz <E0636650@eaton.ad.etn.com>
Signed-off-by: Marcel Goerentz <m.goerentz@t-online.de>
Signed-off-by: Marcel Goerentz <m.goerentz@t-online.de>
@lsiepel lsiepel merged commit 65664f2 into openhab:main Dec 19, 2024
5 checks passed
@lsiepel lsiepel added this to the 5.0 milestone Dec 19, 2024
cipianpascu pushed a commit to cipianpascu/openhab-addons that referenced this pull request Jan 2, 2025
* Add support for wifi outlets

Signed-off-by: Marcel Goerentz <m.goerentz@t-online.de>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
DrRSatzteil pushed a commit to DrRSatzteil/openhab-addons that referenced this pull request Jan 3, 2025
* Add support for wifi outlets

Signed-off-by: Marcel Goerentz <m.goerentz@t-online.de>
chilobo pushed a commit to chilobo/openhab-addons that referenced this pull request Feb 10, 2025
* Add support for wifi outlets

Signed-off-by: Marcel Goerentz <m.goerentz@t-online.de>
Signed-off-by: Christian Koch <78686276+chilobo@users.noreply.github.com>
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.

3 participants