Template sensor with json and value template error

Hi

I’m trying to get my zigbee2tasmota tuya trv working in homeassistant. I try to read the valveposition, and try this, but I get an error:

Invalid config for [sensor.mqtt]: [value__template] is an invalid option for [sensor.mqtt]. Check: sensor.mqtt->value__template. (See ?, line ?).

This is my ocnfig

- platform: mqtt
  name: "tuyavalve"
  availability_topic: "z2t/tele/LWT"
  payload_available: "Online"
  payload_not_available: "Offline"
  json_attributes_topic: "tele/z2t/CB5D/SENSOR"
  json_attributes_template: >
    {% set properites = ["LocalTemperature", "TuyaTempTarget", "TuyaValvePosition", "LinkQuality", "TuyaAwayDays", "TuyaAutoLock", "TuyaAwayTemp", "TuyaScheduleHolidays", "TuyaScheduleWorkdays", "TuyaWeekSelect", "TuyaEcoTemp", "TuyaComfortTemp", "TuyaForceMode", "TuyaBoostTime", "TuyaChildLock", "TuyaPreset", "TuyaMinTemp", "TuyaMinTemp", "Manufacturer", "ModelId", "EF00<11", "EF00<24", "EF00/022C", "EF00/050D"] %}
    {%- set json_template -%}
      {
        {%- for key in properites -%}
          "{{key}}": "{{ value_json.ZbReceived['0xCB5D'][key] | default(state_attr('sensor.tuyavalve',key)) }}"{% if not loop.last %},{% endif %}        
        {%- endfor -%}
      }
    {%- endset -%}
    {{ json_template  }}     
  state_topic: "tele/z2t/CB5D/SENSOR"
  value__template: >
    {% if value_json.ZbReceived['0xCB5D'].TuyaValvePosition is defined %}
      {{ value_json.ZbReceived['0xCB5D'].TuyaValvePosition }}
    {% else %}
      {{ state_attr('sensor.tuyavalve','TuyaValvePosition') }}
    {% endif %}

the data i get from zigbee2tasmota

22:24:30 MQT: tele/z2t/CB5D/SENSOR = {"ZbReceived":{"0xCB5D":{"Device":"0xCB5D","Name":"zolderradiator","TuyaValvePosition":60,"Endpoint":1,"LinkQuality":76}}} (retained)
value__template: >
      ^
      |

There should be only one underscore character between the words value and template. You have two. Delete one and it will eliminate the error.

thnx, now it works