Questions on Blueprint

I’m having trouble wrapping my head around the structure of how HA does automations. I’ve wrote the simplest blueprint that I need for my house and have a few questions about it. It will cycle the HVAC fan ON and OFF to circulate the air in the house if the heat/a/c has not been running, but only turn OFF the fan if the automation turned it ON. I do this because I have a whole house humidifier and dehumidifier that will be turning ON the HVAC fan to run and do not want them fighting for control over the fan. It will also not cycle the fan if the house state is at a curtain state because I will be gone for a few days(no need to freshen the air and help equalize the temp in the house if no one home).

  1. When the automation restarts from being triggered again will the timers that were running stop? or do I need to cancel them? or will it not matter if the state that started them is false now they will not run the sequence?

  2. I want to use an internal helper inside the automation that will not be added to my entities it is input_boolean.hvac_circ_on. Do I need to declare it somewhere or will it work fine just putting it in the code like I did.

  3. Am I trying to go about this all the wrong way?

blueprint:
  name: HVAC Fan Circulate
  description: Control HVAC fan to circulate on and off
  domain: automation
  input:
    thermostat:
      name: Thermostat
      selector:
        entity:
          domain: climate
    fan_on_time:
      name: Fan ON time
      default: 30
      selector:
        number:
          min: 5
          max: 120
          unit_of_measurement: minutes
    fan_off_time:
      name: Fan OFF time
      default: 30
      selector:
        number:
          min: 5
          max: 120
          unit_of_measurement: minutes
    house_state:
      name: House State
      selector:
        entity:
          domain: input_select
    house_state_not:
      name: House State to NOT circulate in
      default: ""

trigger:
  platform: state
  entity_id: !input thermostat
  attribute: hvac_action
mode: restart

action:
  choose:
  # Turn fan ON
    - conditions:
      - condition: and
        conditions:
        - condition: state  
          entity_id: !input thermostat
          attribute: hvac_action
          state: 'off'
          for:
            minutes: !input fan_off_time
        - condition: not
          conditions:
            condition: state
            entity_id: !input house_state
            state: !input house_state_not
      sequence:
        - service: climate.set_fan_mode
          target:
            entity_id: !input thermostat
          data:
            fan_mode: 'on'
        - service: input_boolean.turn_on
          target:
            entity_id: input_boolean_hvac_circ_on
  # Turn fan OFF if automation started fan
    - conditions:
      - condition: state
        entity_id: !input thermostat
        attribute: hvac_action
        state: 'on'
        for:
          minutes: !input fan_on_time
      - condition: state
        entity_id: input_boolean.hvac_circ_on
        state: 'on'
      - condition: not
        conditions:
          condition: state
          entity_id: !input thermostat
          attribute: hvac_action
          state: fan  
      sequence:
        - service: climate>set_fan_mode
          target:
            entity_id: !input thermostat
          data:
            fan_mode: auto  
        - service: input_boolean.turn_off
          target:
            entity_id: input_boolean_hvac_circ_on

Your approach can work. I am positive others can help w/ the blueprint - I rarely use them.

In my experience when there are numerous external triggers it can become cumbersome to control the device in a single automation/blueprint and even more so if you create many automations/blueprints for that device.

Have you used binary_sensor’s before?

These have simplified my automations because all the logic is in the sensor. And when a fan can be controller by a thermostat, a door/window sensor, presence, humidity, schedule, etc, it is has been far simpler to troubleshoot behavior this way.

No not yet. Have made a few helpers so far to help with troubleshooting and to help with automations.

Okay so I ran the blueprint. It showed up in automations.yaml but not showing up in the UI automations. Any ideas why? I don’t think it has ran so was going to check the trace and it not showing up in the automations list.

bump any help please?