Problem with home assistant configuration

Hi all, I’m new in rhasspy. I’ve made in home assistant this automation to use the rhasspy tts

  • id: Rhasspy GetTime
    alias: Rhasspy GetTime
    mode: single
    • platform: event
      event_data: {}
      event_type: rhasspy_GetTime
    • service: mqtt.publish
      topic: hermes/dialogueManager/endSession
      payload_template: ‘{“sessionId”: “{{ }}”, “text”: “It’s {{ states(‘entity.current_time’) }}”}’
      mode: single
      But I got this error
      bad indentation of a mapping entry (583:114)

580 | …
581 | …
582 | …
583 | … , “text”: “It’s {{ states(‘entity.current_time’) }}”}’
584 | …
How can I fix this?

Hi Mark,
First, when you post code, particularly code that is “space sensitive” like YAML, if you enclose your code, starting with a line of the three “back tics” or “`” and end with a line of three “back tics” all of the spacing will show correctly. Anyway, here’s an automation, (and you have configured Rhasspy to send events to HA, correct?) that I use for time. You’ll need to change sensor in the last line, I use a sensor I made that has AM/PM.

Hope this helps!

- id: '123456655'
  alias: Rhasspy-GetTime
  description: ''
  - platform: mqtt
    topic: hermes/intent/GetTime
  condition: []
  - service: mqtt.publish
      qos: 0
      retain: false
      topic: hermes/dialogueManager/endSession
      payload_template: '{"siteId": "{{ trigger.payload_json.siteId }}", "sessionId":
        "{{ trigger.payload_json.sessionId }}", "text": "It is ({{states("sensor.simple_time")}})"}'
  mode: single