Hi there,
Im really frustrated on the following topic. I have got a Kostal Pico and with the following URL:
http://xxx.xxx.xxx.xxx/api/dxs.json?dxsEntries=67109120&dxsEntries=83886848
I get the following JSON reply:
{
"dxsEntries": [
{
"dxsId": 67109120,
"value": 987.462402
},
{
"dxsId": 83886848,
"value": 0.000000
}
],
"session": {
"sessionId": 0,
"roleId": 0
},
"status": {
"code": 0
}
}
A single value I get with the following:
- platform: rest
resource: http://192.168.1.13/api/dxs.json?dxsEntries=67109120
name: "Netz Ausgangsleistung"
value_template: "{{ value_json.dxsEntries[0].value | float | round(0) }}"
unit_of_measurement: "W"
This works. But I want all X value, which I can append in the resource url at once
I tried the following to get the values out (there is no login needed so I removed the username and password):
rest:
- authentication: basic
username: ""
password: ""
resource: http://192.168.1.13/api/dxs.json?dxsEntries=67109120&dxsEntries=83886848&dxsEntries=83886336&dxsEntries=251658754&dxsEntries=67109120
scan_interval: 10
sensor:
- name: kostal_netz_ausgangsleistung
json_attributes_path: "$.dxsEntries[0].value"
device_class: power
unit_of_measurement: "W"
- name: kostal_akt_verbrauch_aus_pv
json_attributes_path: "$.dxsEntries[1].value"
device_class: power
unit_of_measurement: "W"
Alternative which also didn’t work:
sensor:
- platform: rest
name: kostal_pico
resource: http://xxx.xxx.xxx.xxx/api/dxs.json?dxsEntries=67109120&dxsEntries=83886848
json_attributes_path: "$"
- platform: template
sensors:
sensor1whatever:
value_template: "{{ state_attr('sensor.kostal_pico', 'dxsEntries[0].value')}}"
device_class: power
unit_of_measurement: "W"