Hi,
I try to setup MQTT json attribute template as below. The value template returns correct value but I could not get attribute in json format even with dumb texts. It returns error message Erroneous JSON: { “test”: ok, “verify”: fail }.
Btw, is there any way to debug MQTT sensor without restarting HA or reloading MQTT.yaml ? Similar to Developer tools/Template tab, I can wonder if I can send MQTT payload and get returned value_template/ json_attributes_template result
- name: "Timestamp_raw"
state_topic: "5a1b33a2bc/events/rpc"
value_template: "{{ value_json.params.ts}}"
unique_id: "TimeStamp_raw"
json_attributes_topic: "5a1b33a2bc/events/rpc"
json_attributes_template: >
{ "test": {{"ok"}},
"verify": {{"fail"}} }