<?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 Need some help on an automation script in Home Automation</title>
    <link>https://www.googlenestcommunity.com/t5/Home-Automation/Need-some-help-on-an-automation-script/m-p/455132#M20114</link>
    <description>&lt;P&gt;I am trying to create an automation script which handles all the lights in my dining room and kitchen working from a Hue sensor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Essentially, what I want to create is from sunrise to 5pm, the lights in my kitchen turn on at 100% and after 5 mins turn back off again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;between 5pm and 10pm the lights in my kitchen, dining room and hallway all turn on when motion detected at 100% brightness and after 10pm to sunrise, the same lights all come on but at 15% brightness but im having trouble. The code will all work if I create them in seperate scripts with different before and after times, but surely I can migrate them to one script? Sorry im a bit new to this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below code is as far as I got and I get errors on the - type line after the 5pm - 10pm condition relating to indentation errors, but no matter where I put it, it seems to fail.&lt;/P&gt;&lt;P&gt;Would love some thoughts please&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;metadata:
  name: House Lights
  description: When motion is detected, turn on the lights, then turn them off after five minutes of stillness.
automations:
  - starters:
      - type: device.state.MotionDetection
        device: Hue motion sensor 1 - Default
        state: motionDetectionEventInProgress
        is: true
    condition:
      type: time.between
      after: sunrise
      before: 5pm

    actions:
      - type: device.command.BrightnessAbsolute # Adjust device absolute brightness.
        brightness: 100
        devices:
          - Kitchen 1 - Kitchen
          - Kitchen 2 - Kitchen
          - Bench 1 - Kitchen
          - Bench 2 - Kitchen
          - Bench 3 - Kitchen

      - type: device.command.OnOff 
        on: true
        devices:
          - Kitchen LED1 - Kitchen
          - Kitchen LED 2 - Kitchen

      - type: device.command.BrightnessRelative
        brightnessRelativePercent: 100
        devices:
          - Kitchen LED1 - Kitchen
          - Kitchen LED 2 - Kitchen

      - type: device.command.ColorAbsolute
        color:
          name: "bright white"
        devices:
          - Kitchen LED 2 - Kitchen
          - Kitchen LED1 - Kitchen

  - starters:
      - type: device.state.MotionDetection
        device: Hue motion sensor 1 - Default
        state: motionDetectionEventInProgress
        is: false
        for: 5min
    actions:
      - type: device.command.OnOff
        devices:
          - Bench 1 - Kitchen
          - Bench 2 - Kitchen
          - Bench 3 - Kitchen
          - Kitchen 1 - Kitchen
          - Kitchen 2 - Kitchen
          - Kitchen LED 2 - Kitchen
          - Kitchen LED1 - Kitchen

        on: false

    condition:
      type: time.between
      after: 5:00 pm
      before: 10:00 pm
      
      - type: device.command.BrightnessAbsolute
        brightness: 100
        devices:
          - Kitchen 1 - Kitchen
          - Kitchen 2 - Kitchen
          - Bench 1 - Kitchen
          - Bench 2 - Kitchen
          - Bench 3 - Kitchen
          - Hallway 1 - Hallway
          - Hallway 2 - Hallway
          - Dining Room 1 - Dining Room
          - Dining Room 2 - Dining Room
          - Dining Room 3 - Dining Room
          - Dining Room 4 - Dining Room

      - type: device.command.OnOff 
        on: true
        devices:
          - Kitchen LED1 - Kitchen
          - Kitchen LED 2 - Kitchen

      - type: device.command.BrightnessRelative
        brightnessRelativePercent: 100
        devices:
          - Kitchen LED1 - Kitchen
          - Kitchen LED 2 - Kitchen

      - type: device.command.ColorAbsolute
        color:
          name: "bright white"
        devices:
          - Kitchen LED 2 - Kitchen
          - Kitchen LED1 - Kitchen
    
  - starters:
      - type: device.state.MotionDetection
        device: Hue motion sensor 1 - Default
        state: motionDetectionEventInProgress
        is: false
        for: 5min
    actions:
      - type: device.command.OnOff
        devices:
          - Kitchen 1 - Kitchen
          - Kitchen 2 - Kitchen
          - Bench 1 - Kitchen
          - Bench 2 - Kitchen
          - Bench 3 - Kitchen
          - Hallway 1 - Hallway
          - Hallway 2 - Hallway
          - Dining Room 1 - Dining Room
          - Dining Room 2 - Dining Room
          - Dining Room 3 - Dining Room
          - Dining Room 4 - Dining Room

        on: false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jul 2023 06:55:13 GMT</pubDate>
    <dc:creator>ha11sy</dc:creator>
    <dc:date>2023-07-20T06:55:13Z</dc:date>
    <item>
      <title>Need some help on an automation script</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Need-some-help-on-an-automation-script/m-p/455132#M20114</link>
      <description>&lt;P&gt;I am trying to create an automation script which handles all the lights in my dining room and kitchen working from a Hue sensor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Essentially, what I want to create is from sunrise to 5pm, the lights in my kitchen turn on at 100% and after 5 mins turn back off again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;between 5pm and 10pm the lights in my kitchen, dining room and hallway all turn on when motion detected at 100% brightness and after 10pm to sunrise, the same lights all come on but at 15% brightness but im having trouble. The code will all work if I create them in seperate scripts with different before and after times, but surely I can migrate them to one script? Sorry im a bit new to this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below code is as far as I got and I get errors on the - type line after the 5pm - 10pm condition relating to indentation errors, but no matter where I put it, it seems to fail.&lt;/P&gt;&lt;P&gt;Would love some thoughts please&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;metadata:
  name: House Lights
  description: When motion is detected, turn on the lights, then turn them off after five minutes of stillness.
