Mercedes CLA key no longer works

Good evening. The key from my CLA 117 no longer works. The doors can no longer be opened and closed with the key. The ignition starts when I plug the key in and the engine starts perfectly. I tried it with my spare key, exactly the same problem. The start stuff button also no longer works, I get the message that the key is not recognized. Battery I also changed but did not do anything. I have to open and close the car with mobile phone. Does anyone know where the problem lies?