feat: Add PSUControl eWeLink plugin#1408
feat: Add PSUControl eWeLink plugin#1408chrismin13 wants to merge 7 commits intoOctoPrint:gh-pagesfrom
Conversation
|
Hello @chrismin13, I briefly reviewed your repository, these are my suggestions from a security standpoint:
I also have some doubts about encrypting and masking passwords in OctoPrint plugins: it seems like security theater to me. Thank you again for your contribution 😄 |
|
Hello @jacopotediosi, thank you for taking the time to go through my PR, I really appreciate the feedback! I've implemented both As for the password masking, I agree about your point in regards to it being security theater. Perhaps my original way of phrasing it and explaining the implementation was not great. I understand that, at the end of the day, any data stored on the server will be accessible by an attacker, and there's nothing that can be done for that. I only wanted to make it so that my password was not visible in plain text when going through the config, as it would otherwise be a normal username and password getting stored, and not some kind of API token or other UUID. So, yes, this is not more secure, but if some config file ever ends up in some kind of log, or if a user copy pastes a config somewhere else, it won't be an instant security issue. EDIT: So, I forgot to clarify, I've updated all of the documentation to make it clear that this is only obfuscation, not encryption, and I've removed any mention of this from the plugin page, as I don't think it should be advertised as a feature. If you disagree with this, I would be happy to either remove this entirely, and have the password displayed in plaintext in the OctoPrint config file, or implement AES or Fernet as you suggested. Thanks again for your time! Let me know if you have any other questions or concerns. |
|
@chrismin13 thanks for your patience. I've reviewed the plugin code in your repository and the files in this PR again and, apart from my two comments above, now they look good to me. About the obfuscation thing, now that the documentation is clear that it only serves to prevent casual exposure of credentials, it's ok for me. Please note that I'm just a user here, I won't be the one merging your PR, so you'll still need to wait for a review from someone with the privileges to do so. |
|
@jacopotediosi ah ok, thanks for clarifying! Still, your comments have been very helpful, so thanks for taking the time to look at the PR. I've addressed your latest comments as well. I'll wait for review from someone else from the team. |
Based on this statement, I believe we can allow the plugin to be registered. I will review the code and if anything feels off or contrary to this statement I'll let you know. From what I've seen historically from vibe coded plugins is implementations that don't quite take into account the OctoPrint plugin ecosystem well, typically related to knockout binding type issues. |
|
one thing right out the gate I see is the old method of using setup.py instead of pyproject.toml approach which is incorporated into the latest plugin template cookiecutter. |
_plugins/psucontrol_ewelink.md
Outdated
| - posix | ||
| - windows | ||
|
|
||
| python: ">=3.7,<4" |
There was a problem hiding this comment.
same issue in your plugin...so as you can see what I meant, vibe coding is not great.
|
Outside of the above python version issue, I don't see anything that stands out, but will typically ask @kantlivelong to review since this is a PSU Control sub-plugin. |
|
Hello @jneilliii, thanks for taking a look at the plugin! I've corrected the Python version that you mentioned, and I've also bumped the OctoPrint version to something newer, let me know if you disagree with that. I can't personally test it on all OctoPrint versions, but I see that there were some changes related to As for the cookie cutter template - indeed, I never started from the cookie cutter template, as originally I thought I would just quickly make the plugin from an empty folder for personal use, but eventually I saw that it was actually becoming a bigger project, so that's why I ended up publishing it. Since you mentioned the template, I took a look at it, and tried to implement anything useful I could find from it. So, I added the GitHub issue templates, moved from Happy to adjust things as you see fit, and of course to implement any feedback that you or @kantlivelong might have. |
|
I checked the recent commits in the plugin repository again. The plugin still works, but, sigh, I noticed something - and that's exactly why the policy would reject vibe-coded plugins.
The This is exactly what's scary about genAI: for a moment you lose control, you don't really know what's happening, and you end up relying solely on the AI. The good thing is that this plugin is useful and probably wouldn't have been created without AI, so it's still a win for me. |
|
I'm glad to see you're going through the commits. Since you're looking at the commit history, it's important to notice the timeline. I'm not committing any changes without manually reviewing the code first and not testing it as well. I am aware of any changes being made, and I try to understand the changes that happen. The As for the Let me know if my understanding of this is wrong. |
|
When it comes to available plugin mixins and hooks and such, I would strongly advise to refer to the available documentation rather than blindly trusting a stochastic parrot.
Valid points, you are however going against best practices of Python development that way.
tl;dr: What you do there with |
|
Hi @foosel, thanks for the info! I've updated the code accordingly. I'll refer to the documentation going forwards. |

What is the name of your plugin?
PSUControl eWeLink
What does your plugin do?
It adds an interface to connect IoT devices that use the eWeLink app (such as Sonoff Smart Plugs) using the existing PSU Control plugin.
Where can we find the source code of your plugin?
https://github.com/chrismin13/OctoPrint-PSUControl-eWeLink
Was any kind of genAI (ChatGPT, Copilot etc) involved in creating this plugin?
Yes, a lot. I have read the guide, and I understand that "vibe coded" plugins are not acceptable. So, I understand if this will not be accepted under that premise, but I wanted to make an attempt anyway, and hope you don't mind me doing so.
However, I would like to mention that I do feel confident in my ability to maintain the plugin in case it breaks or if I need to add a small new feature. I have manually gone through everything, made sure it is safe, fully understand how the code works, and I'm confident in what I am submitting.
If you still think this does not fit your submission criteria due to the use of AI, feel free to reject this pull request.
Is your plugin commercial in nature?
No
Does your plugin rely on some cloud services?
Yes, the eWeLink cloud, which is used for the smart switches. The Privacy Policy on the GitHub repo links to their Privacy Policy for more info.
Further notes
The plugin has been tested with a Sonoff Basic R2 and on an up-to-date OctoPi installation. It would be nice to get some more testers if anyone else has any eWeLink devices hooked up to their printers :D
Thank you for your consideration! Let me know if there's anything you would like to see improved.