-
-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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 Water Heater platform to MQTT integration #93644
Conversation
It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
Hey there @emontnemery, @jbouwh, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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.
Hi, thanks for your contribution, that is very appreciated. Do you have a specific device in mind that needs MQTT support. The problem with the current climate/HAVC component is that it has a lot of topics and templates, which makes tot all very complex.
I hope we can avoid that for new integration. Further we should try to keep a PR for a new platform minimal.
So I suggest we only introduce a command_topic
and state_topic
and add a command plus value template for them. Further it would be a good idea to allow parsing messages on state_topic
as json. For the command topic we can use the attributes as template variables. An inplementation like this the the siren
platform. May be you can have a look at that?
May be that will not work. I suggest we start with operational mode and set temperature services. They should have their own topics, but we should avoid code duplication. There is some code that can be cleaned up from climate first (deprecated stuff). I'll see if that can be removed now. Reused constants of climate need to move to be moved const.py
.
Last question is:
Are there any water heaters known that support MQTT yet?
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
@jbouwh I wrote it with "batteries included" but agree it's definitely over-complicated, I think the minimum you could get it down to would be something like the TemperatureControl trait, which exposes:
To remove some of the clutter I'll take out the temp high/low and away mode, as I don't think either are needed. Let me know if you have any other recommendations, thank you! To answer your last question I can see a few people expressing interest a couple years ago, as well as a Tasmota OpenTherm module. I'll have a look through that now. |
Thanx that helps. |
May be we can somehow integrate the two classes in one. If we keep the the platform setup we could easily implement an common class that implements the shared methods. We should only take out the not shared elements. |
I like the sound of that, like |
Yeah,
That is the idea. So we can combine all common functionality into MqttTemperatureEntity |
c7234fe
to
959275e
Compare
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.
Two small comments on doc strings.
959275e
to
3d76788
Compare
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,
Thnx @hookedonunix !
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! 👍
Cheers! 🎉 |
Proposed change
An addition to the existing MQTT component that allows support for the water heater entity. The code lends heavily from the MQTT climate integration, as the functionality is mostly a simplified version of it.
I'm building this to communicate with a desktop vaporizer I own, which I've been able to test it successfully with. It's built to the spec of the base water heater component but I don't own an actual smart water heater to test it with, so some functionality I've just tested with mocks.
This PR is paired with this one, which will allow for the temperature of water heater entities to be controllable through the google assistant component.
Type of change
Additional information
I've never contributed to the climate entity (or hass) before, so all my knowledge is assumptions based on the code. With that in mind, I have a couple questions that have come up as I've been working on it:
ATTR_TEMP_HIGH
andATTR_TEMP_LOW
attributes are in both the climate and water heater entities, which seem to control the target temperature range, if applicable. They seem to be implemented in the climate entity, but I can't see any way of setting them in the water heater entity, are these actually used or were they never implemented for the water heater? A test I saw for the water heater only accepted a single temperature instead of a range.Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: