technicalpickles / picklehome

Configuration & Planning for my Home Automation systems
14 stars 0 forks source link

Smarter comfort zones during Weather #40

Open technicalpickles opened 6 years ago

technicalpickles commented 6 years ago

I think this is A Thing in the South, but when it's 🔥 HOT 🔥 out, 70 is the ideal cooling. When it's Okay out, 72 is better cooling, with 68 as the heating threshold. When it's ❄️ COLD ❄️ out, we want it heated to 70, with cooling of probably 72 (or it doesn't matter since it wont' come on).

I'm tired of tweaking the thermostat, so let's be smart. I have an ecobee with multiple sensors, and home-assistant.

Ecobee has a concept of Comfort Zones. Right now, I set one that's 68/72, but end up putting it on hold for the measures. Maybe I can create multiple ones, and change the schedule to always use that? That assumes some hass stuff exists to do that 🤔

technicalpickles commented 6 years ago

I tried making some more comfort settings, "HOT OUTSIDE" and "COLD OUTSIDE". It seemed like yous hould be able to use climate.set_hold_mode to use a different comfort zone, but that is logging an error:

2018-01-10 02:11:02 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=climate, service=set_hold_mode, service_data=entity_id=climate.home, hold_mode=HOT OUT
SIDE, service_call_id=140444949846336-19>
2018-01-10 02:11:03 INFO (SyncWorker_5) [pyecobee] Error connecting to Ecobee while attempting to set climate hold.  Refreshing tokens and trying again.
2018-01-10 02:11:03 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 182, in _step
    result = coro.throw(exc)
  File "/usr/src/app/homeassistant/core.py", line 1031, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/usr/src/app/homeassistant/components/climate/__init__.py", line 282, in async_hold_mode_set_service
    yield from climate.async_set_hold_mode(hold_mode)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/climate/ecobee.py", line 327, in set_hold_mode
    self.thermostat_index, hold_mode, self.hold_preference())
  File "/usr/local/lib/python3.6/site-packages/pyecobee/__init__.py", line 252, in set_climate_hold
    return self.make_request(body, log_msg_action)
  File "/usr/local/lib/python3.6/site-packages/pyecobee/__init__.py", line 203, in make_request
    return self.make_request(body)
TypeError: make_request() missing 1 required positional argument: 'log_msg_action'

It might not be that terrible to just have some hard-coded temperature to set a hold for.

I was thinking it'd be useful to have a sensor.template for deciding which 'comfort setting' to use, and then setting the temperature appropriately.

technicalpickles commented 6 years ago

Searching for that error, I found https://community.home-assistant.io/t/ecobee-modes-possible-to-change-to-sleep/10399/10

Basically, the you specify a hold_mode of smartX, where X is the number of the comfort setting:

technicalpickles commented 6 years ago

Been thinking about thresholds for this.

technicalpickles commented 6 years ago

One thing I ran into that would be helpful: having a way to disable the southern comfort settings, like if I want to open all the windows. That should be a condition to check against, and turning off the toggle should take the current temperature into account.

technicalpickles commented 6 years ago

I was lurking in the home-assistant discord, and saw some conversation around using door/window sensor for detecting that condition.

As it happens, I have a couple of door sensors that were never set up, so those would be useful.

https://github.com/CCOSTAN/Home-AssistantConfig/blob/1b73831226d852152c8977f1bdbedb3f6813c0cd/packages/alarm.yaml#L230-L256 has an example for managing the AC when those sensors are triggered.