Hello, could anyone point me in the correct direction on a project I am making to control 4 server fans, with a temperature sensor.
The hardware is up and running as in I can read the temperature and control my 4 relays manually from within HA.
What I want is at temp A relay A turns on at temp B relay B also turns on , and so on. Then when the temp drops below A B C D that relay turns off and so on.
I can do this with 8 separate automations 4 on and 4 off, but I am wanting to do it within one automation, I learn by example, so if anyone has a similar type automation could you please share . Thank you .
Probably possible with the temperature being the trigger and then you use the choose to choose what to “do”.
So if 30 degrees is all four, then have that as the first choose.
Then second choose is ABC on, D off.
Third choose is AB on and CD off.
And so on.
This is an HA automation exercise, not an ESPHome problem, so probably wrong forum category.
Please give us the entity names for the temperature sensor and relay switches, and the A B C D values, and I’m sure help will be forthcoming.
Didn’t even notice it was ESP-Home tagged.
But it could be done in ESP-Home also.
Just need to send the temperature to the ESP.
But I would do it in HA. Much easier and easier to manage.
In automations, if the switches are named similarly with a pattern
- switch.xyz_A
- switch.xyz_B
- switch.xyz_C
- switch.xyz_D
Then an automation can be scripted to use symbol substitution for the final character, where that final character is supplied or determined by the event or entity that triggered the automation:
- id: 0123456789
alias: Change Zone State
trigger:
platform: event
event_type: zone_below_30
action:
- service_template: switch.turn_on
data_template:
entity_id: switch.xyz_{{ trigger.event.data["entity"] }}
Hopefully, this is enough to get you started in the right direction?