How to make one relay turn on another?

I have 2 relays that control a squirel cage fan in my shop. The way the fan works one is on the low speed and the other to the high speed side, but for high to work they both have to be on. Here is what i have now…

switch:
  - platform: gpio
    pin:
      number: GPIO12
      inverted: false
    name: "Dust Filter Low"    

  - platform: gpio
    pin:
      number: GPIO13
      inverted: false
    name: "Dust Filter High"

What I’m trying to do is make it where any time High is turned on it automatically turns low on as well. Hopefully what I’m asking makes sense. Every time i try to search for it I get something off the wall. Thanks in advance!

Please use code tags. Read How to help us help you - or How to ask a good question - Configuration - Home Assistant Community (home-assistant.io)

You need an automation to do that. How will you be controlling the switch entities?

Look at interlocks and automations in ESPhome.

OR, you could just wire it such that this is accomplished in hardware.

1 Like

My apologies, I think I fixed it.

Right now I’m just using the HA app from my phone and turning it on and off manually. I’m hoping to set up a push button on another ESP8266 to be able to control it as well.

This one got me there. I have looked at that several times but guess I just looked harder this time. Got it working now!

switch:
  - platform: gpio
    pin:
      number: GPIO12
      inverted: false
    name: "Dust Filter Low"
    id: dust_low    

  - platform: gpio
    pin:
      number: GPIO13
      inverted: false
    name: "Dust Filter High"
    id: dust_high
    on_turn_on:
    - switch.turn_on: dust_low
    on_turn_off:
    - switch.turn_off: dust_low  

Thanks everyone for the help!!!

Ok continuing on with this (If I should just start a new thread please let me know)

The ESP8266 and relays for this are mounted in the fan hanging from the ceiling. Is it possible to set up another esp8266 with push buttons to trigger the fan? I actually have a few different things I would like to trigger from a few buttons hooked to this ESP8266 and control things on a few other ESP8266 boards in other locations. Thanks again for all of the help!!! I’m trying to learn and not need to ask so much.

two alternatives:

  1. Put the automation into home assistant using the entities created by the esphome integration; or

  2. Use the http api to communicate from one esphome device to another using a combination of this HTTP Request — ESPHome and Web Server API — ESPHome

Thank you for that info! Is one route better than the other??

The philosophical question of the decade :slight_smile:

Option 1 means HA has to be up and working for your combination of devices to work.

Option 2 will work if HA is down, but it means your automations end up all of the place like a madman’s crap.

Up to you really.

I thought that might be the situation. Seems like with my limited esphome knowledge it might be better to set up automations in HA. This http stuff seems above my current pay grade. Thank you for the help!