MQTT light state issue

I have an issue with my light state is toggling back to off after using the light switch. But sensor that pulls the state value shows the correct state.

light:
  - platform: mqtt
    name: "Mqtt dimmer"
    schema: template
    command_topic: "zwave2mqtt/nodeID_2/38/6/0/set"
    state_topic: "zwave2mqtt/nodeID_2/32/1/0"
    command_on_template: >
      {"value": 255 }
    command_off_template: '{"value": 0}'
    state_template: "{{ value_json.value }}"
    qos: 1
    retain: false
sensor:
  - platform: mqtt
    name: Mqtt dimmer status
    state_topic: zwave2mqtt/nodeID_2/32/1/0
    unique_id: zwave2mqtt_nodeID_2_dimmer
    value_template: "{{ value_json.value }}"

State output from mqtt:

{
    "value_id": "2-32-1-0",
    "node_id": 2,
    "class_id": 32,
    "type": "byte",
    "genre": "basic",
    "instance": 1,
    "index": 0,
    "label": "Basic",
    "units": "",
    "help": "",
    "read_only": false,
    "write_only": false,
    "min": 0,
    "max": 255,
    "is_polled": false,
    "value": 99,
    "lastUpdate": 1610455967351
}

Entities turned off:
billede

Entities turned on:
billede

I think I have tried every possible combination of configuration and I am really stuck.
I can set the dimmming and turn on and off again if i am pressing the switch fast, but the switch is always return to off state.