01-18-2024 05:19 PM
Hello everyone, I want to do something that seems simple but I'm overwhelmed by how the automation programming works.
All I need is when my Nest Thermostats turns ON the Heat in the house that my living room ceiling fan (in Smart Things) turns ON. Then when the heat turns OFF the fan turns off.
Is this relatively easy to do?
Answered! Go to the Recommended Answer.
01-19-2024 07:30 AM
In theory it should be easy...
I know this seems like a lot but once you get the hang of it, it goes pretty fast.
Good luck!
01-23-2025 09:16 AM
What is it about the error you don't understand? What is it about the error you do understand?
Please pay very close attention to spacing (text that is in blue) and device settings/names (text that is in green). In my situation, I'm turing on two different fans, that is why there is two "- type:" in the actions section. You need to customize the code for your device names and your situation. When requesting help, please explain what you have tried, what documentation you read, what lines in the documentation you thought was useful. We all have the ability to type in simple text, especially with Googles built in code suggestions. If there are terms you don't understand (i.e. spacing or indention), search for a response, often times the answer is only one search away.
01-19-2024 07:30 AM
In theory it should be easy...
I know this seems like a lot but once you get the hang of it, it goes pretty fast.
Good luck!
01-19-2024 09:28 AM - edited 01-19-2024 09:48 AM
Thank you so much for the reply. Yes, it looks easy. Unfortunately I got stuck at #6 as it doesn't offer the choice of when heat actually turns on/off. It only offers "Mode Change" which is when the Mode of the thermostats is changed from heating to cooling or OFF or ECO, etc. It also lets me choose when certain temperates are met. But that isn't quite what I'm looking for.
I will send them some Feedback requesting this change.
02-07-2024 10:07 PM
Nest not showing
01-22-2025 05:54 PM - edited 01-25-2025 07:53 PM
Here is the code to do this successfully - There are two automations. One to turn on fan(s) based on heating or cooling. The other turns fan(s) off. A third automation can be added in between the automations to change the speed of the fans to the desired strength.
metadata:
name: Start Nest Heat or Cool - Turn on fan
automations:
# ---- STARTERS ---- #
starters:
- type: device.state.TemperatureSetting
state: activeThermostatMode
is: heat
device: Nest - Hallway
- type: device.state.TemperatureSetting
state: activeThermostatMode
is: cool
device: Nest - Hallway
# ---- CONDITIONS ---- #
#condition:
#type: device.state.TemperatureSetting # For devices that support temperature points and modes.
# ---- ACTIONS ---- #
actions:
- type: device.command.OnOff
on: true
devices: Master Bedroom Fan - Master Bedroom
- type: device.command.OnOff
on: true
devices: 72' Artiste Fan - Living room
To Turn off the fan when not actively heating or cooling
metadata:
name: End Heat or Cool - Turn off fans
automations:
# ---- STARTERS ---- #
starters:
- type: device.state.TemperatureSetting
device: Nest - Hallway
state: activeThermostatMode
isNot: heat
# ---- CONDITIONS ---- #
condition:
type: or #checks if either is on, then turn off
conditions:
- type: device.state.OnOff
state: on
is: true
device: Master Bedroom Fan - Master Bedroom
- type: device.state.OnOff
state: on
is: true
device: 72' Artiste Fan - Living room
# ---- ACTIONS ---- #
actions: #turn off the following fans
- type: device.command.OnOff
on: false
devices: Master Bedroom Fan - Master Bedroom
- type: device.command.OnOff
on: false
devices: 72' Artiste Fan - Living room
Here is the documentation to help you customize your own script: https://developers.home.google.com/cloud-to-cloud/traits/temperaturesetting
For additional context here is a snippet from the Automation log. I've bolded the key value for the active_thermostat_mode. active_thermostat_mode will be "heat" or "cool" for only a moment when the HVAC system switches from "heat mode but furnance not on" to "heat mode now furnance is on". After those first few seconds, the value of active_thermostat_mode will be "none". Therefore the "isNot": heat is the key to getting the fan or switch to turn off. Luckily the webhook call from Nest back to Google Home doesn't happen every 15 seconds, but only listens for database state changes.
01-22-2025 08:39 PM
This is excellent! Thank you so much. I will give it a try tomorrow. Hopefully I can get it to work. I will let you know.
01-23-2025 07:22 AM
Hello, I'm getting an error that I just can't figure out and hoping you can help. I'm still very new to this script language.
actions:
- type: device.command.OnOff
on: true
devices: Master Bedroom Fan - Master Bedroom
- type: device.command.OnOff <------ error (below) on this line.
Invalid YAML syntax. These are sometimes indentation errors. Please visit this link to learn more about YAML
01-23-2025 09:16 AM
What is it about the error you don't understand? What is it about the error you do understand?
Please pay very close attention to spacing (text that is in blue) and device settings/names (text that is in green). In my situation, I'm turing on two different fans, that is why there is two "- type:" in the actions section. You need to customize the code for your device names and your situation. When requesting help, please explain what you have tried, what documentation you read, what lines in the documentation you thought was useful. We all have the ability to type in simple text, especially with Googles built in code suggestions. If there are terms you don't understand (i.e. spacing or indention), search for a response, often times the answer is only one search away.
01-23-2025 03:52 PM
Thanks for the extra info. I got it figured out and all is working now.
Best Regards,
01-25-2025 07:54 PM
Glad it worked out. Do you mind marking my response as the recommended answer?