-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 OpenTherm component (part 3: rest of the sensors) #7676
Conversation
Hey there @olegtarasov, CODEOWNERS = ["@olegtarasov"] And run (message by NeedsCodeownersLabel) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #7676 +/- ##
==========================================
+ Coverage 53.70% 53.77% +0.06%
==========================================
Files 50 50
Lines 9408 9804 +396
Branches 1654 1354 -300
==========================================
+ Hits 5053 5272 +219
- Misses 4056 4206 +150
- Partials 299 326 +27 ☔ View full report in Codecov by Sentry. |
Hi @jesserockz! The final part of OpenTherm integration is ready for review. Thanks! |
Modify sensor: fan_speed - This now reads ID35:lb Both return a value as revs per second. Multiply by 60 to get RPM
Opentherm fan
This is only used by ID35{lb,hb} and saves having to use a multiply filter in the sensor.yaml
it should be mdi:fan.
Opentherm fan
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.
How does the hub know if a switch (or other control type entity) has been changed by the user? I do not see the add_on_state_callback
s being added.
I find it very difficult to follow and understand this component due to the heavy use of macros.
This allows users to return data in a different format. e.g.: fan_speed: name: "Boiler fan speed" message_data: "u16" # overrides the default u8_lb_60 message.
@jesserockz The hub doesn't need to know the exact moment when control entity changes because all sensors, switches and outputs are sent to OpenTherm device constantly in a loop. It's required by OpenTherm standard to communicate with device every 1 second even when there is no change in controls. So the approach when we send all the messages configured in yaml in a loop adds to component's robustness (a message can fail due to protocol error, and we don't need to use complicated retry logic — the same message will be sent again eventually).
I agree, but I see no other way to add class members dynamically, and adding > 100 class members for all the available sensors at once seems very wasteful. What's more, most of them likely won't be supported by end user's boiler. |
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
What does this implement/fix?
This is the third (and final) part of OpenTherm component. It contains the code to support all the sensors, inputs and outputs. Sensors configured in YAML are transformed to a set of C++ macros, which in turn generate the final code that handles sensors.
Types of changes
Related issue or feature (if applicable):
Pull request in esphome-docs with documentation (if applicable):
Test Environment
Example entry for
config.yaml
:Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: