<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Script Help for automatically turning on/off fan with thermostat state. in Home Automation</title>
    <link>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Help-for-automatically-turning-on-off-fan-with-thermostat-state/m-p/606004#M45360</link>
    <description>&lt;P&gt;1. I want an overhead smart fan to turn on when my thermostat turns on the furnace.&lt;/P&gt;&lt;P&gt;2. I want an overhead smart fan to turn off when my thermostat turns off the furnace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got #1 to work using this script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;starters:
- type: device.state.TemperatureSetting 
state: activeThermostatMode
is: heat
device: Main Level - 1 Family Room


actions:
- type: device.command.OnOff 
on: true
devices: Fan - 1 Family Room&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having trouble with #2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;starters:
- type: device.state.TemperatureSetting 
state: activeThermostatMode
is: on
device: Main Level - 1 Family Room

actions:
- type: device.command.OnOff 
on: false
devices: Fan - 1 Family Room&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also tried&amp;nbsp;&lt;/P&gt;&lt;P&gt;"activeThermostatMode" is "off".&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2024 21:03:09 GMT</pubDate>
    <dc:creator>Jmahoneyy</dc:creator>
    <dc:date>2024-03-14T21:03:09Z</dc:date>
    <item>
      <title>Script Help for automatically turning on/off fan with thermostat state.</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Help-for-automatically-turning-on-off-fan-with-thermostat-state/m-p/606004#M45360</link>
      <description>&lt;P&gt;1. I want an overhead smart fan to turn on when my thermostat turns on the furnace.&lt;/P&gt;&lt;P&gt;2. I want an overhead smart fan to turn off when my thermostat turns off the furnace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got #1 to work using this script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;starters:
- type: device.state.TemperatureSetting 
state: activeThermostatMode
is: heat
device: Main Level - 1 Family Room


actions:
- type: device.command.OnOff 
on: true
devices: Fan - 1 Family Room&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having trouble with #2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;starters:
- type: device.state.TemperatureSetting 
state: activeThermostatMode
is: on
device: Main Level - 1 Family Room

actions:
- type: device.command.OnOff 
on: false
devices: Fan - 1 Family Room&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also tried&amp;nbsp;&lt;/P&gt;&lt;P&gt;"activeThermostatMode" is "off".&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 21:03:09 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Help-for-automatically-turning-on-off-fan-with-thermostat-state/m-p/606004#M45360</guid>
      <dc:creator>Jmahoneyy</dc:creator>
      <dc:date>2024-03-14T21:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help for automatically turning on/off fan with thermostat state.</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Help-for-automatically-turning-on-off-fan-with-thermostat-state/m-p/671289#M51054</link>
      <description>&lt;P&gt;Give the two scripts below a try.. I have Gen 3 Nest Thermostat and a Meross Fan Control wall switch. If it is winter time, then you have the Nest set to heat. Thermostat mode is always set to Heat in this case. ActiveThermostatMode is set to "heat" when the furance turns on. ActiveThermostatMode is set to "none" when the furance turns off since it reached the setpoint. The annoying part is that when you use the script editor autofill for ActiveThermostatMode there isn't a "none" value available so you can't use it in the script editor because it will throw an error. I used the isNot operator since I couldn't query for the HVAC fan on/off status and I couldn't figure out a way to compare the temperature setpoint and the ambient temperature .&lt;BR /&gt;&lt;BR /&gt;metadata:&lt;BR /&gt;name: Fans OFF when Heat OFF&lt;BR /&gt;description: turn off fans when hvac heat is off&lt;BR /&gt;automations:&lt;BR /&gt;- starters:&lt;BR /&gt;- type: device.state.TemperatureSetting&lt;BR /&gt;device: Nest Thermostat - Hallway&lt;BR /&gt;state: activeThermostatMode&lt;BR /&gt;isNot: heat&lt;BR /&gt;actions:&lt;BR /&gt;- type: device.command.OnOff&lt;BR /&gt;devices: Fan - Office&lt;BR /&gt;on: false&lt;BR /&gt;&lt;BR /&gt;metadata:&lt;BR /&gt;name: Fans ON when Heat ON&lt;BR /&gt;description: turn on fans when hvac heat is on&lt;BR /&gt;automations:&lt;BR /&gt;- starters:&lt;BR /&gt;- type: device.state.TemperatureSetting&lt;BR /&gt;device: Nest Thermostat - Hallway&lt;BR /&gt;state: activeThermostatMode&lt;BR /&gt;is: heat&lt;BR /&gt;actions:&lt;BR /&gt;- type: device.command.OnOff&lt;BR /&gt;devices: Fan - Office&lt;BR /&gt;on: true&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 00:20:41 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Help-for-automatically-turning-on-off-fan-with-thermostat-state/m-p/671289#M51054</guid>
      <dc:creator>robbygomez36</dc:creator>
      <dc:date>2025-01-22T00:20:41Z</dc:date>
    </item>
  </channel>
</rss>

