#Dump TTS messages to device

1 messages · Page 1 of 1 (latest)

jade cedar
#

Looking at some rest_command examples not sure how to parse the say_text?text=" into template values?

Working code so far...

configuration.yaml

rest_command:
  assume_behavior_control:
    url: 'http://10.0.0.111:8080/api-sdk/assume_behavior_control?priority=high&serial=00######'
    method: 'get'
  say_text:
    url: 'http://10.0.0.111:8080/api-sdk/say_text?text={{ states("input_text.your_text") }}&serial=00######'
    method: 'get'
  release_behavior_control:
    url: 'http://10.0.0.111:8080/api-sdk/release_behavior_control?priority=high&serial=00######'
    method: 'get'

Automation

alias: Vector Speech
description: Send text to Vector URL
trigger:
  - type: opened
    platform: device
    device_id: somedevice
    entity_id: someentity
    domain: binary_sensor
condition: []
action:
  - service: rest_command.assume_behavior_control
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: input_text.set_value
    data:
      value: Your family room lights are off
    target:
      entity_id: input_text.your_text
  - service: rest_command.say_text
    data: {}
  - delay: "00:00:10"
  - service: rest_command.release_behavior_control
    data: {}
mode: single

input_text.your_text helper

Name: your_text
Maximum length: 255
Entity ID: input_text.your_text

The return of this command is just success it's not json related just need to dump text to the url.