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.