Adding a whole house fan

Hello, I’m fairly new to HASS and ESPHome, and I need help setting up a 2 speed fan.

Right now, I’m just using 2 switches, one for on/off, the other for high/low.

I’m using a NodeMCU with 2 relays controlling the on/off and high/low states on pins D1 and D2.

How can I make it one switch with options Off/Low/High, and is there a way to make sure it shows up like that in both the lovelace dashboard and the google home app?

Here’s my current yaml file for that NodeMCU.

Thanks for any help.

For the Off/Low/High I would use an input_select. From there you can just use automations in HA to tell the ESP what to switch, ie: relays 1 and 2. I don’t think input_selects show up in the Google Home app though… Why would you need that when you have HA?

I’m trying to read into the input_select and I’m confused on how it would work.

I actually don’t use the HASS automations, I use NodeRed for that stuff.

For the Google Home app, my parents want to be able to use the simpler GH app and the google home speakers we have.

input_select lets you have a list of items from which you can select one. So you could create the following in HA:

input_select:
  house_fan:
    name: House Fan
    icon: mdi:fan
    options:
      - 'Off'
      - Low
      - High
    initial: 'Off'

You can do the automations for what happens when either is selected in Node-Red

Google Home does allow the integration of input_boolean so you can use one of those for the Low/ High I guess

Also, an even easier way for your parents to do things is to create a separate Lovelace Dashboard for them with a simplified UI and then in the app on their phones, make it open to that dashboard by default.

I’m guessing that would go into configuration.yaml correct?

I do have a seperate lovelace dashboard for them already, I use it so they can see the status of the door sensors and so I can use the device_trackers for automation.

There is a fan component in esphome, but I don’t think it does quite what you want. Maybe some customising?

I’m trying to read the documentation for the fan options in ESPHome but as far as I can tell it works using an analog output, when I need it to use 2 digital outputs.

or you can create separate files / or a package

Yeah I have been trying to figure out if it will use a template output to switch your binary outputs?

Or reversing our entire logic, use a template fan in HA, for which you wouldn’t need to change anything in esphome (I think)

Would something like this work?

fan:
  - platform: template
    fans:
      house_fan:
        friendly_name: "House Fan"
        value_template: "{{ states('input_boolean.state') }}"
        speed_template: "{{ states('input_select.speed') }}"
        turn_on:
          service: homeassistant.turn_on
          data:
            entity_id: switch.whole_house_fan
        turn_off:
          service: homeassistant.turn_off
          data:
            entity_id: switch.whole_house_fan
        set_speed:
          service: homeassistant.toggle
          data:
            entity_id: switch.whole_house_fan
        speeds:
          - 'low'
          - 'high'

also, how would I integrate into lovelace or the gh app?

That is the sort of thing I envisaged. Try it and see :slight_smile:

There are some lovelace fan cards in hacs, and no doubt some if you search in the forum.

No idea.