Importing JSON entities with _ fails


I need to import several data fields from a REST Api that delivers a JSON dataset. This is my first attempt with REST and JSON so sorry if what I ask seems like a stupid mistake. I tried to follow the documentation and did not find any similar problems, so I guess I am overlooking something obvious.

The issue is: I can import any data record that has a single word label like range or level. I can not for the life of me import any label with an underscore like charging_status . And I don‘t get the reason for this. Any help is appreciated.

My config:

This is how the source looks in the parser:

This is the result of both sensors:

If I change the second entry to range, I get good data. But i need charging_state. Any help is appreciated.

That certainly looks like it should work. Any errors/warnings in the logs?

@PeteRage I was about to say no, but found one on the second attempt. I don’t know what to make of this, though. The name seems correct to me. From what I read, an underscore is a legit character in JSON labels. I can’t change it anyway, the API is from a commercial provider.

That error say the data element is not in the json response.

You could try shortening the expression to the battery that should then dump out all the attributes underneath battery.

It appears the API is not returning that JSON element.

Actually, yes. I found that the HA server gets a shorter answer than I get in the browser. My browser gets more data fromthe same request than HA and curl. I asked the service provider how to achieve the same result. Thanks for your help :slight_smile: