where you read a key in the object named "devices", followed by the first element in the list (indicated by the square brackets), etc. I didn’t test this and you may need extra logic in case you don’t get a successful response.
Also keep in mind if you don’t get the exact same schema JSON that you’ve provided the template could fail in different ways. Without seeing what that could be, I can’t help with that part. You’re welcome to send that.
Then, check the section on “processing incoming data” here. There’s example code right at the end that you can use and take your JSON to experiment with it in the template editor of HA.
Thank you for your help… What is strange is that I am not getting any error message… Just the state of the entity is “unknown”… I tried different alternatives with various fields: “lastseen”, “t1”, “t2” and for each I am getting a “unknown” state… I will investigate your recommendation and try to use the developer tools as well to debug…