-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Add H-Bridge switch component #7421
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #7421 +/- ##
==========================================
+ Coverage 53.70% 53.80% +0.09%
==========================================
Files 50 50
Lines 9408 9812 +404
Branches 1654 1353 -301
==========================================
+ Hits 5053 5279 +226
- Misses 4056 4207 +151
- Partials 299 326 +27 ☔ View full report in Codecov by Sentry. |
There is some debate about whether "H-Bridge" is the right name for this. It certainly matches OpenBeken, and the feature requests such as esphome/feature-requests#1690 and #4087 so it looks like it would be well-named for users to actually find it? Not sure it's strictly technically accurate though, and maybe it would be better as |
Adding a delay time for on and off signal would be great. About the name well If i search anything related with the reverse of polarity I look for h-bridge keyword. Bistable solenoid is only a usecase but there could be more (open and close motorized valves for istance) |
Can you help me understand what you need that Docs at |
Sure they are perfect. For some reason I didn't see those values before!! |
The function I hope for is: |
Do we need to build that into the H-Bridge switch component? Wouldn't that be a useful thing for any switch, using a separate zero-detection? I'm imagining a generic |
That is to say, the H-bridge component has two options:
|
Because magnetic holding relays are energy-saving and do not generate heat, they are now quite popular, and this H-bridge switch component is perfect for showcasing its capabilities. |
Sure, but the zero-crossing thing is surely orthogonal to that? What if we build a generic implementation of that?
I'd knock up an implementation of that to play with, but contributing to ESPHome isn't sufficiently feeding my dopamine addition because things are taking so long to get merged :) |
It looks pretty good and I can't wait to try it out. I wonder if this series control method can accurately and quickly respond,Because the zero crossing point of alternating current changes too quickly |
ISTR I had deliberately made the tests different, to exercise different combinations of options. Will take a look... |
You can still accomplish that -- use extend and/or remove if necessary. |
Attempted the common template in 49c8ab5 |
@kbx81 I had to do the |
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
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 again! 🍻
Yes, as I said above you probably want hardware assistance. But even with hardware assistance for the trigger I'm not sure a latching H-Bridge switch will work well for that use case. These things typically have a pulse length of 100ms — meaning that a 50Hz signal will have completed five full cycles (crossing zero ten times) in the time it takes to know that the switch has completed its movement. |
What does this implement/fix?
Add an H-Bridge switch component for driving the relay in devices like https://devices.esphome.io/devices/Tongou-TO-Q-SY1-JWT
Types of changes
Related issue or feature (if applicable): fixes #4087
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#4233
Test Environment
Example entry for
config.yaml
:Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: