je galère grave pour intégrer mes 2 onduleurs. Je me base sur ce post : https://community.home-assistant.io/t/pv-solax-inverter-cloud-sensors-via-api/277874/35
Mais je ne sais pas ou mettre ce code :
## X3 ##
- platform: rest
resource: https://www.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=202102060300yyyyyyy&sn=SWXXXXXXX
name: "Solax X3"
json_attributes_path: "$.result"
json_attributes:
- yieldtoday
- yieldtotal
- acpower
- uploadTime
- inverterStatus
value_template: '1' # dummy value, not used; avoids the "State max length is 255 characters" error
- platform: template
sensors:
solax_x3_today:
friendly_name: "Solax X3 today"
value_template: "{{ state_attr('sensor.solax_x3', 'yieldtoday') }}"
unit_of_measurement: "KWh"
solax_x3_total:
friendly_name: "Solax X3 total"
value_template: "{{ state_attr('sensor.solax_x3', 'yieldtotal') }}"
unit_of_measurement: "KWh"
solax_x3_now:
friendly_name: "Solax X3 now"
value_template: "{{ state_attr('sensor.solax_x3', 'acpower') }}"
unit_of_measurement: "W"
solax_x3_upload_time:
friendly_name: "Solax X3 upload time"
value_template: "{{ state_attr('sensor.solax_x3', 'uploadTime') }}"
solax_x3_status:
friendly_name: "Solax X3 status"
value_template: >
{% if state_attr('sensor.solax_x3', 'inverterStatus') == '100' %}Wait
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '101' %}Check
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '102' %}Normal
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '103' %}Fault
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '104' %}Permanent Fault
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '105' %}Update
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '106' %}EPS Check
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '107' %}EPS
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '108' %}Self-test
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '109' %}Idle
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '110' %}Standby
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '111' %}Pv Wake Up Bat
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '112' %}Gen Check
{% elif state_attr('sensor.solax_x3', 'inverterStatus') == '113' %}Gen Run
{% else %}I dont know{% endif %}
## X1 ##
- platform: rest
resource: https://www.eu.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=20210517200601yyyyyyyyyyyy&sn=SWXXXXXXXXX
name: "Solax X1"
json_attributes_path: "$.result"
json_attributes:
- yieldtoday
- yieldtotal
- acpower
- uploadTime
- inverterStatus
value_template: '1' # dummy value, not used; avoids the "State max length is 255 characters" error
- platform: template
sensors:
solax_x1_today:
friendly_name: "Solax X1 today"
value_template: "{{ state_attr('sensor.solax_x1', 'yieldtoday') }}"
unit_of_measurement: "KWh"
solax_x1_total:
friendly_name: "Solax X1 total"
value_template: "{{ state_attr('sensor.solax_x1', 'yieldtotal') }}"
unit_of_measurement: "KWh"
solax_x1_now:
friendly_name: "Solax X1 now"
value_template: "{{ state_attr('sensor.solax_x1', 'acpower') }}"
unit_of_measurement: "W"
solax_x1_upload_time:
friendly_name: "Solax X1 upload time"
value_template: "{{ state_attr('sensor.solax_x1', 'uploadTime') }}"
solax_x1_status:
friendly_name: "Solax X1 status"
value_template: >
{% if state_attr('sensor.solax_x1', 'inverterStatus') == '100' %}Wait
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '101' %}Check
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '102' %}Normal
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '103' %}Fault
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '104' %}Permanent Fault
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '105' %}Update
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '106' %}EPS Check
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '107' %}EPS
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '108' %}Self-test
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '109' %}Idle
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '110' %}Standby
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '111' %}Pv Wake Up Bat
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '112' %}Gen Check
{% elif state_attr('sensor.solax_x1', 'inverterStatus') == '113' %}Gen Run
{% else %}I dont know{% endif %}
Si je l’intègre au fichier « configuration.yaml », j’ai ces erreurs =
Configuration non valide !
Erreurs de configuration
Error loading /config/configuration.yaml: while parsing a block mapping
in "/config/configuration.yaml", line 3, column 1
expected <block end>, but found '-'
in "/config/configuration.yaml", line 14, column 1