<?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 Re: Multiple conditions in script in Home Automation</title>
    <link>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/494584#M23161</link>
    <description>&lt;P&gt;Am posting link to working code. Hopefully tabs et al are preserved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.google.com/document/d/1ja_-4PWK5yC6q9gVnEa4lXFLsAJkKkpToONou7H1zXI/edit?usp=drivesdk" target="_blank"&gt;https://docs.google.com/document/d/1ja_-4PWK5yC6q9gVnEa4lXFLsAJkKkpToONou7H1zXI/edit?usp=drivesdk&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 21 Oct 2023 13:56:20 GMT</pubDate>
    <dc:creator>BrianSullivan</dc:creator>
    <dc:date>2023-10-21T13:56:20Z</dc:date>
    <item>
      <title>Multiple conditions in script</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/489714#M22834</link>
      <description>&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;Just starting to play with Google Home scripted automations and am having trouble with the correct syntax/indenting for an automation that has &lt;EM&gt;&lt;STRONG&gt;multiple conditions&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV&gt;Anybody have a valid example that they can post (or a link) to an automation with multiple conditions?&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Oct 2023 15:33:50 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/489714#M22834</guid>
      <dc:creator>BrianSullivan</dc:creator>
      <dc:date>2023-10-10T15:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple conditions in script</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/489717#M22835</link>
      <description>&lt;P&gt;OK a bit of fooling around and I think I have this one solved.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 16:08:52 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/489717#M22835</guid>
      <dc:creator>BrianSullivan</dc:creator>
      <dc:date>2023-10-10T16:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple conditions in script</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/494435#M23159</link>
      <description>&lt;P&gt;Morning &lt;a href="https://www.googlenestcommunity.com/t5/user/viewprofilepage/user-id/431466"&gt;@BrianSullivan&lt;/a&gt; can you post the example YAML code you got working.&amp;nbsp; I'm trying to set my closet light bulb brightness and color based on time of day when the door is opened.&amp;nbsp; I'm struggling a little with the best placement in the Google Script Editor to add the brightness and color.&amp;nbsp;&amp;nbsp; I'm hoping seeing what you got working will help me figure out my issue.&lt;BR /&gt;&lt;BR /&gt;Here is my current working code:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Working Code as of 21 Oct 2023&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# ------------------------------------------------------------------------------------------ #&lt;/P&gt;&lt;P&gt;# Lines starting with “#” are comments and will be ignored by the automation.&lt;/P&gt;&lt;P&gt;# Indentation determines hierarchy within the script.&lt;/P&gt;&lt;P&gt;# Visit g.co/home/script-editor-docs for full documentation.&lt;/P&gt;&lt;P&gt;# ------------------------------------------------------------------------------------------ #&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;metadata:&lt;/P&gt;&lt;P&gt;&amp;nbsp; name: MB Closet Light ON # Choose a short name that summarizes important starters and actions, like “Sunset lights”.&lt;/P&gt;&lt;P&gt;&amp;nbsp; description: Turn MB Closet Light ON When Door Opens. Uses Aoetec door sensor to turn on Feit recessed lights.&lt;/P&gt;&lt;P&gt;automations:&lt;/P&gt;&lt;P&gt;&amp;nbsp; # “starters” and “actions” are required; “conditions” are optional.&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Use Ctrl + Space to see autocomplete suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; # ---- STARTERS ---- #&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Starters describe events that will start the automation.&lt;/P&gt;&lt;P&gt;&amp;nbsp; # To add more than one starter, duplicate the "- type" section under "starters".&lt;/P&gt;&lt;P&gt;&amp;nbsp; # If you add multiple starter events, any one of them happening will start the automation.&lt;/P&gt;&lt;P&gt;&amp;nbsp; starters:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - type: device.state.OpenClose&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state: openPercent&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # [available operators: is, isNot, lessThan, lessThanOrEqualTo, greaterThan, greaterThanOrEqualTo]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is: 100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; device: Master BR Closet Sensor - Master Bedroom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; # ---- CONDITIONS ---- #&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Conditions are optional. Delete this section if it’s empty.&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Conditions will prevent an automation from starting if the conditions aren’t met.&lt;/P&gt;&lt;P&gt;&amp;nbsp; # See g.co/home/script-editor-docs for documentation about how to use logical operators like “and”, “or”, and “not”.&lt;/P&gt;&lt;P&gt;&amp;nbsp; condition:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: time.between&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Optional. Accepts either clock time (10:00:00 AM, with seconds optional, or in a 24 hour format), or 'sunrise' or 'sunset', with an optional offset ('sunrise+10m', for instance)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; before: 21:00 # HH:MM (24 hours format). Adjust time as needed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Optional. Accepts either clock time (10:00:00 AM, with seconds optional, or in a 24 hour format), or 'sunrise' or 'sunset', with an optional offset ('sunrise+10m', for instance)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; after: 07:00 # HH:MM (24 hours format). Adjust time as needed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Optional. Days of the week to apply condition on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; # ---- ACTIONS ---- #&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Actions will start when a starter event takes place and all conditions are met.&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Actions will start in the order they appear in the script and with any delay specified.&lt;/P&gt;&lt;P&gt;&amp;nbsp; # To add more than one action, duplicate the "- type" section under "actions".&lt;/P&gt;&lt;P&gt;&amp;nbsp; actions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - type: device.command.OnOff # Turn the device on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; devices: Master Bedroom Lights - Master Bedroom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on: true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - type: time.delay&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for: 3min&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set MB Closet Lights to 100 Percent Brightness&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - type: device.command.BrightnessAbsolute # Adjust device absolute brightness.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; brightness: 100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; devices: Master Bedroom Lights - Master Bedroom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set MB Closet Lights Color to Bright White&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - type: device.command.ColorAbsolute&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name: white&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; devices: Master Bedroom Lights - Master Bedroom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Turns Group Master Bedroom Lights off after 3min&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - type: device.command.OnOff # Turn the device off.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; devices: Master Bedroom Lights - Master Bedroom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on: false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;If closet door is opened from 7:00am to 9:00 pm Set Light color to white and 100 percent brightness.&lt;/P&gt;&lt;P&gt;If closet door is opened from 9:00pm to 7:00 am Set Light color to Red and 50 percent brightness. ( Cats light to open closet doors in the middle of the night and setting the light to red will hopefully prevent me from waking up.&amp;nbsp; Also if I get up early and need something out of closet I can open door and not wake up my partner GF)&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2023 12:49:33 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/494435#M23159</guid>
      <dc:creator>SpruceHome</dc:creator>
      <dc:date>2023-10-21T12:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple conditions in script</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/494584#M23161</link>
      <description>&lt;P&gt;Am posting link to working code. Hopefully tabs et al are preserved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.google.com/document/d/1ja_-4PWK5yC6q9gVnEa4lXFLsAJkKkpToONou7H1zXI/edit?usp=drivesdk" target="_blank"&gt;https://docs.google.com/document/d/1ja_-4PWK5yC6q9gVnEa4lXFLsAJkKkpToONou7H1zXI/edit?usp=drivesdk&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2023 13:56:20 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/494584#M23161</guid>
      <dc:creator>BrianSullivan</dc:creator>
      <dc:date>2023-10-21T13:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple conditions in script</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/496167#M23459</link>
      <description>&lt;P&gt;Looks like you solved this but the by the book way of doing multiple conditions is leveraging AND&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;condition:
    type: and
    # "AND" together two or more conditionals
    conditions:
      - type: device.state.OpenClose
        state: openPercent
        # [available operators: is, isNot, lessThan, lessThanOrEqualTo, greaterThan, greaterThanOrEqualTo]
        is: 100
        device: AQCS1 Freezer - Kitchen
      - type: home.state.HomePresence
        state: homePresenceMode
        # [available operators: is, isNot]
        is: HOME&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 21 Oct 2023 21:23:07 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/496167#M23459</guid>
      <dc:creator>OpethNJ</dc:creator>
      <dc:date>2023-10-21T21:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple conditions in script</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/546849#M36197</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i made in automation with several conditions. No error when i press validation but when the automation runs it ignores the conditions...&lt;/P&gt;&lt;P&gt;metadata:&lt;BR /&gt;name: Luftbefeuchter an, wenn unter 55 &amp;amp; und jemand im Wohnzimmer ist NEU&lt;BR /&gt;description: Turn on the humidifier in the living room when the humidity drops too low&lt;BR /&gt;automations:&lt;BR /&gt;- starters:&lt;BR /&gt;- type: device.state.HumiditySetting&lt;BR /&gt;device: Das Wohnzimmer - EG Wohnzimmer&lt;BR /&gt;state: humidityAmbientPercent&lt;BR /&gt;lessThan: 55&lt;BR /&gt;condition:&lt;BR /&gt;type: or&lt;BR /&gt;# "OR" together two or more conditionals&lt;BR /&gt;conditions:&lt;BR /&gt;- type: device.state.OnOff&lt;BR /&gt;state: on&lt;BR /&gt;# [available operators: is, isNot]&lt;BR /&gt;is: true&lt;BR /&gt;device: Auf Holzkommode Neu - EG Wohnzimmer&lt;BR /&gt;- type: device.state.OnOff&lt;BR /&gt;state: on&lt;BR /&gt;# [available operators: is, isNot]&lt;BR /&gt;is: true&lt;BR /&gt;device: Lampe Sofa - EG Wohnzimmer&lt;BR /&gt;- type: device.state.OnOff&lt;BR /&gt;state: on&lt;BR /&gt;# [available operators: is, isNot]&lt;BR /&gt;is: true&lt;BR /&gt;device: Pilzlampe - EG Wohnzimmer&lt;/P&gt;&lt;P&gt;actions:&lt;BR /&gt;- type: device.command.OnOff&lt;BR /&gt;on: true&lt;BR /&gt;devices: Luftbefeuchter Wohnzimmer - EG Wohnzimmer&lt;BR /&gt;- type: assistant.command.Broadcast&lt;BR /&gt;message: Der Luftentfeuchter wurde automatisch eingeschaltet, da die Luftfeuchtikeit unter 55 % gefallen und du dich im Wohnzimmer aufhälst&lt;BR /&gt;devices: EG Wohnzimmer Display - EG Wohnzimmer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advise?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 10:37:06 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/546849#M36197</guid>
      <dc:creator>madCase</dc:creator>
      <dc:date>2023-11-13T10:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple conditions in script</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/576553#M41904</link>
      <description>&lt;P&gt;Same as&amp;nbsp;&lt;a href="https://www.googlenestcommunity.com/t5/user/viewprofilepage/user-id/454629"&gt;@madCase&lt;/a&gt;, the execution does not starts because no conditions matched:&lt;/P&gt;&lt;P&gt;condition:&lt;BR /&gt;type: or&lt;BR /&gt;conditions:&lt;BR /&gt;- type: home.state.HomePresence&lt;BR /&gt;state: homePresenceMode&lt;BR /&gt;is: AWAY&lt;BR /&gt;- type: time.between&lt;BR /&gt;before: sunset&lt;BR /&gt;after: sunrise&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 10:40:52 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Multiple-conditions-in-script/m-p/576553#M41904</guid>
      <dc:creator>baartu95</dc:creator>
      <dc:date>2024-01-16T10:40:52Z</dc:date>
    </item>
  </channel>
</rss>

