Hi, a year later allready, but as the sun in shining more and more (and the neighbours all added solarpanels) I’m extra curious in the voltage on the inverter.
Dumbass me just left the <> in the siteId/API key code, instead of just the number. With that fixed I can manually call the URL and see the data.
But still the sensor says “Unavailable”.
Any suggestions?
With this URL:
https://monitoringapi.solaredge.com/equipment/297####/740A####-##/data.json?startTime=2023-05-14%2000:00:00&endTime=2023-05-14%2023:00:00&api_key=72LVMXXXXXXXXXXXX
I get this data:
{"data":{"count":103,"telemetries":[{"date":"2023-05-14 00:02:44","totalActivePower":0.0,"dcVoltage":20.0976,"groundFaultResistance":11000.0,"powerLimit":100.0,"totalEnergy":2699580.0,"temperature":28.3454,"inverterMode":"MPPT","operationMode":0,"L1Data":{"acCurrent":0.0,"acVoltage":237.798,"acFrequency":49.9327,"apparentPower":0.0,"activePower":0.0,"reactivePower":0.0,"cosPhi":0.0}},{"date":"2023-05-14 00:07:44","totalActivePower":0.0,"dcVoltage":20.0994,"groundFaultResistance":11000.0,"powerLimit":100.0,"totalEnergy":2699580.0,"temper
The “rest” code in configuration.yaml (I changed the scan interval to every 10seconds to get faster results while testing)
rest:
- scan_interval: 00:00:10
method: GET
resource_template: https://monitoringapi.solaredge.com/equipment/297#####/740A####-##/data.json?startTime={{ (now() - timedelta(minutes = 15)).strftime('%Y-%m-%d %H:%M:%S') }}&endTime={{ now().strftime('%Y-%m-%d %H:%M:%S')}}&api_key=72LVMKBO5IJ9XXXXXXXXXXXXX
sensor:
name: 'SolarEdge Current Data'
value_template: '{{ value_json.data.count }}'
json_attributes_path: "$.data"
json_attributes:
- "telemetries"
Sensor Code:
template:
- sensor:
- name: "SolarEdge Voltage"
unique_id: solaredge_voltage
state: |
{% set cur = state_attr('sensor.solaredge_current_data', 'telemetries')[states('sensor.solaredge_current_data') | int -1] %}
{{ [float(cur.L1Data.acVoltage), float(cur.L2Data.acVoltage), float(cur.L3Data.acVoltage)] | max | round(1) }}
attributes:
Date: "{{ state_attr('sensor.solaredge_current_data', 'telemetries')[states('sensor.solaredge_current_data') | int -1].date }}"
"Line 1": "{{ state_attr('sensor.solaredge_current_data', 'telemetries')[states('sensor.solaredge_current_data') | int -1].L1Data.acVoltage | float | round(1) }} V"
"Line 2": "{{ state_attr('sensor.solaredge_current_data', 'telemetries')[states('sensor.solaredge_current_data') | int -1].L2Data.acVoltage | float | round(1) }} V"
"Line 3": "{{ state_attr('sensor.solaredge_current_data', 'telemetries')[states('sensor.solaredge_current_data') | int -1].L3Data.acVoltage | float | round(1) }} V"
icon: >
{% set cur = state_attr('sensor.solaredge_current_data', 'telemetries')[states('sensor.solaredge_current_data') | int -1] %}
{% set v = [float(cur.L1Data.acVoltage), float(cur.L2Data.acVoltage), float(cur.L3Data.acVoltage)] | max %}
{% if v >= 253 %}
mdi:flash-off
{% elif v >= 250 %}
mdi:flash-alert
{% else %}
mdi:flash
{% endif %}
device_class: voltage
state_class: measurement
unit_of_measurement: V