<?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: Automation script error adding time delay in Home Automation</title>
    <link>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570482#M40724</link>
    <description>&lt;P&gt;Thanks guys, all sorted&lt;/P&gt;</description>
    <pubDate>Sun, 31 Dec 2023 15:59:03 GMT</pubDate>
    <dc:creator>Trig007</dc:creator>
    <dc:date>2023-12-31T15:59:03Z</dc:date>
    <item>
      <title>Automation script error adding time delay</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570105#M40689</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hoping that someone can help, tying to set up a simple automation in the script edito (new at this so be gentle) to turn on a light when the front door is opened after sunset &amp;amp; then automatically turn it off again after a set time, but keep getting either a 'the current structure has duplicate fields (type) or indentation error &amp;amp; its driving me nuts this is the structure (have copied the actions from the help pages example &amp;amp; getting the error) hoping someone can put me straight, any help would be massively appreciated, have pasted script below&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;metadata:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;name: Hall Light Automation # Choose a short name that summarizes important starters and actions, like “Sunset lights”.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;description: After sunset if Front door is opened, turn on hall light # Write a detailed description that includes everything the automation does, like “At sunset, on weekdays, close blinds, turn on lights to 50%, and play the sunset playlist on certain speakers.”&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;starters:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;- type: device.state.OpenClose&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; state:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;openPercent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; is: 100&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; device: Front Door - Hall&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;condition:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; type: time.between&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; before: sunrise+10min&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; after: sunset+10min&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;weekdays:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - MON&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - TUE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - WED&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - THU&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - FRI&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - SAT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - SUN&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;actions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; type: device.command.OnOff&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;devices: Hall Light - Hall&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;on: true&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type: time.delay&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for: 30sec&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; type: device.command.OnOff&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;devices: Hall Light - Hall&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;on: false&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2023 11:52:39 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570105#M40689</guid>
      <dc:creator>Trig007</dc:creator>
      <dc:date>2023-12-30T11:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Automation script error adding time delay</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570131#M40690</link>
      <description>&lt;P&gt;The following instruction do not seem to be on the same indentation as of the other "type:" instruction&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type: time.delay&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for: 30sec&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In the actions section, have the "type:" instructions on the same indentation:&lt;BR /&gt;&lt;SPAN&gt;actions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; type: device.command.OnOff&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;devices: Hall Light - Hall&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;on: true&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; type: time.delay&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for: 30sec&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; type: device.command.OnOff&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;devices: Hall Light - Hall&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;on: false&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2023 13:54:53 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570131#M40690</guid>
      <dc:creator>dionney</dc:creator>
      <dc:date>2023-12-30T13:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Automation script error adding time delay</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570142#M40694</link>
      <description>&lt;P&gt;Thanks for speady response dionney, have made that adjustment but still getting this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_20231230_144749.jpg" style="width: 400px;"&gt;&lt;img src="https://www.googlenestcommunity.com/t5/image/serverpage/image-id/50727i4DF7BE97A2DB6679/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="Screenshot_20231230_144749.jpg" alt="Screenshot_20231230_144749.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;any thoughts?&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2023 14:56:25 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570142#M40694</guid>
      <dc:creator>Trig007</dc:creator>
      <dc:date>2023-12-30T14:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Automation script error adding time delay</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570167#M40696</link>
      <description>&lt;P&gt;Instead of "type", use "- type".&lt;/P&gt;&lt;P&gt;I have the same error when I modify one of my scripts from dash type to a simple type.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2023 16:12:35 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570167#M40696</guid>
      <dc:creator>dionney</dc:creator>
      <dc:date>2023-12-30T16:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Automation script error adding time delay</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570223#M40701</link>
      <description>&lt;P&gt;My understanding is if you have multiple items of the same kind, you need to use a dash. So for your example, put a dash in front of each word "type" (i.e. -type) The parameters underneath need to be aligned with the t of type (not the dash). So the d of device will be aligned with the t of type. If you have done any programming before, it may help to know that you are essentially defining an array of the key called "actions" and each "type" is the next element in that array. Dashes are the way we tell YAML that these are elements in that array... I think.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2023 19:41:29 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570223#M40701</guid>
      <dc:creator>salbando</dc:creator>
      <dc:date>2023-12-30T19:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Automation script error adding time delay</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570482#M40724</link>
      <description>&lt;P&gt;Thanks guys, all sorted&lt;/P&gt;</description>
      <pubDate>Sun, 31 Dec 2023 15:59:03 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Automation-script-error-adding-time-delay/m-p/570482#M40724</guid>
      <dc:creator>Trig007</dc:creator>
      <dc:date>2023-12-31T15:59:03Z</dc:date>
    </item>
  </channel>
</rss>

