Issues with Automation Parsing MQTT json Value

Hi, I am having issues with an automation that i have created to capture mqtt messages and republish them.

the automation is:

trigger:
  - platform: mqtt
    topic: 475/NM7-US-HGA8103A/status/current
condition:
  - condition: template
    value_template: >-
      {{ trigger.payload_json.msg == "CURRENT-STATE" }}
action:
  - service: mqtt.publish
    data:
      topic: DYSON/Master_Bedroom
      payload_template: |-
        {% if trigger.payload_json.["product-state"].fmod == "FAN" %}
          {"fan":"off","speed":"0","oscillation":"off" }
        {% elif trigger.payload_json.["product-state"].fmod == "OFF" %}
          {"fan":"off","speed":"0","oscillation":"off" }
        {% endif %}
      qos: '0'
      retain: true
mode: queued
max: 10

and the feeding mqtt string is

475/NM7-US-HGA8103A/status/current {"msg":"STATE-CHANGE","time":"2021-03-05T17:52:19.002Z","mode-reason":"LAPP","state-reason":"MODE","product-state":{"fmod":["FAN","OFF"],"fnst":["FAN","OFF"],"fnsp":["0004","0004"],"qtar":["0003","0003"],"oson":["OFF","OFF"],"rhtm":["ON","ON"],"filf":["0000","0000"],"ercd":["NONE","NONE"],"nmod":["OFF","OFF"],"wacd":["FLTR","FLTR"]},"scheduler":{"srsc":"49c6","dstv":"0001","tzid":"0001"}}

i suspect its not properly addressing the product-state.fmod value but having a hell of a time figuring this out

@123
Thanks for the quick turn around.

When I try to save with the changes, it throws s
Message malformed: invalid template (TemplateSyntaxError: expected name or number) for dictionary value @ data['action'][0]['data']

trigger:
  - platform: mqtt
    topic: 475/NM7-US-HGA8103A/status/current
condition:
  - condition: template
    value_template: >-
      {{ trigger.payload_json.msg == "CURRENT-STATE" }}
action:
  - service: mqtt.publish
    data:
      topic: DYSON/Master_Bedroom
      payload_template: |-
        {% if trigger.payload_json.["product-state"].fmod[0] == "FAN" %}
          {"fan":"off","speed":"0","oscillation":"off" }
        {% elif trigger.payload_json.["product-state"].fmod[0] == "OFF" %}
          {"fan":"off","speed":"0","oscillation":"off" }
        {% endif %}
      qos: '0'
      retain: true
mode: queued
max: 10

figured it out. no period between json and [“product-state”]

correct. This is catching status updates from a dyson fan. their cloud interface keeps changing so im moving away from it for local control

It can simplify it, but I am expanding it to include oscillation state, speed, env sensors etc, which are easier to account for in the action as an if statement