Turn or off device at certain time with Assist

Hi all, one of the features I sometimes use with Google Assistant is the ability to turn devices on (mostly off) at a certain time. Like charging tools in the garage, I ask Google to turn off the smart switch for the chargers at a certain time, and it works great.

I’d love to do something similar with Assist, but am not really sure how. I have attempted to make something, but I know that I’m missing a couple of vital bits of code to get it to work. Would anyone know how to make this work?

custom sentence:

# Example config/custom_sentences/en/timers_delays.yaml
language: "en"
intents:
  DeviceDelay:
    data:
      - sentences:
          - "Turn off [the] <name> at {{ timer_delay }}"

Response:

intent_script:
  DeviceDelay:
    speech:
      text: "No problem, the <name> will be turned off at {{ timer_delay }} o'clock"
    action:
      service: input_datetime.set_datetime
      target:
        entity_id: input_datetime.timer_delay
      data:
        time: "{{timer_delay}}"

As a test, I was trying to start by getting the helper called Timer delay update by the intent script, then I could try and figure out the next bit, but the timer part isn’t working yet.

If anyone has already done this, or would know how, I’d love to hear from you :slight_smile:

1 Like