Cemm, how to retrieve json information

Hi, I tried to retrieve the information from my Cemm. When I read I get the next: (example)
“data”: {

I try to make graphs from this information

My configuration file currently is:


  • authentication: basic
    resource: “http://x.x.x.x/open-api/v1/p1/realtime/
    • name: “t1”
      json_attributes_path: $.data.t1[1]
    • name: “t2”
      json_attributes_path: $.data.t2.[1]
    • name: “t3”
      json_attributes_path: $.data.t3.[1]
    • name: “t4”
      json_attributes_path: $.data.t4.[1]

Then I have an entity with the next attributes
t1: 1670878578000, 1090.47
t2: 1670878578000, 858.08
t3: 1670878578000, 1219.97
t4: 1670878578000, 2697.32
friendly_name: cemm

I am not succesfull in selecting de second value only in the list.
The list attribus list must be:
t1: 1090.47
t2: 858.08
t3: 1219.97
t4: 2697.32
friendly_name: cemm

After then I hope I can see the graphs.
Does anybody know how to do?

Hi there, can you check the sample json uploaded. It has some formatting issues. Also please paste the json between ``` to show it as code.

Hi this is the string I received from a http:

The code I am currente use is:

  - platform: rest
    name: cemm
    resource: "http://x.x.x.x/open-api/v1/p1/realtime/"
    value_template: "{{ value_json.data }}"
    json_attributes_path: $.data
      - t1
      - t2
      - t3
      - t4

As i check the shared json is not formatted correct.

Hi, I cannot do something the device give me… So, if I understand you, I cannot retrieve the information with json. Correct?

since this is not a json, it wont be possible to use value_json in value_template.
If you are using node red, it would be easy for you to extract data than using various templates in HA.

I take a look at node-red, but I also did not come further.

But I think I am successfull with the next code, because it is running now and I can create a graph.
The fact that I can create a graph is because of the “device_classs: energy”

- platform: rest
  name: cemm_huidige_energie_afname
  device_class: energy
  unit_of_measurement: W
  resource: "http://x.x.x.x/open-api/v1/p1/realtime/"
  value_template: "{{states.sensor.cemm_huidige_energie_afname.attributes.electric_power[1]}}"
  json_attributes_path: $.data
    - electric_power

Now I will find out if I can update the polling time.