Having a hard time with Assistant Relay and automation

Hello!

I have Assistant Relay working perfectly if I configure it through a button…for example, I tap a button and Assistant Relay sends the Google home a command to turn off my bedroom fan.

How can integrate that into an automation? For example, at 9pm have Assistant Relay send a command to turn off the same fan.

I have this as my action and it fails with a malformed message.

action:
    - data:
        command: "turn off the bedroom fan"
        service: rest_command.assistant_relay

I’ve tried it numerous ways, all fails with malformed error.

Your indentation is off. Try this:

trigger:
  ....whatever...
action:
  - data:
      command: "turn off the bedroom fan"
    service: rest_command.assistant_relay

See the example in the docs here: https://www.home-assistant.io/integrations/rest_command/#using-a-rest-command-as-an-action-in-an-automation

Your REST command would also need to include the command somewhere.