Takk for god instruksjon. Jeg har gjort dette litt anderledes, forslaget til @SaGe betyr at alle sensorene har status "ok" og verdien ligger i en attribute, jeg har lagt inn følgende som gir meg verdiene rett i entity:
rest:
- scan_interval: 30
method: GET
resource: https://api.myuplink.com/v2/devices/HOIAX_[bytt_meg_ut]/points
headers:
Authorization: >
Bearer {{ states.sensor.myuplink_token.attributes["access_token"] }}
sensor:
- name: "myUplink Stored Energy"
unique_id: "myuplink_stored_energy"
json_attributes_path: "$.[?(@.parameterId=='302')]"
value_template: "{{ value_json|selectattr('parameterId','eq','302')|map(attribute='value')|first }}"
unit_of_measurement: "kWh"
- name: "myUplink Total energy used"
unique_id: "myuplink_total_energy_used"
json_attributes_path: "$.[?(@.parameterId=='303')]"
value_template: "{{ value_json|selectattr('parameterId','eq','303')|map(attribute='value')|first }}"
unit_of_measurement: "kWh"
- name: "myUplink Estimated Power"
unique_id: "myuplink_estimated_power"
json_attributes_path: "$.[?(@.parameterId=='400')]"
value_template: "{{ value_json|selectattr('parameterId','eq','400')|map(attribute='value')|first }}"
unit_of_measurement: "W"
- name: "myUplink Fill Level"
unique_id: "myuplink_fill_level"
json_attributes_path: "$.[?(@.parameterId=='404')]"
value_template: "{{ value_json|selectattr('parameterId','eq','404')|map(attribute='value')|first }}"
unit_of_measurement: "%"
- name: "myUplink Current Program"
unique_id: "myuplink_current_program"
json_attributes_path: "$.[?(@.parameterId=='406')]"
value_template: "{{ value_json|selectattr('parameterId','eq','406')|map(attribute='strVal')|first }}"
- name: "myUplink Element 2 Power"
unique_id: "myuplink_element_2_power"
json_attributes_path: "$.[?(@.parameterId=='503')]"
value_template: "{{ value_json|selectattr('parameterId','eq','503')|map(attribute='value')|first }}"
unit_of_measurement: "W"
- name: "myUplink Element 1 Power"
unique_id: "myuplink_element_1_power"
json_attributes_path: "$.[?(@.parameterId=='504')]"
value_template: "{{ value_json|selectattr('parameterId','eq','504')|map(attribute='value')|first }}"
unit_of_measurement: "W"
- name: "myUplink Element 2 Status"
unique_id: "myuplink_element_2_status"
json_attributes_path: "$.[?(@.parameterId=='505')]"
value_template: "{{ value_json|selectattr('parameterId','eq','505')|map(attribute='strVal')|first }}"
- name: "myUplink Element 1 Status"
unique_id: "myuplink_element_1_status"
json_attributes_path: "$.[?(@.parameterId=='506')]"
value_template: "{{ value_json|selectattr('parameterId','eq','506')|map(attribute='strVal')|first }}"
- name: "myUplink Time since last legionella prevention"
unique_id: "myuplink_time_since_legionella_prevention"
json_attributes_path: "$.[?(@.parameterId=='509')]"
value_template: "{{ value_json|selectattr('parameterId','eq','503')|map(attribute='value')|first }}"
unit_of_measurement: "h"
- name: "myUplink Next legionella prevention"
unique_id: "myuplink_next_legionella_prevention"
json_attributes_path: "$.[?(@.parameterId=='514')]"
value_template: "{{ value_json|selectattr('parameterId','eq','514')|map(attribute='value')|first }}"
unit_of_measurement: "h"
- name: "myUplink Selected Power"
unique_id: "myuplink_selected_power"
json_attributes_path: "$.[?(@.parameterId=='517')]"
value_template: "{{ value_json|selectattr('parameterId','eq','517')|map(attribute='strVal')|first }}"
- name: "myUplink Setpoint"
unique_id: "myuplink_setpoint"
json_attributes_path: "$.[?(@.parameterId=='527')]"
value_template: "{{ value_json|selectattr('parameterId','eq','527')|map(attribute='value')|first }}"
unit_of_measurement: "°C"
- name: "myUplink Temperature"
unique_id: "myuplink_temperature"
json_attributes_path: "$.[?(@.parameterId=='528')]"
value_template: "{{ value_json|selectattr('parameterId','eq','528')|map(attribute='value')|first }}"
unit_of_measurement: "°C"
- name: "myUplink Nordpool Price Region"
unique_id: "myuplink_nordpool_price_region"
json_attributes_path: "$.[?(@.parameterId=='544')]"
value_template: "{{ value_json|selectattr('parameterId','eq','544')|map(attribute='strVal')|first }}"
- name: "myUplink Current Price type"
unique_id: "myuplink_current_price_type"
json_attributes_path: "$.[?(@.parameterId=='549')]"
value_template: "{{ value_json|selectattr('parameterId','eq','549')|map(attribute='strVal')|first }}"
- name: "myUplink Current Target Temperature"
unique_id: "myuplink_current_target_temperature"
json_attributes_path: "$.[?(@.parameterId=='551')]"
value_template: "{{ value_json|selectattr('parameterId','eq','551')|map(attribute='value')|first }}"
unit_of_measurement: "°C"
Fra Swagger fant jeg ut om jeg ville benytte "value" eller "StrVal", sistnevnte er vennlig navn, f.eks. på element status.
Dette er kun les fra APIet, men fungerer bra for meg.
Jeg har slengt alt i en grid