Skip to content

Conversation

aronsky
Copy link
Contributor

@aronsky aronsky commented Feb 16, 2017

Add explanation for the new keep_alive field of generic_thermostat.

Description:

My A/C unit depends on a thermostat residing inside the remote control to get updates on the current room temperature, as well as decide when to switch from heating/cooling to idle, and vice versa. I tried using generic_thermostat in order to control it, which worked fine. However, I noticed that the A/C unit stops working after a while, even if the desired temperature hasn't been reached (and no stop signals have been sent by Home Assistant). My assumption is that it has some sort of failsafe, turning off after a certain amount of time without temperature updates from the remote.

In order to try and resolve this issue, I came up with the keep-alive feature for generic_thermostat. This simple feature basically resends the turn on/turn off signal to the A/C unit to reiterate its state and prevent the unit shutting off prematurely.

Pull request in home-assistant (if applicable): home-assistant/core#6040

Add explanation for the new `keep_alive` field of `generic_thermostat`.
@mention-bot
Copy link

@aronsky, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fabaff, @mnoorenberghe and @r-jordan to be potential reviewers.

@r-jordan
Copy link
Contributor

hi @aronsky !
I think we should keep these implementation details away from the generic_thermostat. An automation can be made to send updates while the device controlled by the thermostat is on. Have you considered doing the keepalive with automations?

@aronsky
Copy link
Contributor Author

aronsky commented Feb 16, 2017

Hi @r-jordan, that was my initial approach. However, I do believe that implementing this behavior inside a climate device is the better approach from a UX perspective. As a user, I'd rather configure one element (the thermostat), and expect it to provide all the capabilities needed to do its job. Automations, I believe, should be used for making things smarter and getting unrelated components to work together, in order to achieve new goals.

Had the climate component not been available, you could achieve what the generic thermostat does by means of a complex automation. But if an automation is identified as widespread (as is the case with the generic thermostat), it makes more sense to wrap it up in a configurable component.

I did consider making a thermostat model for controlling the A/C that I have, but I think this change is small enough not to warrant a different model, not to mention that it may be useful for additional A/C units, as well.

@aronsky
Copy link
Contributor Author

aronsky commented Mar 5, 2017

Since the code PR has been accepted and merged, can we update the documentation as well?

@@ -35,8 +35,9 @@ Configuration variables:
- **ac_mode** (*Optional*): Set the switch specified in the *heater* option to be treated as a cooling device instead of a heating device.
- **min_cycle_duration** (*Optional*): Set a minimum amount of time that the switch specified in the *heater* option must be in it's current state prior to being switched either off or on.
- **tolerance** (*Optional*): Set a minimum amount of difference between the temperature read by the sensor specified in the *target_sensor* option and the target temperature that must change prior to being switched either off or on. For example, if the target temperature is 25 and the tolerance is 0.5 the heater will start when the sensor goes below 24.5 and it will stop when the sensor goes above 25.5.
- **keep_alive** (*Optional*): Set a keep-alive interval. If set, the switch specified in the *heater* option will be triggered every time the interval elapses. Use with heaters and A/C units that shut off if they don't receive a signal from their remote for a while.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: There are two spaces in "be triggered"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops.
I didn't notice this comment until after the pull request has been merged. I guess making a new pull request just for this is a bit over the top. But I'm planning on making more changes to the Generic Thermostat in the future - specifically, adding support for switching between cooling and heating in the UI, thus obsoleting the ac_mode property. I'll remove the extra space as part of the changes in the documentation required then.

Meanwhile, I assume that in the browser, it'll render with a single space anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

@aronsky Fixed with 3f4f298 :)

@Landrash Landrash added the new-feature This PR adds documentation for a new Home Assistant feature to an existing integration label Mar 8, 2017
Copy link
Contributor

@Landrash Landrash left a comment

Choose a reason for hiding this comment

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

Looks good and can be merged as soon as parent pr is merged.

@Landrash
Copy link
Contributor

Landrash commented Mar 8, 2017

Thank you 🍪

@Landrash Landrash merged commit b5b7de9 into home-assistant:next Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature This PR adds documentation for a new Home Assistant feature to an existing integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants