I can get a basic automation to turn the fan off, on, or set a speed, but when I try to get it all into one automation that sets the fan speed based on the temperature differential between upstairs and downstairs, it doesn’t seem to work. I’m assuming there’s something wrong with my templating syntax, but I can’t seem to get it ironed out.
Note that the entity_id: is under data:, which in your case would be data_template:.
It also doesn’t show numbers for speeds, but I don’t know anything about the fan integration. I don’t see anything wrong with your template syntax, other than it outputs “off” and numbers, which may be correct for your device.
Thanks to both. It totally makes sense to cast those ‘current_temperatures’ as ints before doing the < comparison. Also seems like the abs() function doesn’t work either way.
So I’m onto the next idea, which is to try to write this as 2 or more separate automations.