Recalculating Parameter after Trigger has been met in Automation

Hi,

I’ve written a simple automation for my HVAC and booster fan that uses a calculation based on the temperature differential between two different sensors to set the speed of the booster fan.

The automation works great when it is triggered (when the HVAC unit goes to “cooling”), but whatever calculation was done at that time for the fan percentage isn’t updated. I added a time pattern trigger, but that just runs fan all the time.

I’d like to add a time pattern to the automation while the “cooling” condition is met that would allow the fan speed to be updated as necessary. For example, when it triggers the fan might be very fast and might need to slow down over the next 10-15 minutes so the room doesn’t get too much cooling.

I can’t wrap my head around how to accomplish this.

Don’t use a time pattern. Polling is inefficient.

Trigger whenever the temperature changes. Calculate by how much it has changed from and to and adjust your speed accordingly.

That makes sense. So I need to do a separate automation that triggers when the temperature changes, with the condition that the system is set to cooling?

Probably easier than trying to shoehorn it into your existing automation. Hard to say as you haven’t shared it.

No, that makes total sense.

I have been trying to break a mindset of “this one automation should do everything I want for this device” rather than spreading it out over multiples.

FWIW, my preference is to create a single automation, for a given project/application, when feasible.

Sometimes you create multiple automations and realize it would be very easy to consolidate into one automation. Other times you discover a consolidated automation would be much more complicated to understand/maintain at a later date. The choice is based on your personal comfort/experience level.

If it interests you, post your automation(s) and we can offer our opinion on whether they benefit from consolidation.