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
    trigger:
    • platform: event
      event_data: {}
      event_type: rhasspy_GetTime
      action:
    • service: mqtt.publish
      data:
      topic: hermes/dialogueManager/endSession
      payload_template: ‘{“sessionId”: “{{ trigger.event.data._intent.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: ''
  trigger:
  - platform: mqtt
    topic: hermes/intent/GetTime
  condition: []
  action:
  - service: mqtt.publish
    data:
      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
1 Like