Close

To be or ecobee....

A project log for Ventbot: warm side cool, cool side warm

A DIY register booster project to even out the temps around my home.

wjcarpenterWJCarpenter 06/22/2023 at 16:140 Comments

I had this idea a while back and just implemented it. My smart thermostat now controls my Ventbots. When I finally got down to implementing it, I found it quite an enjoyable experience. Every time I learn a new aspect of Home Assistant, I am impressed by how thoughtfully organized things are. In my day job as a software developer, I work with a zillion different technologies and components every day, and most of them come with at least a few little quirks that leave you either shaking your head or at least wishing it were different.

Our home's heat pump has an ecobee smart thermostat. It was chosen by the contractor as part of the heat pump package, but I don't have any complaints. There is already an ecobee integration for Home Assistant, so I had that going with just a few clicks soon after the ecobee arrived. The integration is cloud-based. I wish it were purely local, but I don't wish that so strongly that I'll avoid using it. The integration makes available the same sort of information you can see in the ecobee mobile app: comfort zone range, current temperature, operating modes, and what equipment is currently running. That last part is interesting here because it reports whether the heating or cooling is active. I showed that in some earlier project logs, but here is a refresher:

The orange-ish areas indicate heating. When cooling is on, it's shown in blue.

My idea was simple. Instead of relying on the associated temperature sensor to tell individual Ventbots when to turn on or off, I would use the ecobee's heating or cooling cycles to turn all of the Ventbots on or off. The design goal of the Ventbot is that it can operate completely standalone (other than firmware uploads) with no communication with each other or anything else. I did it that way because not everybody has home automation. But, hey, I do!

I wasn't sure how complicated this was going to be since it uses areas of Home Assistant that I hadn't explored yet. The heating and cooling cycle information, which shows up automatically in the ecobee's history graph in Home Assistant, comes as what Home Assistant calls an entity attribute. I hadn't worked directly with attributes before; at a glance the documentation made it look inconvenient. While I was noodling around with this, I decided to also do parts of it as a Home Assistant script. I've done lots of things with Home Assistant automations, blueprints, and templates. The scripting is consistent with those. Even though I wasn't familiar with it, it didn't seem too much of a stretch.

On the Ventbot side, which is implemented in the ESPHome framework, I had already implemented some services callable from Home Assistant. I did that for convenience of calibration, debugging, and troubleshooting, but with a little twinkle of doing something like this. There are services on the Ventbot for turning the fans on or off. In both cases, it goes through the ramp-up/ramp-down table. The calls also include a parameter for some number of seconds to hold, where "hold" means ignore the associated temperature sensor for that period. Those services have been in the firmware for quite a while and are tried and true.

Here's the service of interest from ventbot.yaml.inc. Not shown in this snippet are the actions taken when this service is called.

api:
  # These services can be called from Home Assistant for manual testing and temporary overrides.
  services:
    # Force pretending that the temperature is either in (true) or out (false) of the neutral zone.
    # Temperature sensor readings will be ignored until the duration expires or the hold is
    # canceled.
    - service: set_inout_neutral_zone_and_hold
      variables: {in_neutral_zone: bool, duration_seconds: int}
      then:
      # ....

In my Home Assistant server, I watch for an attribute state change from the ecobee. When the state changes to heating or cooling, regardless of the previous state, turn the Ventbots on. Then, wait for another state change that goes to one of the other states (off, idle, or fan).

Here is the resulting automation configuration (the device name for my ecobee is "CarpOBee"):

alias: HVAC heating or cooling
description: Trigger all ventbots on when heating or cooling is on
trigger:
  - platform: state
    entity_id:
      - climate.carpobee
    attribute: hvac_action
    to:
      - heating
      - cooling
    for:
      hours: 0
      minutes: 0
      seconds: 0
condition: []
action:
  - service: script.ventbots_activate
    data: {}
  - wait_for_trigger:
      - platform: state
        entity_id:
          - climate.carpobee
        attribute: hvac_action
        to:
          - "off"
          - idle
          - fan
  - service: script.ventbots_deactivate
    data: {}
mode: single

The actions to perform are encapsulated in two Home Assistant scripts, ventbots_activate and ventbots_deactivate. Here's the ventbots_activate script; the ventbots_deactivate script is similar with the boolean set to true instead of false.

alias: Ventbots activate!
sequence:
  - service: esphome.ventbot_red_set_inout_neutral_zone_and_hold
    data:
      in_neutral_zone: false
      duration_seconds: 500000
  - service: esphome.ventbot_orange_set_inout_neutral_zone_and_hold
    data:
      in_neutral_zone: false
      duration_seconds: 500000
  - service: esphome.ventbot_yellow_set_inout_neutral_zone_and_hold
    data:
      in_neutral_zone: false
      duration_seconds: 500000
  - service: esphome.ventbot_green_set_inout_neutral_zone_and_hold
    data:
      in_neutral_zone: false
      duration_seconds: 500000
  - service: esphome.ventbot_blue_set_inout_neutral_zone_and_hold
    data:
      in_neutral_zone: false
      duration_seconds: 500000
mode: restart
icon: mdi:fan

For each of my five Ventbots, the ESPHome service is called and instructs the Ventbot to ignore the temperature sensor for half a million seconds (a little under 6 days), which is effectively forever. Recall the the Ventbot "neutral zone" is the range where the Ventbot should not be on. There is a very minor wrinkle that I didn't think worth smoothing: when the Ventbot reboots, it will not be holding. That is, it will be watching its associated temperature sensor. But the first time the ecobee sends heating or cooling, the above arrangement will kick in. Likewise, if there is no heating or cooling for 6 days, the hold will expire.

All in all, this was pretty simple and easy to arrange.

Discussions