Hi,
As I’m trying to get data from my SolarEdge API and want some automation based on the resulting data.
first. How can I set a state of the sensor?
- platform: rest
name: solar_inverter
method: GET
scan_interval: 1200
#value_template: '{{ value_json.data.telemetries[0].inverterMode }}'
#value_template: '{{ value_json.data.telemetries[0].L1Data.acVoltage }}'
#value_template: '{{ value_json.data.count }}'
value_template: '{{ value_json.value }}'
json_attributes:
#- data
#- data.telemetries[0].inverterMode
#- data.telemetries[0].L1Data.acVoltage
resource_template: >-
{% if is_state('sun.sun','above_horizon') %}
{% set endTime = (as_timestamp(now()) - (60)) | timestamp_custom('%Y-%m-%d %H:%M:00') %}
{% set startTime = (as_timestamp(now()) - (420)) | timestamp_custom('%Y-%m-%d %H:%M:00') %}
https://monitoringapi.solaredge.com/equipment/abc/123/data.json?startTime={{startTime}}&endTime={{endTime}}&api_key=XXXXX
{% else %}
'Sleep Mode'
{% endif %}
Am I doing this the right way?
I’m only interested in the specific data to set a status (based on a combination ) and trigger an alarm if something is wrong. How do I get this specific data? (I tried combination as remarked lines above, buit without the expected results)
thx in advance