Hello Everyone,
For all of you that are struggling with the incapacity of getting all the information from your Solax Solar Painel, here is a help, as for all I can see, I can’t find a X1 Hybrid G4, so here it is adjusted and getting all possible info from the rest api, and the energy sensor to add in the energy dashboard.
In the sensor.yaml add the next sensors:
###################################
# Solax X1 Hybrid G4 Rest Sensors #
###################################
# Solax Inverter Serial Number
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ value_json.result.inverterSN }}'
name: "Solax Inverter SN"
# Solax Dongle Serial Number
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ value_json.result.sn }}'
name: "Solax Dongle SN"
# Energy Being Produced Now
- platform: rest
scan_interval: 60
resource: !secret solax_api
value_template: '{{ ( value_json.result.acpower | round(1) ) }}'
name: "Solax Now"
unit_of_measurement: "W"
# Energy Produced Today - Used With Energy Template
- platform: rest
scan_interval: 60
resource: !secret solax_api
value_template: '{{ ( value_json.result.yieldtoday | round(2) ) }}'
name: "Solax Today"
unit_of_measurement: "KWh"
# Energy Produced Since Installation Date (2022.10.10)
- platform: rest
scan_interval: 60
resource: !secret solax_api
value_template: '{{ ( value_json.result.yieldtotal | round(1) ) }}'
name: "Solax Total"
unit_of_measurement: "KWh"
# Solax Feedin Power (Not in Use)
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ ( value_json.result.feedinpower | round(2) ) }}'
name: "Solax Feedin Power"
unit_of_measurement: "W"
# Solax Feedin Energy
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ ( value_json.result.feedinpenergy | round(2) ) }}'
name: "Solax Feedin Energy"
unit_of_measurement: "W"
# Solax Consume Energy
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ ( value_json.result.consumeenergy | round(2) ) }}'
name: "Solax Consume Energy"
unit_of_measurement: "W"
# Solax Feedin Power M2 (Not in Use)
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ ( value_json.result.feedinpowerM2 | round(2) ) }}'
name: "Solax Feedin Power M2"
unit_of_measurement: "W"
# Solax Battery SOC Threshold (Not in Use)
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ ( value_json.result.soc | round(2) ) }}'
name: "Solax Battery SOC Threshold"
unit_of_measurement: "W"
# Solax Photovoltaic Electric Power Systems 1
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ ( value_json.result.peps1 | round(2) ) }}'
name: "Solax Photovoltaic Electric Power Systems 1"
unit_of_measurement: "W"
# Solax Photovoltaic Electric Power Systems 2 (Not in Use)
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ ( value_json.result.peps2 | round(2) ) }}'
name: "Solax Photovoltaic Electric Power Systems 2"
unit_of_measurement: "W"
# Solax Photovoltaic Electric Power Systems 3 (Not in Use)
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ ( value_json.result.peps3 | round(2) ) }}'
name: "Solax Photovoltaic Electric Power Systems 3"
unit_of_measurement: "W"
# Solax Inverter Type
- platform: rest
scan_interval: 60
resource: !secret solax_api
value_template: >
{% if value_json.result.inverterType == '1' %}X1-LX
{% elif value_json.result.inverterType == '2' %}X-Hybrid
{% elif value_json.result.inverterType == '3' %}X1-Hybiyd/Fit
{% elif value_json.result.inverterType == '4' %}X1-Boost/Air/Mini
{% elif value_json.result.inverterType == '5' %}X3-Hybiyd/Fit
{% elif value_json.result.inverterType == '6' %}X3-20K/30K
{% elif value_json.result.inverterType == '7' %}X3-MIC/PRO
{% elif value_json.result.inverterType == '8' %}X1-Smart
{% elif value_json.result.inverterType == '9' %}X1-AC
{% elif value_json.result.inverterType == '10' %}A1-Hybrid
{% elif value_json.result.inverterType == '11' %}A1-Fit
{% elif value_json.result.inverterType == '12' %}A1-Grid
{% elif value_json.result.inverterType == '13' %}J1-ESS
{% elif value_json.result.inverterType == '14' %}X3-Hybrid G4
{% elif value_json.result.inverterType == '15' %}X1-Hybrid G4
{% else %}Unkown Type{% endif %}
name: "Solax Type"
# Solax Inverter Status
- platform: rest
scan_interval: 60
resource: !secret solax_api
value_template: >
{% if value_json.result.inverterStatus == '100' %}Wait
{% elif value_json.result.inverterStatus == '101' %}Check
{% elif value_json.result.inverterStatus == '102' %}Normal
{% elif value_json.result.inverterStatus == '103' %}Fault
{% elif value_json.result.inverterStatus == '104' %}Permanent Fault
{% elif value_json.result.inverterStatus == '105' %}Update
{% elif value_json.result.inverterStatus == '106' %}EPS Check
{% elif value_json.result.inverterStatus == '107' %}EPS
{% elif value_json.result.inverterStatus == '108' %}Self-test
{% elif value_json.result.inverterStatus == '109' %}Idle
{% elif value_json.result.inverterStatus == '110' %}Standby
{% elif value_json.result.inverterStatus == '111' %}Pv Wake Up Bat
{% elif value_json.result.inverterStatus == '112' %}Gen Check
{% elif value_json.result.inverterStatus == '113' %}Gen Run
{% else %}Unkown Status{% endif %}
name: "Solax Status"
# Last Update Made Successufly
- platform: rest
scan_interval: 60
resource: !secret solax_api
value_template: "{{ value_json.result.uploadTime }}"
name: "Solax Upload Time"
# Solax Battery Power (Not in Use)
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ ( value_json.result.batPower | round(2) ) }}'
name: "Solax Battery Power"
unit_of_measurement: "W"
# Solax PV 1 Production
- platform: rest
scan_interval: 60
resource: !secret solax_api
value_template: '{{ ( value_json.result.powerdc1 | round(1) ) }}'
name: "Solax PV 1"
unit_of_measurement: "W"
# Solax PV 2 Production (Not in Use)
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ ( value_json.result.powerdc2 | round(1) ) }}'
name: "Solax PV 2"
unit_of_measurement: "W"
# Solax PV 3 Production (Not in Use)
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ ( value_json.result.powerdc3 | round(1) ) }}'
name: "Solax PV 3"
unit_of_measurement: "W"
# Solax PV 4 Production (Not in Use)
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: '{{ ( value_json.result.powerdc4 | round(1) ) }}'
name: "Solax PV 4"
unit_of_measurement: "W"
# Solax Battery Status (Don't have a Battery)
- platform: rest
scan_interval: 300
resource: !secret solax_api
value_template: >
{% if value_json.result.batStatus == '0' %}Self Use Mode
{% elif value_json.result.batStatus == '1' %}Force Time Use
{% elif value_json.result.batStatus == '2' %}Back Up Mode
{% elif value_json.result.batStatus == '3' %}Feed-in Priority
{% else %}Unkown Status{% endif %}
name: "Solax Battery Status"
I’ve chosen to divide the energy sensors from the rest ones, so, in the templates.yaml add the energy sensor (I’ve added 2 one for total and one for daily producing for check, but either one works for the energy dashboard monitorization):
#####################################
# Solax X1 Hybrid G4 Energy Sensors #
#####################################
# Total Energy from the installation date (2022.10.10)
- sensor:
- name: energy_total
state: "{{ states('sensor.solax_total')}}"
unit_of_measurement: "kWh"
state_class: total_increasing
device_class: energy
attributes:
last_reset: '2000-01-01T00:00:00+00:00'
# Energy Today
- name: power_today
state: "{{ states('sensor.solax_today')}}"
unit_of_measurement: "kWh"
state_class: total_increasing
device_class: energy
attributes:
last_reset: '2000-01-01T00:00:00+00:00'
If you don’t feel comfortable to change the inserted configuration and want to add it like it is for you, just add a secret.yaml file and inside add this line:
# Solax X1 Hybrid G4
solax_api: https://www.solaxcloud.com/proxyApp/proxy/api/getRealtimeInfo.do?tokenId=YYYYYYYYYYYYYYYYYYYY&sn=XXXXXXXXXX
Change the YYYYYYYYYYYYYYYYYYYY with your solax tokenID ( you can check it here: Solax Cloud System
Change the XXXXXXXXXX with your Solax Dongle SN (you can confirm it in the dongle itself or in the solaxcloud: Solax Cloud System) It’s the one on the right of the Inverter Serial Number.
As always this message will be auto destroyed after you read it
From all I’ve read and searched the informations I’ve added is from all Solax systems I’ve drove thru , so iff you have more just add to this and enjoy it.
The read time I’ve added is for my installation, so you probably want to change it for yours.
Don’t do request lower than 60 seconds, as the system can or will block.
For the ones that won’t change much I’ve chose to use the 120 seconds.
For those that I don’t have, and so no information from it, or that never change, like serials, I’ve used 300 seconds. You can remove them or just increase the time of them.
Hopefully, soon, there will be a change in the Solax Power integration which makes it so more easy to work with, for all that are not in the programming world, and even so love to enjoy Home Assistant as users.
Greetings and Happy New Year.