automations:
  - starters:
      - type: device.state.MotionDetection
        device: Hue motion sensor 1 - Default
        state: motionDetectionEventInProgress
        is: true
    condition:
      type: time.between
      after: sunrise
      before: 5pm

    actions:
      - type: device.command.BrightnessAbsolute # Adjust device absolute brightness.
        brightness: 100
        devices:
          - Kitchen 1 - Kitchen
          - Kitchen 2 - Kitchen
          - Bench 1 - Kitchen
          - Bench 2 - Kitchen
          - Bench 3 - Kitchen

      - type: device.command.OnOff 
        on: true
        devices:
          - Kitchen LED1 - Kitchen
          - Kitchen LED 2 - Kitchen

      - type: device.command.BrightnessRelative
        brightnessRelativePercent: 100
        devices:
          - Kitchen LED1 - Kitchen
          - Kitchen LED 2 - Kitchen

      - type: device.command.ColorAbsolute
        color:
          name: "bright white"
        devices:
          - Kitchen LED 2 - Kitchen
          - Kitchen LED1 - Kitchen

  - starters:
      - type: device.state.MotionDetection
        device: Hue motion sensor 1 - Default
        state: motionDetectionEventInProgress
        is: false
        for: 5min
    actions:
      - type: device.command.OnOff
        devices:
          - Bench 1 - Kitchen
          - Bench 2 - Kitchen
          - Bench 3 - Kitchen
          - Kitchen 1 - Kitchen
          - Kitchen 2 - Kitchen
          - Kitchen LED 2 - Kitchen
          - Kitchen LED1 - Kitchen

        on: false

    condition:
      type: time.between
      after: 5:00 pm
      before: 10:00 pm
      
      - type: device.command.BrightnessAbsolute
        brightness: 100
        devices:
          - Kitchen 1 - Kitchen
          - Kitchen 2 - Kitchen
          - Bench 1 - Kitchen
          - Bench 2 - Kitchen
          - Bench 3 - Kitchen
          - Hallway 1 - Hallway
          - Hallway 2 - Hallway
          - Dining Room 1 - Dining Room
          - Dining Room 2 - Dining Room
          - Dining Room 3 - Dining Room
          - Dining Room 4 - Dining Room

      - type: device.command.OnOff 
        on: true
        devices:
          - Kitchen LED1 - Kitchen
          - Kitchen LED 2 - Kitchen

      - type: device.command.BrightnessRelative
        brightnessRelativePercent: 100
        devices:
          - Kitchen LED1 - Kitchen
          - Kitchen LED 2 - Kitchen

      - type: device.command.ColorAbsolute
        color:
          name: "bright white"
        devices:
          - Kitchen LED 2 - Kitchen
          - Kitchen LED1 - Kitchen
    
  - starters:
      - type: device.state.MotionDetection
        device: Hue motion sensor 1 - Default
        state: motionDetectionEventInProgress
        is: false
        for: 5min
    actions:
      - type: device.command.OnOff
        devices:
          - Kitchen 1 - Kitchen
          - Kitchen 2 - Kitchen
          - Bench 1 - Kitchen
          - Bench 2 - Kitchen
          - Bench 3 - Kitchen
          - Hallway 1 - Hallway
          - Hallway 2 - Hallway
          - Dining Room 1 - Dining Room
          - Dining Room 2 - Dining Room
          - Dining Room 3 - Dining Room
          - Dining Room 4 - Dining Room

        on: false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 06:55:13 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Need-some-help-on-an-automation-script/m-p/455132#M20114</guid>
      <dc:creator>ha11sy</dc:creator>
      <dc:date>2023-07-20T06:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need some help on an automation script</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Need-some-help-on-an-automation-script/m-p/455249#M20136</link>
      <description>&lt;P&gt;Is there a reason why you don't just create separate scripts? Even after correcting all of the indentation errors, your struct has duplicate action, condition, and starter fields. I'm not a YAML coder, and unless I'm wrong, I don't think there is a way that you can rearrange this struct so that it would pass the validation check. Have you seen the example scripts?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example scripted automations&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.home.google.com/automations/example-scripts" target="_blank" rel="noopener"&gt;https://developers.home.google.com/automations/example-scripts&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: Apparently this can be done but your array structure is incorrect.&lt;/P&gt;&lt;P&gt;Reference:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.home.google.com/automations/schema/basics#array" target="_blank"&gt;https://developers.home.google.com/automations/schema/basics#array&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 16:38:20 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Need-some-help-on-an-automation-script/m-p/455249#M20136</guid>
      <dc:creator>DWB1973</dc:creator>
      <dc:date>2023-07-20T16:38:20Z</dc:date>
    </item>
  </channel>
</rss>

