<?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: Sunset + voice command with door contact restriction in Smart Home Developer Forum</title>
    <link>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/733908#M9318</link>
    <description>&lt;P data-start="108" data-end="130"&gt;Thanks for confirming.&lt;/P&gt;
&lt;P data-start="132" data-end="443"&gt;I tried the script below using virtual devices from &lt;A href="https://home-playground.withgoogle.com" target="_self"&gt;Google Home Playground&lt;/A&gt;. I removed the &lt;CODE data-start="222" data-end="227"&gt;and&lt;/CODE&gt; block from the &lt;CODE data-start="243" data-end="254"&gt;condition&lt;/CODE&gt; section since there's only one condition, and I replaced the action with an actual execution command instead of using the &lt;CODE data-start="377" data-end="388"&gt;Ok Google&lt;/CODE&gt; command. With these changes, the script worked for me.&lt;/P&gt;
&lt;P&gt;metadata:&lt;BR /&gt;name: bedroom blinds&lt;BR /&gt;description: Scripted automation&lt;/P&gt;
&lt;P&gt;automation:&lt;BR /&gt;starters:&lt;BR /&gt;- type: assistant.event.OkGoogle&lt;BR /&gt;eventData: query&lt;BR /&gt;is: Activate Bedroom Blinds Routine&lt;/P&gt;
&lt;P&gt;condition:&lt;BR /&gt;type: device.state.OpenClose&lt;BR /&gt;state: openPercent&lt;BR /&gt;is: 0&lt;BR /&gt;device: sensor - Bedroom&lt;/P&gt;
&lt;P&gt;actions:&lt;BR /&gt;- type: device.command.OpenClose&lt;BR /&gt;openPercent: 0&lt;BR /&gt;devices: blinds - Bedroom&lt;/P&gt;</description>
    <pubDate>Wed, 06 Aug 2025 17:22:05 GMT</pubDate>
    <dc:creator>arm_dpe</dc:creator>
    <dc:date>2025-08-06T17:22:05Z</dc:date>
    <item>
      <title>Sunset + voice command with door contact restriction</title>
      <link>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/731766#M9282</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I wanted to do the following:&lt;/P&gt;&lt;P&gt;- When SUNSET (time.schedule = sunset) or Voice Command 'Close Bedroom Blinds' (assistant.event.OkGoogle = Close Bedroom Blinds)&lt;/P&gt;&lt;P&gt;- AND window contact is closed (device.state.OpenClose = 0)&lt;/P&gt;&lt;P&gt;- ACTION&amp;nbsp;assistant.command.OkGoogle = Close Bedroom Blinds, also tried with&amp;nbsp;device.command.OpenClose = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it works for the sunset, when the window contact is physically open (100%) then the blinds do not close&lt;/P&gt;&lt;P&gt;But when I am giving the voice command, they still go down&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was maybe because the voice command directly does the blinds, so I tried something very random as a voice command, but it will still not trigger my automation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The automation:&lt;/P&gt;&lt;P&gt;metadata:&lt;BR /&gt;name: Bedroom Blinds - Close # Choose a short name that summarizes important starters and actions, like “Sunset lights”.&lt;BR /&gt;description: When sunset and windows closed, close bedroom blinds # 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;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;automation:&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;starters:&lt;BR /&gt;- type: time.schedule&lt;BR /&gt;at: sunset&lt;/P&gt;&lt;P&gt;- type: assistant.event.OkGoogle&lt;BR /&gt;eventData: query&lt;BR /&gt;is: Close Bedroom Blinds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;condition:&lt;BR /&gt;type: and&lt;BR /&gt;&lt;BR /&gt;conditions:&lt;BR /&gt;- type: device.state.OpenClose&amp;nbsp;&lt;BR /&gt;state: openPercent&lt;BR /&gt;is: 0&lt;BR /&gt;device: +1 Bedroom - Window Contact Left - +1 Bedroom&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;actions:&lt;BR /&gt;- type: assistant.command.OkGoogle&lt;BR /&gt;devices:&lt;BR /&gt;- +0 Living room display - +0 Living room&lt;BR /&gt;okGoogle: Close Bedroom Blinds&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2025 11:32:48 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/731766#M9282</guid>
      <dc:creator>Coppenst</dc:creator>
      <dc:date>2025-07-30T11:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sunset + voice command with door contact restriction</title>
      <link>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/733899#M9316</link>
      <description>&lt;P dir="ltr"&gt;&lt;SPAN&gt;Thanks for sharing your script. When you say, &lt;/SPAN&gt;&lt;FONT color="#008000"&gt;&lt;SPAN&gt;"Close Bedroom Blinds"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;, the Google Assistant immediately recognizes this as a direct command for a device named "Bedroom Blinds." It sends this command to the device directly, &lt;/SPAN&gt;&lt;SPAN&gt;completely bypassing the automation and its condition&lt;/SPAN&gt;&lt;SPAN&gt;. The blinds start closing before the automation even has a chance to check the window sensor's state.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P dir="ltr"&gt;&lt;SPAN&gt;Use a voice command that is &lt;/SPAN&gt;&lt;SPAN&gt;distinct from the action itself&lt;/SPAN&gt;&lt;SPAN&gt;.&amp;nbsp; The voice command should only serve as a trigger for the automation, and the automation will then perform the action.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;To fix this, the voice command starter needs to be a unique phrase (e.g., &lt;/SPAN&gt;&lt;FONT color="#008000"&gt;&lt;SPAN&gt;"Activate blinds routine"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;) that has no native meaning.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 16:13:07 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/733899#M9316</guid>
      <dc:creator>arm_dpe</dc:creator>
      <dc:date>2025-08-06T16:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sunset + voice command with door contact restriction</title>
      <link>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/733901#M9317</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you kindly for the feedback&lt;/P&gt;&lt;P&gt;However in the last part of my description before the automation, I have specified that using something else also does not work&lt;/P&gt;&lt;P&gt;When I change this to something else, it will not acknowledge my request&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example I used 'Im going to Ibiza' (oldschool Venga Boys) and Google just replied, oh thats nice you have fun&lt;/P&gt;&lt;P&gt;Also other commands like you suggested did not work, it does not run the routine st all&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 16:22:26 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/733901#M9317</guid>
      <dc:creator>Coppenst</dc:creator>
      <dc:date>2025-08-06T16:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sunset + voice command with door contact restriction</title>
      <link>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/733908#M9318</link>
      <description>&lt;P data-start="108" data-end="130"&gt;Thanks for confirming.&lt;/P&gt;
