Skip to content
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

If some people use outdoor_sensor - why not wait for it to provide data? #177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions custom_components/smart_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,10 +923,17 @@ def _async_update_ext_temp(self, state):
async def _async_control_heating(self, time_func=None, calc_pid=False):
"""Run PID controller, optional autotune for faster integration"""
async with self._temp_lock:
if not self._active and None not in (self._current_temp, self._target_temp):
self._active = True
_LOGGER.info("%s: Obtained temperature %s with set point %s. Activating Smart"
"Thermostat.", self.entity_id, self._current_temp, self._target_temp)
if not self._active:
if self._ext_sensor_entity_id is None:
if None not in (self._current_temp, self._target_temp):
self._active = True
_LOGGER.info("%s: Obtained temperature %s with set point %s. Activating Smart"
"Thermostat.", self.entity_id, self._current_temp, self._target_temp)
else:
if None not in (self._current_temp, self._ext_temp, self._target_temp):
self._active = True
_LOGGER.info("%s: Obtained temperature %s, outdoor %s with set point %s. Activating Smart"
"Thermostat.", self.entity_id, self._current_temp, self._ext_temp, self._target_temp)

if not self._active or self._hvac_mode == HVACMode.OFF:
if self._force_off_state and self._hvac_mode == HVACMode.OFF and \
Expand Down
Loading