Assistant Relay to Pass Sensor Data Through Command

Since my Tuya lights register as switches through the Tuya integration, I’m trying to set up dummy lights to be tracked and transmit the data through Assistant Relay as Google Assistant recognizes the lights correctly. I have set up the on and off using input boolens as the triggers for automation but I am unable to get the brightness to transfer. I am using a sensor to trigger the automation but my command won’t work.

command: 'Set Master Bedroom lights to "{{ sensor.masterbedroom_brightness | int }}" '

Is there any way to use variables in the command line to have Assistant Relay recieve a number to achieve this?

1 Like

Hello @Br00klynballin,

You can make this happen by using “data_template” that process the template information before sending it to the relay service.

See below automation action based on your example:

  - service: rest_command.assistant_relay
    data_template:
      command: 'Set Master Bedroom lights to "{{ sensor.masterbedroom_brightness | int }}" '