This Blueprint is for controlling a 3 speed fan based on a temp sensor reading. There is a version for a 3 speed MQTT Fan & another version that communicates thru a Home Assistant fan entity using speed percentages.
- 2023-03-01: Add Author Tag. Bump HA required Version to 2023-3-0
- 2022-12-26: BugFix. Time default no longer all zeros. Update default Tnx: cappadanna
- 2022-12-12: Add Update Method Note, minor code change.
- Name of Blueprint may have changed meaing you have to re-download with a new link.
- If name changed, it is similar. Variables have not changed.
- 2022-05-15-A: Minor code clean-up on Casting, no functional change.
- Updated AirCon Start Example code to include start AirCon only if warm enough in room.
- 2022-05-15: Add 2nd Blueprint triggered with HA fan entity, otherwise identical.
- 2022-05-12.1: Change MQTT QOS to 2
- 2022-05-12: Added support for weekday control
- Added Action Selectors to the ‘fan’ & ‘all done’ loops for controlling AirCon or Heat or anything.
- 2022-05-05: Updated for 2022.5.0 HA. Added Markdown to !input Descriptions plus shortcut and & or.
- 2022-02-07: Add Default value to float filters (for HA Breaking change).
- 2021-11-20: Add Minimum Home Assistant version.
- 2021-09-03: Add Description.
- 2021-08-19: Remove negative Temp Gap hysteresis, logic wrong.
- 2021-08-04: Remove Default path as it made my fan beep for no reason.
- 2021-08-02: First blueprint version needs Home Assistant Core 2021.7 or higher for Trigger_ID to work.
About this blueprint
Type of blueprint: AUTOMATION
Why do I need this?
This functionality started as a way to help my Bedroom AC unit keep an even temperature throughout the bedroom over night. My partner wanted the fan on, but not faster than it had to be. I wanted it to change speeds following the temperature of the room. So that’s what I did.
I continue to use this functionality in a slightly different way in my home system. If you want to see my use the automation form of this look at my HA Configuration GitHub repository. You will see that I have combined the control of the AC unit climate entity with this fan speed function and also have an ‘on demand’ version of this for when the room needs to be used during the day. My feeling was that I wanted to make this accessible to a wider audience, so I created this blueprint.
If you are looking to tweak the function here or are looking for something the same but different, hit me up on my Discord and we can work on that! If you see problems or have questions and don’t want to use Discord, Comments here are also welcome.
- 1 input_boolean entity as the feature so you can enable or disable the automation easily.
- 1 input_number used as the target temperature for the area you will be in.
- 1 temperature sensor or temp average sensor or filtered temp sensor. This should be located physically within the breeze area of the fan for maximum desired affect.
people2monitor/name: Person or People to follow Select the Person you want this BP to trigger on for this action. Multiples are allowed. fan_control/name: Toggle to turn the fan function off for when away or seasonally (#1) ```input_boolean``` - If this is set to off, the Automation will be disabled. room_temp_now/name: Room Temperature Sensor (#2) This is a temperature sensor or averaged temperature sensor preferrably within the path of the moving air from the fan. room_set_temp/name: Room Target Temperature (#3) ```input_number``` - This is the target temperature of the room. temp_gap/name: Temp Hysteresis (#4) This keeps the fan from speed cycling too often. (Let''s call it Hysterisis) temp_gap_1_to_2/name: Temp Gap between Low and Medium (#5) This is the temp swing between Low and Medium. temp_gap_2_to_3/name: Temp Gap between Medium and High (#6) This is the temp change between Medium and High. fan_on_time/name: Time of day fan should start (#7) Set this for the time of day you want the fan function to be enabled. fan_off_time/name: Time of day fan should stop (#8) Set this for the time of day you want the fan function to end. weekday/name: Day of the week to use the Automation (#9) Enable it these days only loop_action/name: User action for fan enabled condition (loop) (#11) This is intended to start / set temp on an AC unit or whatever you want to do. It is executed on every successful trigger that does not send the operation to off. off_action/name: User action for fan off condition (off_action) (#12) This is intended to disable an AirCon unit or whatever you want to do. It is executed on every successful operation off trigger. **AutomationFanControl_HA_fan.yaml ONLY:** fan/name: Fan Entity (#10) This is the Home Assistant Fan entity **AutomationFanControl_MQTT.yaml ONLY:** mqtt_fan_topic/name: Fan Topic (#10) This is the MQTT Topic needed to change the fan speed.
- You can use either Metric or Imperial, but the sensor and the input_number have to be using the same scale.
- The Hysteresis offset can be ‘0’ for the simplest operation. If you hare using the input_number to control both this and a climate integration, you may want an offset so the fan does not quick cycle. It basically move the input_number set point by the amount you pick
- You can have multiple automations running off of this with the same or different temp settings or times, but I suggest the times on ‘ENABLED’ versions do not overlap, or it will get very confused.
HOW the Blueprint / Automation works
- The header of the Blueprint contains the required info plus the URL from where it came from.
- The input: section is where it gets the information it needs to fill in the blanks. This information is stored in the actual automation referencing this Blueprint when executing the task.
- The Variables section has several entries. These are converting !inputs to variables that can be used in templates.
- The triggers section has hooks for the listed things. 2 of them are used to stop the automation at the appropriate time, and the rest are used to start the automation or to adjust the fan speed on temperature changes.
- In the action the first test looks to see if the automation wants to stop. If that is not the case, it will test the temperature reading against the set point and adjust the fan speed accordingly.
🪄 How do I use this
In the yaml file linked below I show how I and controlling my AirCon within the fan loop. I have a window unit that is WIFI enabled for Temperature and on/off. I set this up to only trigger to the AirCon unit when it actually needs to change something to avoid rate limiting situations. Follow the comments and see the example yaml code here
If you are troubleshooting and you want to see more traces back when doing so, here is a TIP I’ve found.
Manually edit the automation created with the ui editor (or manually with a text editor) and add the following to have this automation contain 10 traces instead of the normal 5. Then if the automation is triggering often, you can see the last 10 traces to help you decide what the issue is.
HA Docs on this here.
trace: stored_traces: 10
Updates will be published on my GIT repository with the rest of my Home Assistant Blueprint collection.
There is not an official version control system for Blueprints. However I have found something that comes pretty close. It is not perfect, but for MOST Blueprints, it does just fine. I encourage you to check this script out and use it to easily check if I have updated this blueprint. koter84 Blueprint Update Script
Please Click the at the end of this top Post if you find this Useful
Software to Download
Click this badge to import this Blueprint. This is the version that uses HA fan integration and 0%, 33%, 66%, & 100% values to control the fan:
Click this badge to import this Blueprint. This is the version that uses MQTT speeds 0, 1, 2, 3 to control the fan:
Direct link to download Blueprint:
HA Fan Entity Version: Version: Copy this link if you want to import the blueprint in your installation.
MQTT Version: Version: Copy this link if you want to import the blueprint in your installation.
All My Blueprints
Here is a list of each of my blueprints, a quick description and jump links to the Blueprints Exchange post…
Broadlink on Script Blueprint
This is a SCRIPT Blueprint that uses my Broadlink RM3 to turn my TV on and get it into the correct mode, Pushes remote buttons in sequence.
Tasmota EZ Button Blueprint
This Script Blueprint generates 3 Buttons to help you manage your Tasmota installed base. Restart All, Update a few, and Update all.
Play Media File Script Blueprint Blueprint
This is a SCRIPT Blueprint. This provides a way to play canned media files with the big long list of YAML entries but keep the main script or automation clean.
TTS All Message Blueprint
This script can use any of the 11 integrated TTS Platforms in Home Assistant to send a message to a media player.
Auto Fan Control Blueprint
This Blueprint is for controlling a 3 speed fan based on a temperature sensor. Both fan % control & MQTT fan control versions.
Door Open TTS Cloud-Say Message Blueprint
This Blueprint is a TTS.cloud-say version of another Door Announcer I found in the HA Blueprint Exchange.
Keypad Lock or puzzle Box Tool Blueprint
This Blueprint accepts 5 actions & when done in the right order, flips an input_boolean.
Zigbee2MQTT - Xiaomi Cube Controller Blueprint
This Blueprint uses a Zigbee2MQTT built sensor to sort out the multitude of commands from the Xiaomi Magic Cube Remote.
Zigbee2MQTT - ZemiSmart ZM-RM02 Controller Blueprint
This Blueprint uses the Z2M (Zigbee2MQTT) imported Action sensor to sort out the 18 commands from the ZemiSmart ZM-RM02 Controller.
ZHA - Xiaomi Cube Controller Blueprint
This Blueprint uses a ZHA built sensor to sort out the 38(+54) commands from the Xiaomi Magic Cube Remote.
Device_tracker Monitor & Notifier
This Blueprint Monitor’s device_tracker entities that you choose & notifies you if they go offline. Then it gives you the opportunity to devise an action to deal with it.
Zigbee2MQTT Aqara Magic Cube T1-Pro CTP-R01 Xiaomi Lumi cagl02
This Blueprint gives you literally hundreds of actions available on the new Magic Cube.
Humidifier Water Throttle Control
This blueprint monitors a humidity sensor & by determining the error from the goal, sends info to a humidifier as to how long to flow the water. This saves water & has a minimal effect on function. Requires a Sonoff SV, Generic hygrostat Integration, & a suitable humidifier.
This BluePrint will monitor a person or persons, and when they ‘enter’ or ‘leave’ the zone or zones you pick, it will trigger an action for both enter and leave phases. Yes, it will watch multiple people and multiple zones at the same time!
This is Blueprint is provided as a helper for people using the Octoprint Plugin called OctoPrint-HomeAssistant. What this does is add 6 buttons, 4 of which you as the user can set your own G-Codes to for customizing. Also adds safe shutdown and presentation functions.
Contact Links or see my other work
What are we Fixing Today Homepage / Website: https://www.WhatAreWeFixing.Today/
Channel Link URL: (WhatAreWeFixingToday) What are we fixing today? - YouTube
Discord Guild: (Sir_Goodenough#9683) WhatAreWeFixingToday?
If you want to support me
Buy me Coffee: Sir GoodEnough
PayPal one-off donation link: PayPal.Me