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 option to heat_control component to set min cycle duration #2726

Merged
merged 1 commit into from Aug 9, 2016

Conversation

Projects
None yet
3 participants
@mtreinish
Contributor

mtreinish commented Aug 4, 2016

Description:
This commit adds a new config option min_cycle_duration which when specified will add a minimum duration that the thermostat must keep the switch in each state prior to switching it either off or on. The motivation is primarily for AC mode, because window and in-wall AC units are not nearly as efficient during the first few minutes of operation. This gives users a tunable to fine tune exactly how frequently heat control can power cycle their devices.

Related issue (if applicable): fixes #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#733

Example entry for configuration.yaml (if applicable):

thermostat:
  platform: heat_control
  name: Study
  heater: switch.study_heater
  target_sensor: sensor.study_temperature
  min_temp: 15
  max_temp: 21
  target_temp: 15
  min_cycle_duration:
     days: 2
     hours: 1
     minutes: 10
     seconds: 5
     milliseconds: 20

Checklist:

If user exposed functionality or configuration variables are added/changed:

If code communicates with devices, web services, or a:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

This commit adds a new config option to the heat_control thermostat
component, min_cycle_duration. Some heaters and/or ACs don't like
being constantly cycled on and off. Prior to this patch the
heat_control component can end up cycling the switch quite
frequently. (depending on how quickly the temperature changes) The
new option added is used for setting a minimum duration that must
have elapsed in either the on or off state before the thermostat will
send the service call to cycle the switch. This should enable users to
hand tune how frequently heat_control can switch the device on or off
to best suit the device being used.

mtreinish added a commit to mtreinish/home-assistant.io that referenced this pull request Aug 4, 2016

Add min_cycle_duration to heat_control documentation
This commit adds documentation for the heat_control min_cycle_duration
option added in home-assistant/home-assistant#2726
current_state = STATE_ON
else:
current_state = STATE_OFF
long_enough = condition.state(self.hass, self.heater_entity_id,

This comment has been minimized.

@balloob

balloob Aug 4, 2016

Member

Shouldn't we be able to just return when not long_enough ?

@balloob

balloob Aug 4, 2016

Member

Shouldn't we be able to just return when not long_enough ?

This comment has been minimized.

@mtreinish

mtreinish Aug 4, 2016

Contributor

Yep, that should work. I'll respin this right now

@mtreinish

mtreinish Aug 4, 2016

Contributor

Yep, that should work. I'll respin this right now

@balloob

This comment has been minimized.

Show comment
Hide comment
@balloob

balloob Aug 4, 2016

Member

Looks good. One minor comment but then it's ready to go.

Member

balloob commented Aug 4, 2016

Looks good. One minor comment but then it's ready to go.

Add option to heat_control component to set min cycle duration
This commit adds a new config option to the heat_control thermostat
component, min_cycle_duration. Some heaters and/or ACs don't like
being constantly cycled on and off. Prior to this patch the
heat_control component can end up cycling the switch quite
frequently. (depending on how quickly the temperature changes) The
new option added is used for setting a minimum duration that must
have elapsed in either the on or off state before the thermostat will
send the service call to cycle the switch. This should enable users to
hand tune how frequently heat_control can switch the device on or off
to best suit the device being used.
@mtreinish

This comment has been minimized.

Show comment
Hide comment
@mtreinish

mtreinish Aug 4, 2016

Contributor

The latest revision just updated the logic to return if not long_enough instead of adding it to all the checks later.

Contributor

mtreinish commented Aug 4, 2016

The latest revision just updated the logic to return if not long_enough instead of adding it to all the checks later.

@d-rez

This comment has been minimized.

Show comment
Hide comment
@d-rez

d-rez Aug 7, 2016

This would be a very welcome pull for heaters as well, had mine toggling on and off in a loop every few minutes yesterday.

d-rez commented Aug 7, 2016

This would be a very welcome pull for heaters as well, had mine toggling on and off in a loop every few minutes yesterday.

@balloob balloob merged commit 496972a into home-assistant:dev Aug 9, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.006%) to 93.563%
Details

balloob added a commit to home-assistant/home-assistant.io that referenced this pull request Aug 13, 2016

Add min_cycle_duration to heat_control documentation (#733)
This commit adds documentation for the heat_control min_cycle_duration
option added in home-assistant/home-assistant#2726

@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017

@mtreinish mtreinish deleted the mtreinish:add-min-cycle-duration branch Jul 9, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.