&lt;P data-start="132" data-end="443"&gt;I tried the script below using virtual devices from &lt;A href="https://home-playground.withgoogle.com" target="_self"&gt;Google Home Playground&lt;/A&gt;. I removed the &lt;CODE data-start="222" data-end="227"&gt;and&lt;/CODE&gt; block from the &lt;CODE data-start="243" data-end="254"&gt;condition&lt;/CODE&gt; section since there's only one condition, and I replaced the action with an actual execution command instead of using the &lt;CODE data-start="377" data-end="388"&gt;Ok Google&lt;/CODE&gt; command. With these changes, the script worked for me.&lt;/P&gt;
&lt;P&gt;metadata:&lt;BR /&gt;name: bedroom blinds&lt;BR /&gt;description: Scripted automation&lt;/P&gt;
&lt;P&gt;automation:&lt;BR /&gt;starters:&lt;BR /&gt;- type: assistant.event.OkGoogle&lt;BR /&gt;eventData: query&lt;BR /&gt;is: Activate Bedroom Blinds Routine&lt;/P&gt;
&lt;P&gt;condition:&lt;BR /&gt;type: device.state.OpenClose&lt;BR /&gt;state: openPercent&lt;BR /&gt;is: 0&lt;BR /&gt;device: sensor - Bedroom&lt;/P&gt;
&lt;P&gt;actions:&lt;BR /&gt;- type: device.command.OpenClose&lt;BR /&gt;openPercent: 0&lt;BR /&gt;devices: blinds - Bedroom&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 17:22:05 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/733908#M9318</guid>
      <dc:creator>arm_dpe</dc:creator>
      <dc:date>2025-08-06T17:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sunset + voice command with door contact restriction</title>
      <link>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/733915#M9319</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you, I am currently not able to test this, but when I have, I will report feedback&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 18:22:23 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/733915#M9319</guid>
      <dc:creator>Coppenst</dc:creator>
      <dc:date>2025-08-06T18:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sunset + voice command with door contact restriction</title>
      <link>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/734749#M9371</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;When I add this automation and test it, it was to start, but then the app gives me:&lt;/P&gt;&lt;P&gt;'It looks like there isn't an automation set up for that yet.'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I put in (for testing I did 1 blind, but there need to be 2 contacts and 2 blinds together afterwards):&lt;/P&gt;&lt;P&gt;metadata:&lt;BR /&gt;name: Bedroom blinds test&lt;BR /&gt;description: Scripted automation&lt;/P&gt;&lt;P&gt;automations:&lt;BR /&gt;starters:&lt;BR /&gt;- type: assistant.event.OkGoogle&lt;BR /&gt;eventData: query&lt;BR /&gt;is: Activate bedroom blinds routine&lt;/P&gt;&lt;P&gt;condition:&lt;BR /&gt;type: device.state.OpenClose&lt;BR /&gt;state: openPercent&lt;BR /&gt;is: 0&lt;BR /&gt;device: +1 Bedroom - Window Contact Right - +1 Bedroom&lt;/P&gt;&lt;P&gt;actions:&lt;BR /&gt;- type: device.command.OpenClose&lt;BR /&gt;openPercent: 0&lt;BR /&gt;devices: Bedroom - Right - +1 Bedroom&lt;/P&gt;</description>
      <pubDate>Sun, 10 Aug 2025 07:59:56 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Smart-Home-Developer-Forum/Sunset-voice-command-with-door-contact-restriction/m-p/734749#M9371</guid>
      <dc:creator>Coppenst</dc:creator>
      <dc:date>2025-08-10T07:59:56Z</dc:date>
    </item>
  </channel>
</rss>

