Any owners of Q Cells Q.Volt Hybrid Inverters?

It might be trying to hit Max DoD (depth of discharge).

DoD describes the degree to which a battery is emptied relative to it’s total capacity.

Your system has a maximum DoD of 90% meaning it must leave at least 10% capacity to avoid damaging the cells.
Looking at the graph you posted, your power usage is just short of 90% before it starts charging again, hence the inverter uses voodoo, magic, electronics, etc to finish the job.

Maybe.

Thanks for your reply.
I’m not quite sure if this is the DoD but I think yes.
These are my settings:
image

Ans that’s what I can observe. It is charging until 100% and discharges during the night until 10% (well after a following day with cliuds only I have even seen 5%).

The problem is that it gets discharged between 45% and 20% much faster for no obvious reason.

Rest API for Quells Q.HOME ESS+ HYB G3 rsp. SOLAX X3 G4:

After a lot of research and reading forum contributions I’ll summarize my findings here:

The sensor values are gotten by calling:

http://<ip>/optType=ReadRealTimeData&pwd=<password>

where ìp is the IP address of the WIFI adapter and password is the serial number of the WIFI adapter.

This litte Ruby program documents the sensor value positions and it’s interpretation.

#!/usr/bin/ruby
# Extract and explain the status data from the Solax X3 G4 Hybrid inverter using the WiFI adapter
# This inverter is also branded as QCells Q.HOME+ ESS HYB-G3
# Peter Ramm, 2023-11-23

require 'net/http'
require 'uri'
require 'json'

puts "\nexplain_solax_x3_g4.rb, Peter Ramm, 2023-11-23"
puts "All attributes whose interpretation is known or which have a value other than 0 or 1 are displayed.\n\n"

# Check if there are any command line arguments
if ARGV.empty? || ARGV.count != 2
  puts "Error: Exactly two paramaters are required: <IP address> <serial number>"
  exit 1
end

ip_address    = ARGV[0]
serial_number = ARGV[1]

puts "Time                : #{Time.now}\n"
puts "IP address          : #{ip_address}\n"
puts "WiFi serial number  : #{serial_number}\n"


# Set the URL of the endpoint you want to send the POST request to
url = URI.parse("http://#{ip_address}/")

# Create a new HTTP POST request
request = Net::HTTP::Post.new(url.path)

# Set the request body if needed
request.body = "optType=ReadRealTimeData&pwd=#{serial_number}"

# Set any additional headers if required
request['Content-Type'] = 'application/x-www-form-urlencoded'

# Send the POST request
response = Net::HTTP.start(url.host, url.port, use_ssl: url.scheme == 'https') do |http|
  http.request(request)
end

# Print the response
body = JSON.parse(response.body)
@data = body['Data']
info = body['Information']

puts "Firmware version    : #{body['ver']}\n"
puts "Inverter max. power : #{info[0]} KW\n\n"
puts "Inverter serial no. : #{info[2]}\n\n"
puts "Data attributes     :\n"
puts "---------------------------------------------\n"

def to_signed16(val)
  val -= 2**16 if val > 32767
  val
end

def to_signed32(val)
  val -= 2**32 if val > 2147483647
  val
end

def print(index, raw, parsed, unit, name)
  puts "#{index.to_s.rjust(3)}: #{raw.to_s.rjust(6)} #{parsed.to_s.rjust(8)} #{unit.ljust(4)} #{name}"
end

# print parsed value, unit and text representation of the response
def parse(index, divisor=nil, unit='', name = '', signed_16: false)
  raw = @data[index]
  raw = to_signed16(raw) if signed_16
  parsed = divisor.nil? ? nil : raw / divisor.to_f
  print(index, raw, parsed, unit, name) if name != '' || (raw != 0 && raw != 1)
end

def parse_32(index, divisor, low_value, high_value, unit, name, signed_32: false)
  raw = @data[index]
  sum = high_value * 2**16 + low_value
  sum = to_signed32(sum) if signed_32
  parsed = divisor.nil? ? nil : sum / divisor.to_f
  print(index, raw, parsed, unit, name) if name != '' || raw != 0
end

parse(0,  10, 'V', 'Inverter AC voltage phase 1')
parse(1,  10, 'V', 'Inverter AC voltage phase 2')
parse(2,  10, 'V', 'Inverter AC voltage phase 3')
parse(3,  10, 'A', 'Inverter AC current phase 1 (inaccurate)', signed_16: true)
parse(4,  10, 'A', 'Inverter AC current phase 2 (inaccurate)', signed_16: true)
parse(5,  10, 'A', 'Inverter AC current phase 3 (inaccurate)', signed_16: true)
parse(6,  1,  'W', 'Inverter AC power phase 1', signed_16: true)
parse(7,  1,  'W', 'Inverter AC power phase 2', signed_16: true)
parse(8,  1,  'W', 'Inverter AC power phase 3', signed_16: true)
parse(9,  1,  'W', 'Inverter AC power all phases, negativ = import from grid', signed_16: true)
parse(10, 10, 'V', 'PV1 Voltage')
parse(11, 10, 'V', 'PV2 Voltage')
parse(12, 10, 'A', 'PV1 Current')
parse(13, 10, 'A', 'PV2 Current')
parse(14, 1,  'W', 'PV1 Power')
parse(15, 1,  'W', 'PV2 Power')
parse(16, 100, 'Hz', 'Grid Frequency Phase 1')
parse(17, 100, 'Hz', 'Grid Frequency Phase 2')
parse(18, 100, 'Hz', 'Grid Frequency Phase 3')
parse(19, 1, '', 'Inverter Operation mode')
parse(20)
parse(21)
parse(22)
parse(23, 10, 'Y', 'EPS 1 Voltage')
parse(24, 10, 'Y', 'EPS 2 Voltage')
parse(25, 10, 'Y', 'EPS 3 Voltage')
parse(26, 10, 'A', 'EPS 1 Current', signed_16: true)
parse(27, 10, 'A', 'EPS 2 Current', signed_16: true)
parse(28, 10, 'A', 'EPS 3 Current', signed_16: true)
parse(29, 1, 'W', 'EPS 1 Power', signed_16: true)
parse(30, 1, 'W', 'EPS 2 Power', signed_16: true)
parse(31, 1, 'W', 'EPS 3 Power', signed_16: true)
parse(32)
parse(33)
parse_32(34, 1, @data[34], @data[35], 'W', 'Grid AC power: + export, - import', signed_32: true)
parse_32(35, 1, @data[34], @data[35], 'W', 'Grid AC power: + export, - import', signed_32: true)
parse(36)
parse(37)
parse(38)
parse(39, 100, 'V', 'Battery Voltage')
parse(40, 100, 'A', 'Battery Current, + charge, - discharge', signed_16: true)
parse(41, 1,   'W', 'Battery Power, + charge, - discharge', signed_16: true)
parse(42)
parse(43)
parse(44)
parse(45, 1, '', 'Battery BMS status (1=ok)')
parse(46, 1, '°C', 'Inverter inner temperature, 0 if shut off')
parse(47, 1, 'W', 'AC house consumption now')
parse(48)
parse(49)
parse(50)
parse(51)
parse(52)
parse(53)
parse(54, 1, '°C', 'Inverter radiator temperature, 0 if shut off')
parse(55)
parse(56)
parse(57)
parse(58)
parse(59)
parse(60)
parse(61)
parse(62)
parse(63)
parse(64)
parse(65)
parse(66)
parse(67)
parse_32(68, 10, @data[68], @data[69], 'kWh', 'Energy yield total: PV - battery charge + battery discharge')
parse_32(69, 10, @data[68], @data[69], 'kWh', 'Energy yield total: PV - battery charge + battery discharge')
parse(70, 10, 'kWh', 'Energy yield today: PV - battery charge + battery discharge')
parse(71)
parse(72)
parse(73)
parse_32(74, 10, @data[74], @data[75], 'kWh', 'Total Battery Discharge Energy')
parse_32(75, 10, @data[74], @data[75], 'kWh', 'Total Battery Discharge Energy')
parse_32(76, 10, @data[76], @data[77], 'kWh', 'Total Battery Charge Energy')
parse_32(77, 10, @data[76], @data[77], 'kWh', 'Total Battery Charge Energy')
parse(78, 10, 'kWh', 'Battery Discharge Energy today')
parse(79, 10, 'kWh', 'Battery Charge Energy today')
parse_32(80, 10, @data[80], @data[81], 'kWh', 'Total PV Energy')
parse_32(81, 10, @data[80], @data[81], 'kWh', 'Total PV Energy')
parse(82,10, 'kWh', 'PV Energy today, not matter if loaded into battery or feed into grid or consumed by house')
parse(83)
parse(84)
parse(85)
parse_32(86, 100, @data[86], @data[87], 'kWh', 'Total Feed-in Energy')
parse_32(87, 100, @data[86], @data[87], 'kWh', 'Total Feed-in Energy')
parse_32(88, 100, @data[88], @data[89], 'kWh', 'Total energy consumption from grid')
parse_32(89, 100, @data[88], @data[89], 'kWh', 'Total energy consumption from grid')
parse(90, 100, 'kWh', 'Feed-in energy into grid today')
parse(91)
parse(92, 100, 'kWh', 'Energy consumption from grid today')
parse(93)
parse(94)
parse(95)
parse(96)
parse(97)
parse(98)
parse(99)
parse(100)
parse(101)
parse(102)
parse(103, 1, '%', 'Battery Remaining Capacity')
parse(104)
parse(105, 1, '°C', 'Battery Temperature')
parse(106, 10, 'kWh', 'Battery remaining energy')
parse(107)
parse(108)
parse(109)
parse(110)
parse(111)
parse(112)
parse(113)
parse(114)
parse(115)
parse(116)
parse(117)
parse(118)
parse(119)
parse(120)
parse(121)
parse(122)
parse(123)
parse(124)
parse(125)
parse(126)
parse(127)
parse(128)
parse(129)
parse(130)
parse(131)
parse(132)
parse(133)
parse(134)
parse(135)
parse(136)
parse(137)
parse(138)
parse(139)
parse(140)
parse(141)
parse(142)
parse(143)
parse(144)
parse(145)
parse(146)
parse(147)
parse(148)
parse(149)
parse(150)
parse(151)
parse(152)
parse(153)
parse(154)
parse(155)
parse(156)
parse(157)
parse(158)
parse(159)
parse(160)
parse(161)
parse(162)
parse(163)
parse(164)
parse(165)
parse(166)
parse(167)
parse(168, 1, '', 'Battery operation mode: 0=Self Use Mode, 1=Force Time Use, 2=Back Up Mode, 3=Feed-in Priority')
parse_32(169, 100, @data[169], @data[170], 'V', 'Battery voltage')
parse_32(170, 100, @data[169], @data[170], 'V', 'Battery voltage')
parse(171)
parse(172)
parse(173)
parse(174)
parse(175)
parse(176)

Store the Ruby file as explain_solax_x3_g4.rb and call with parameter “IP address” and “Serial no”.

> ruby explain_solax_x3_g4.rb <ip> <serialno>

This shows the current values for all sensors whose interpretation is known or which have a value other than 0 or 1. Here’s an example result:

explain_solax_x3_g4.rb, Peter Ramm, 2023-11-23
All attributes whose interpretation is known or which have a value other than 0 or 1 are displayed.

Time                : 2023-12-10 15:57:12 +0100
IP address          : qhome.fritz.box
WiFi serial number  : SRK22XXDDZ
Firmware version    : 3.006.04
Inverter max. power : 8.0 KW

Inverter serial no. : H34C08I9162381

Data attributes     :
---------------------------------------------
  0:   2338    233.8 V    Inverter AC voltage phase 1
  1:   2360    236.0 V    Inverter AC voltage phase 2
  2:   2376    237.6 V    Inverter AC voltage phase 3
  3:     15      1.5 A    Inverter AC current phase 1 (inaccurate)
  4:     15      1.5 A    Inverter AC current phase 2 (inaccurate)
  5:     15      1.5 A    Inverter AC current phase 3 (inaccurate)
  6:    261    261.0 W    Inverter AC power phase 1
  7:    265    265.0 W    Inverter AC power phase 2
  8:    262    262.0 W    Inverter AC power phase 3
  9:    788    788.0 W    Inverter AC power all phases, negativ = import from grid
 10:   2782    278.2 V    PV1 Voltage
 11:   2557    255.7 V    PV2 Voltage
 12:      1      0.1 A    PV1 Current
 13:      0      0.0 A    PV2 Current
 14:     52     52.0 W    PV1 Power
 15:      0      0.0 W    PV2 Power
 16:   4998    49.98 Hz   Grid Frequency Phase 1
 17:   4997    49.97 Hz   Grid Frequency Phase 2
 18:   4997    49.97 Hz   Grid Frequency Phase 3
 19:      2      2.0      Inverter Operation mode
 23:      0      0.0 Y    EPS 1 Voltage
 24:      0      0.0 Y    EPS 2 Voltage
 25:      0      0.0 Y    EPS 3 Voltage
 26:      0      0.0 A    EPS 1 Current
 27:      0      0.0 A    EPS 2 Current
 28:      0      0.0 A    EPS 3 Current
 29:      0      0.0 W    EPS 1 Power
 30:      0      0.0 W    EPS 2 Power
 31:      0      0.0 W    EPS 3 Power
 34:  65490    -46.0 W    Grid AC power: + export, - import
 35:  65535    -46.0 W    Grid AC power: + export, - import
 39:  29810    298.1 V    Battery Voltage
 40:   -250     -2.5 A    Battery Current, + charge, - discharge
 41:   -745   -745.0 W    Battery Power, + charge, - discharge
 42:   2938               
 43:  65511               
 44:  64802               
 45:      1      1.0      Battery BMS status (1=ok)
 46:     41     41.0 °C   Inverter inner temperature, 0 if shut off
 47:    834    834.0 W    AC house consumption now
 48:    256               
 49:  14385               
 50:   2575               
 51:   5900               
 52:    100               
 54:     27     27.0 °C   Inverter radiator temperature, 0 if shut off
 68:   1111    111.1 kWh  Energy yield total: PV - battery charge + battery discharge
 69:      0    111.1 kWh  Energy yield total: PV - battery charge + battery discharge
 70:     37      3.7 kWh  Energy yield today: PV - battery charge + battery discharge
 71:     55               
 74:    501     50.1 kWh  Total Battery Discharge Energy
 75:      0     50.1 kWh  Total Battery Discharge Energy
 76:    605     60.5 kWh  Total Battery Charge Energy
 77:      0     60.5 kWh  Total Battery Charge Energy
 78:      8      0.8 kWh  Battery Discharge Energy today
 79:     11      1.1 kWh  Battery Charge Energy today
 80:   1268    126.8 kWh  Total PV Energy
 81:      0    126.8 kWh  Total PV Energy
 82:     43      4.3 kWh  PV Energy today, not matter if loaded into battery or feed into grid or consumed by house
 86:    241     2.41 kWh  Total Feed-in Energy
 87:      0     2.41 kWh  Total Feed-in Energy
 88:  25719   257.19 kWh  Total energy consumption from grid
 89:      0   257.19 kWh  Total energy consumption from grid
 90:      0      0.0 kWh  Feed-in energy into grid today
 92:    392     3.92 kWh  Energy consumption from grid today
103:     11     11.0 %    Battery Remaining Capacity
105:     22     22.0 °C   Battery Temperature
106:     10      1.0 kWh  Battery remaining energy
107:    256               
108:   3504               
109:   2400               
110:    140               
111:    183               
112:    156               
113:    148               
114:     31               
115:     31               
116:      9               
117:   1620               
118:    778               
119:  15163               
120:  14906               
121:  15163               
125:   3107               
126:   3094               
127:  16915               
128:      2               
129:  20564               
130:  12339               
131:  18753               
132:  12599               
133:  18736               
134:  12612               
135:  12345               
136:  20564               
137:  12339               
138:  18754               
139:  12610               
140:  18740               
141:  13895               
142:  13881               
143:  20564               
144:  12339               
145:  18754               
146:  12856               
147:  18742               
148:  12614               
149:  13618               
150:  20564               
151:  12339               
152:  18754               
153:  12610               
154:  18740               
155:  13127               
156:  14647               
164:   4098               
165:   4867               
166:    769               
167:    258               
168:      0      0.0      Battery operation mode: 0=Self Use Mode, 1=Force Time Use, 2=Back Up Mode, 3=Feed-in Priority
169:  29810    298.1 V    Battery voltage
170:      0    298.1 V    Battery voltage

Due to posting limits the configuration.yaml follows in next post.

1 Like

… follow up of previous post.
Some not interpreted sensor values between position 130 and 139 are removed to match the posting size limitations.

As used by others before this sensor values are imported to HA. Here is the used configuration.yaml:

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

logger:
  default: warn
  logs:
     homeassistant.components.rest: info
#    custom_components.powercalc: debug


automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

http:
  # Proxy-Header verwenden
  use_x_forwarded_for: true
  
  # You must set the trusted proxy IP address so that Home Assistant will properly accept connections
  # Set this to your NGINX machine IP, or localhost if hosted on the same machine.
  trusted_proxies: 
    - 127.0.0.1
    - 192.168.178.94


template:
  - sensor:
### Local sensor readings ###
    # Each valid SN seems to be 10 characters
    - name: solax_local
      state: > 
            {% if state_attr('sensor.solax_rest_local', 'sn')|length == 10  %}
              {{ now().strftime("%H:%M:%S") }}
            {% else %}
              {{ (states('sensor.solax_local')) }}
            {% endif %}
      attributes: 
        sn: >-
            {% if state_attr('sensor.solax_rest_local', 'sn')|length == 10 %}
              {{ (state_attr('sensor.solax_rest_local', 'sn')) }}
            {% else %}
              {{ (state_attr('sensor.solax_local', 'sn')) }}
            {% endif %}
        ver: >-
          {% if state_attr('sensor.solax_rest_local', 'sn')|length == 10 %}
            {{ (state_attr('sensor.solax_rest_local', 'ver')) }}
          {% else %}
            {{ (state_attr('sensor.solax_local', 'ver')) }}
          {% endif %}
        type: >-
          {% if state_attr('sensor.solax_rest_local', 'sn')|length == 10 %}
            {{ (state_attr('sensor.solax_rest_local', 'type')) }}
          {% else %}
            {{ (state_attr('sensor.solax_local', 'type')) }}
          {% endif %}
        Data: >-
          {% if state_attr('sensor.solax_rest_local', 'sn')|length == 10 and state_attr('sensor.solax_rest_local', 'Data')|length > 200  %}
            {{ (state_attr('sensor.solax_rest_local', 'Data')) }}
          {% else %}
            {{ None }}
          {% endif %}
        Information: >-
          {% if state_attr('sensor.solax_rest_local', 'sn')|length == 10 %}
            {{ (state_attr('sensor.solax_rest_local', 'Information')) }}
          {% else %}
            {{ (state_attr('sensor.solax_local', 'Information')) }}
          {% endif %}

### Make the settings look like sensor data by embedding the info in the Data attribute 
    - name: solax_local_settings
      state: > 
            {{ now().strftime("%H:%M:%S") }}
      attributes: 
        Data: >-
          {{ (states('sensor.solax_rest_local_settings')) }}

#### Data elements sorted by occurrence in array  ####
 
    - name: "Q.Home WR AC Spannung Phase 1"
      unique_id: qhome_inverter_ac_voltage_phase1
      state: "{{ (state_attr('sensor.solax_local', 'Data')[0] ) | int(default=0) / 10 }}"
      unit_of_measurement: "V"
      state_class: measurement
      device_class: voltage

    - name: "Q.Home WR AC Spannung Phase 2"
      unique_id: qhome_inverter_ac_voltage_phase2
      state: "{{ (state_attr('sensor.solax_local', 'Data')[1] ) | int(default=0) / 10 }}"
      unit_of_measurement: "V"
      state_class: measurement
      device_class: voltage

    - name: "Q.Home WR AC Spannung Phase 3"
      unique_id: qhome_inverter_ac_voltage_phase3
      state: "{{ (state_attr('sensor.solax_local', 'Data')[2] ) | int(default=0) / 10 }}"
      unit_of_measurement: "V"
      state_class: measurement
      device_class: voltage

    - name: "Q.Home WR AC Strom Phase 1"
      unique_id: qhome_inverter_ac_current_phase1
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[3] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[3] - 65536) | int(default=0) /10}}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[3] | int(default=0) / 10 }}
        {% endif %}
      unit_of_measurement: "A"
      state_class: measurement
      device_class: current

    - name: "Q.Home WR AC Strom Phase 2"
      unique_id: qhome_inverter_ac_current_phase2
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[4] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[4] - 65536) | int(default=0) /10}}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[4] | int(default=0) / 10 }}
        {% endif %}
      unit_of_measurement: "A"
      state_class: measurement
      device_class: current

    - name: "Q.Home WR AC Strom Phase 3"
      unique_id: qhome_inverter_ac_current_phase3
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[5] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[5] - 65536) | int(default=0) /10}}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[5] | int(default=0) / 10 }}
        {% endif %}
      unit_of_measurement: "A"
      state_class: measurement
      device_class: current

    - name: "Q.Home WR AC Leistung Phase 1"
      unique_id: qhome_inverter_ac_power_phase1
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[6] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[6] - 65536) | int(default=0) }}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[6] | int(default=0) }}
        {% endif %}
      unit_of_measurement: "W"
      state_class: measurement
      device_class: power

    - name: "Q.Home WR AC Leistung Phase 2"
      unique_id: qhome_inverter_ac_power_phase2
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[7] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[7] - 65536) | int(default=0) }}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[7] | int(default=0) }}
        {% endif %}
      unit_of_measurement: "W"
      state_class: measurement
      device_class: power

    - name: "Q.Home WR AC Leistung Phase 3"
      unique_id: qhome_inverter_ac_power_phase3
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[8] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[8] - 65536) | int(default=0) }}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[8] | int(default=0) }}
        {% endif %}
      unit_of_measurement: "W"
      state_class: measurement
      device_class: power

    - name: "Q.Home WR AC Leistung alle Phasen"
      unique_id: qhome_inverter_ac_power_all_phases
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[9] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[9] - 65536) | int(default=0) }}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[9] | int(default=0) }}
        {% endif %}
      unit_of_measurement: "W"
      state_class: measurement
      device_class: power

    - name: "Q.Home PV1 Spannung"
      unique_id: qhome_pv1_voltage
      state: "{{ (state_attr('sensor.solax_local', 'Data')[10] ) | int(default=0) / 10 }}"
      unit_of_measurement: "V"
      state_class: measurement
      device_class: voltage

    - name: "Q.Home PV2 Spannung"
      unique_id: qhome_pv2_voltage
      state: "{{ (state_attr('sensor.solax_local', 'Data')[11] ) | int(default=0) / 10 }}"
      unit_of_measurement: "V"
      state_class: measurement
      device_class: voltage

    - name: "Q.Home PV1 Strom"
      unique_id: qhome_pv1_current
      state: "{{ (state_attr('sensor.solax_local', 'Data')[12] ) | int(default=0) / 10 }}"
      unit_of_measurement: "A"
      state_class: measurement
      device_class: current

    - name: "Q.Home PV2 Strom"
      unique_id: qhome_pv2_current
      state: "{{ (state_attr('sensor.solax_local', 'Data')[13] ) | int(default=0) / 10 }}"
      unit_of_measurement: "A"
      state_class: measurement
      device_class: current

    - name: "Q.Home PV 1 Leistung"
      unique_id: qhome_pv1_leistung
      state: "{{ (state_attr('sensor.solax_local', 'Data')[14] ) | int(default=0) }}"
      unit_of_measurement: "W"
      state_class: measurement
      device_class: power

    - name: "Q.Home PV 2 Leistung"
      unique_id: qhome_pv2_leistung
      state: "{{ (state_attr('sensor.solax_local', 'Data')[15] ) | int(default=0) }}"
      unit_of_measurement: "W"
      state_class: measurement
      device_class: power

    - name: "Q.Home PV Leistung"
      unique_id: qhome_pv_leistung
      state: "{{ (state_attr('sensor.solax_local', 'Data')[14] + state_attr('sensor.solax_local', 'Data')[15]) | int(default=0) }}"
      unit_of_measurement: "W"
      state_class: measurement
      device_class: "power"

    - name: "Q.Home Netzfrequenz Phase 1"
      unique_id: qhome_grid_frequency_phase1
      state: "{{ (state_attr('sensor.solax_local', 'Data')[16] ) | int(default=0) / 100 }}"
      unit_of_measurement: "Hz"
      state_class: measurement
      device_class: frequency

    - name: "Q.Home Netzfrequenz Phase 2"
      unique_id: qhome_grid_frequency_phase2
      state: "{{ (state_attr('sensor.solax_local', 'Data')[17] ) | int(default=0) / 100 }}"
      unit_of_measurement: "Hz"
      state_class: measurement
      device_class: frequency

    - name: "Q.Home Netzfrequenz Phase 3"
      unique_id: qhome_grid_frequency_phase3
      state: "{{ (state_attr('sensor.solax_local', 'Data')[18] ) | int(default=0) / 100 }}"
      unit_of_measurement: "Hz"
      state_class: measurement
      device_class: frequency

    # Inverter operation mode: 
    #  0 Waiting
    #  1 Checking
    #  2 Normal
    #  3 Off
    #  4 Permanent Fault
    #  5 Updating
    #  6 EPS Check
    #  7 EPS Mode
    #  8 Self Test
    #  9 Idle
    # 10 Standby
    - name: "Q.Home Inverter operation mode"
      unique_id: qhome_inverter_operation_mode
      state: "{{ (state_attr('sensor.solax_local', 'Data')[19] ) | int(default=0) }}"
      state_class: measurement

    - name: "Q.Home EPS Spannung Phase 1"
      unique_id: qhome_eps_voltage_phase1
      state: "{{ (state_attr('sensor.solax_local', 'Data')[23] ) | int(default=0) / 10 }}"
      unit_of_measurement: "V"
      state_class: measurement
      device_class: voltage

    - name: "Q.Home EPS Spannung Phase 2"
      unique_id: qhome_eps_voltage_phase2
      state: "{{ (state_attr('sensor.solax_local', 'Data')[24] ) | int(default=0) / 10 }}"
      unit_of_measurement: "V"
      state_class: measurement
      device_class: voltage

    - name: "Q.Home EPS Spannung Phase 3"
      unique_id: qhome_eps_voltage_phase3
      state: "{{ (state_attr('sensor.solax_local', 'Data')[25] ) | int(default=0) / 10 }}"
      unit_of_measurement: "V"
      state_class: measurement
      device_class: voltage

    - name: "Q.Home EPS Strom Phase 1"
      unique_id: qhome_eps_current_phase1
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[26] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[26] - 65536) | int(default=0) / 10}}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[26] | int(default=0) / 10 }}
        {% endif %}
      unit_of_measurement: "A"
      state_class: measurement
      device_class: current

    - name: "Q.Home EPS Strom Phase 2"
      unique_id: qhome_eps_current_phase2
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[27] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[27] - 65536) | int(default=0) / 10}}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[27] | int(default=0) / 10 }}
        {% endif %}
      unit_of_measurement: "A"
      state_class: measurement
      device_class: current

    - name: "Q.Home EPS Strom Phase 3"
      unique_id: qhome_eps_current_phase3
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[28] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[28] - 65536) | int(default=0) / 10}}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[28] | int(default=0) / 10 }}
        {% endif %}
      unit_of_measurement: "A"
      state_class: measurement
      device_class: current

    - name: "Q.Home EPS Leistung Phase 1"
      unique_id: qhome_eps_power_phase1
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[29] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[29] - 65536) | int(default=0) }}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[29] | int(default=0) }}
        {% endif %}
      unit_of_measurement: "W"
      state_class: measurement
      device_class: power

    - name: "Q.Home EPS Leistung Phase 2"
      unique_id: qhome_eps_power_phase2
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[30] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[30] - 65536) | int(default=0) }}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[30] | int(default=0) }}
        {% endif %}
      unit_of_measurement: "W"
      state_class: measurement
      device_class: power

    - name: "Q.Home EPS Leistung Phase 3"
      unique_id: qhome_eps_power_phase3
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[31] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[31] - 65536) | int(default=0) }}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[31] | int(default=0) }}
        {% endif %}
      unit_of_measurement: "W"
      state_class: measurement
      device_class: power

    - name: "Q.Home Netz Leistung: + Export, - Import"
      unique_id: qhome_grid_power_all_phases
      state: >
        {% if state_attr('sensor.solax_local', 'Data')[34] > 32767 %}
        {{ ((state_attr('sensor.solax_local', 'Data')[35]-65535) * 2**16 + state_attr('sensor.solax_local', 'Data')[34] - 65536) | int(default=0) }}
        {% else %}
        {{ (state_attr('sensor.solax_local', 'Data')[35] * 2**16 +  state_attr('sensor.solax_local', 'Data')[34]) | int(default=0) }}
        {% endif %}
      unit_of_measurement: "W"
      state_class: measurement
      device_class: power

    - name: "Q.Home Batterie Spannung"
      unique_id: qhome_battery_voltage
      state: "{{ (state_attr('sensor.solax_local', 'Data')[39] ) | int(default=0) / 100 }}"
      unit_of_measurement: "V"
      state_class: measurement
      device_class: voltage

    - name: "Q.Home Batterie Strom, + laden, - entladen"
      unique_id: qhome_battery_current
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[40] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[40] - 65536) | int(default=0) / 100 }}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[40] | int(default=0) / 100 }}
        {% endif %}
      unit_of_measurement: "A"
      state_class: measurement
      device_class: current

    - name: "Q.Home Batterie Leistung, + laden, - entladen"
      unique_id: qhome_battery_power
      state: > 
        {% if state_attr('sensor.solax_local', 'Data')[41] > 32767 %}
        {{ (state_attr('sensor.solax_local', 'Data')[41] - 65536) | int(default=0) }}
        {% else %}
        {{ state_attr('sensor.solax_local', 'Data')[41] | int(default=0) }}
        {% endif %}
      unit_of_measurement: "W"
      state_class: measurement
      device_class: power

    - name: "Q.Home unknown 42"
      unique_id: qhome_unknown_42
      state: "{{ (state_attr('sensor.solax_local', 'Data')[42] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 43"
      unique_id: qhome_unknown_43
      state: "{{ (state_attr('sensor.solax_local', 'Data')[43] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 44"
      unique_id: qhome_unknown_44
      state: "{{ (state_attr('sensor.solax_local', 'Data')[44] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home Batterie BMS status (1=OK)"
      unique_id: qhome_battery_bms_status
      state: "{{ (state_attr('sensor.solax_local', 'Data')[45] ) | int(default=0) }}" 
      state_class: measurement

    - name: "Q.Home Wechselrichter innere Temperatur"
      unique_id: qhome_inverter_inner_temperature
      state: "{{ (state_attr('sensor.solax_local', 'Data')[46] ) | int(default=0) }}"
      unit_of_measurement: "°C"
      state_class: measurement
      device_class: temperature

    - name: "Q.Home Hausverbrauch Leistung"
      unique_id: qhome_home_power
      state: "{{ (state_attr('sensor.solax_local', 'Data')[47] ) | int(default=0) }}"
      unit_of_measurement: "W"
      state_class: measurement
      device_class: power

    - name: "Q.Home unknown 48"
      unique_id: qhome_unknown_48
      state: "{{ (state_attr('sensor.solax_local', 'Data')[48] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 49"
      unique_id: qhome_unknown_49
      state: "{{ (state_attr('sensor.solax_local', 'Data')[49] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 50"
      unique_id: qhome_unknown_50
      state: "{{ (state_attr('sensor.solax_local', 'Data')[50] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 51"
      unique_id: qhome_unknown_51
      state: "{{ (state_attr('sensor.solax_local', 'Data')[51] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 52"
      unique_id: qhome_unknown_52
      state: "{{ (state_attr('sensor.solax_local', 'Data')[52] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home Wechselrichter Kühlertemperatur"
      unique_id: qhome_inverter_radiator_temperature
      state: "{{ (state_attr('sensor.solax_local', 'Data')[54] ) | int(default=0) }}"
      unit_of_measurement: "°C"
      state_class: measurement
      device_class: temperature

    - name: "Q.Home Energieertrag total: PV - Batterie in + Batterie out"
      unique_id: qhome_energy_yield_total
      state: "{{ (state_attr('sensor.solax_local', 'Data')[69] * 2**16 +  state_attr('sensor.solax_local', 'Data')[68]) | int(default=0) / 10 }}"
      unit_of_measurement: "kWh"
      state_class: "total_increasing"
      device_class: "energy"

    - name: "Q.Home Energieertrag heute: PV - Batterie in + Batterie out"
      unique_id: qhome_energy_yield_today
      state: "{{ (state_attr('sensor.solax_local', 'Data')[70] ) | int(default=0) / 10 }}"
      unit_of_measurement: "kWh"
      state_class: "total"
      device_class: "energy"
 
    - name: "Q.Home unknown 71"
      unique_id: qhome_unknown71_
      state: "{{ (state_attr('sensor.solax_local', 'Data')[71] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home Batterie Entladung total"
      unique_id: qhome_energy_battery_discharge total
      state: "{{ (state_attr('sensor.solax_local', 'Data')[75] * 2**16 +  state_attr('sensor.solax_local', 'Data')[74]) | int(default=0) / 10 }}"
      unit_of_measurement: "kWh"
      state_class: "total"
      device_class: "energy"
 
    - name: "Q.Home Batterie Ladung total"
      unique_id: qhome_energy_battery_charge total
      state: "{{ (state_attr('sensor.solax_local', 'Data')[77] * 2**16 +  state_attr('sensor.solax_local', 'Data')[76]) | int(default=0) / 10 }}"
      unit_of_measurement: "kWh"
      state_class: "total"
      device_class: "energy"
 
    - name: "Q.Home Batterie Entladung heute"
      unique_id: qhome_energy_battery_discharge_today
      state: "{{ (state_attr('sensor.solax_local', 'Data')[78] ) | int(default=0) / 10 }}"
      unit_of_measurement: "kWh"
      state_class: "total"
      device_class: "energy"
 
    - name: "Q.Home Batterie Ladung heute"
      unique_id: qhome_energy_battery_charge_today
      state: "{{ (state_attr('sensor.solax_local', 'Data')[79] ) | int(default=0) / 10 }}"
      unit_of_measurement: "kWh"
      state_class: "total"
      device_class: "energy"

    - name: "Q.Home Energie PV total"
      unique_id: qhome_energy_pv_total
      state: "{{ (state_attr('sensor.solax_local', 'Data')[81] * 2**16 +  state_attr('sensor.solax_local', 'Data')[80]) | int(default=0) / 10 }}"
      unit_of_measurement: "kWh"
      state_class: "total"
      device_class: "energy"
 
    # PV Energie heute = ca. Ertrag total - Batterie Entladung + Batterie Ladung
    - name: "Q.Home Energie PV heute"
      unique_id: qhome_energy_pv_today
      state: "{{ (state_attr('sensor.solax_local', 'Data')[82] ) | int(default=0) / 10 }}"
      unit_of_measurement: "kWh"
      state_class: "total"
      device_class: "energy"

    - name: "Q.Home Netz Einspeisung total"
      unique_id: qhome_energy_grid_export_total
      state: "{{ (state_attr('sensor.solax_local', 'Data')[87] * 2**16 +  state_attr('sensor.solax_local', 'Data')[86]) | int(default=0) / 100 }}"
      unit_of_measurement: "kWh"
      state_class: "total"
      device_class: "energy"
 
    - name: "Q.Home Netz Bezug total"
      unique_id: qhome_energie_grid_import_total
      state: "{{ (state_attr('sensor.solax_local', 'Data')[89] * 2**16 +  state_attr('sensor.solax_local', 'Data')[88]) | int(default=0) / 100 }}"
      unit_of_measurement: "kWh"
      state_class: "total_increasing"
      device_class: "energy"
 
    - name: "Q.Home Netz Einspeisung heute"
      unique_id: qhome_energy_grid_export_today
      state: "{{ (state_attr('sensor.solax_local', 'Data')[90] ) | int(default=0) / 100 }}"
      unit_of_measurement: "kWh"
      state_class: "total"
      device_class: "energy"

    - name: "Q.Home Netz Bezug heute"
      unique_id: qhome_energy_grid_import_today
      state: "{{ (state_attr('sensor.solax_local', 'Data')[92] ) | int(default=0) / 100 }}"
      unit_of_measurement: "kWh"
      state_class: "total"
      device_class: "energy"

    - name: "Q.Home Batterie Kapazität"
      unique_id: qhome_battery_capacity
      state: "{{ (state_attr('sensor.solax_local', 'Data')[103] ) | int(default=0) / 10 }}"
      unit_of_measurement: "%"
      state_class: measurement
      device_class: battery
 
    - name: "Q.Home Batterie Temperatur"
      unique_id: qhome_battery_temperature
      state: "{{ (state_attr('sensor.solax_local', 'Data')[105] ) | int(default=0) }}"
      unit_of_measurement: "°C"
      state_class: measurement
      device_class: temperature
 
    - name: "Q.Home Batterie Energie verbleibend"
      unique_id: qhome_battery_energy_remaining
      state: "{{ (state_attr('sensor.solax_local', 'Data')[106] ) | int(default=0) / 10 }}"
      unit_of_measurement: "kWh"
      state_class: measurement
      device_class: energy_storage

    - name: "Q.Home unknown 108"
      unique_id: qhome_unknown_108
      state: "{{ (state_attr('sensor.solax_local', 'Data')[108] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 109"
      unique_id: qhome_unknown_109
      state: "{{ (state_attr('sensor.solax_local', 'Data')[109] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 110"
      unique_id: qhome_unknown_110
      state: "{{ (state_attr('sensor.solax_local', 'Data')[110] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 111"
      unique_id: qhome_unknown_111
      state: "{{ (state_attr('sensor.solax_local', 'Data')[111] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 112"
      unique_id: qhome_unknown_112
      state: "{{ (state_attr('sensor.solax_local', 'Data')[112] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 113"
      unique_id: qhome_unknown_113
      state: "{{ (state_attr('sensor.solax_local', 'Data')[113] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 114"
      unique_id: qhome_unknown_114
      state: "{{ (state_attr('sensor.solax_local', 'Data')[114] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 115"
      unique_id: qhome_unknown_115
      state: "{{ (state_attr('sensor.solax_local', 'Data')[115] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 116"
      unique_id: qhome_unknown_116
      state: "{{ (state_attr('sensor.solax_local', 'Data')[116] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 117"
      unique_id: qhome_unknown_117
      state: "{{ (state_attr('sensor.solax_local', 'Data')[117] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 118"
      unique_id: qhome_unknown_118
      state: "{{ (state_attr('sensor.solax_local', 'Data')[118] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 119"
      unique_id: qhome_unknown_119
      state: "{{ (state_attr('sensor.solax_local', 'Data')[119] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 120"
      unique_id: qhome_unknown_120
      state: "{{ (state_attr('sensor.solax_local', 'Data')[120] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 121"
      unique_id: qhome_unknown_121
      state: "{{ (state_attr('sensor.solax_local', 'Data')[121] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 125"
      unique_id: qhome_unknown_125
      state: "{{ (state_attr('sensor.solax_local', 'Data')[125] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 126"
      unique_id: qhome_unknown_126
      state: "{{ (state_attr('sensor.solax_local', 'Data')[126] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 127"
      unique_id: qhome_unknown_127
      state: "{{ (state_attr('sensor.solax_local', 'Data')[127] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 150"
      unique_id: qhome_unknown_150
      state: "{{ (state_attr('sensor.solax_local', 'Data')[150] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight
 
    - name: "Q.Home unknown 151"
      unique_id: qhome_unknown_151
      state: "{{ (state_attr('sensor.solax_local', 'Data')[151] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 152"
      unique_id: qhome_unknown_152
      state: "{{ (state_attr('sensor.solax_local', 'Data')[152] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 153"
      unique_id: qhome_unknown_153
      state: "{{ (state_attr('sensor.solax_local', 'Data')[153] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 154"
      unique_id: qhome_unknown_154
      state: "{{ (state_attr('sensor.solax_local', 'Data')[154] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 156"
      unique_id: qhome_unknown_156
      state: "{{ (state_attr('sensor.solax_local', 'Data')[156] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 164"
      unique_id: qhome_unknown_164
      state: "{{ (state_attr('sensor.solax_local', 'Data')[164] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 165"
      unique_id: qhome_unknown_165
      state: "{{ (state_attr('sensor.solax_local', 'Data')[165] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 166"
      unique_id: qhome_unknown_166
      state: "{{ (state_attr('sensor.solax_local', 'Data')[166] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    - name: "Q.Home unknown 167"
      unique_id: qhome_unknown_167
      state: "{{ (state_attr('sensor.solax_local', 'Data')[167] ) | int(default=0) }}"
      unit_of_measurement: "g"
      state_class: measurement
      device_class: weight

    # Q.Home Batterie Betriebsmodus ( 0: Self Use Mode 1: Force Time Use 2: Back Up Mode 3: Feed-in Priority)
    - name: "Q.Home Batterie Betriebsmodus"
      unique_id: qhome_battery_operation_mode
      state: "{{ (state_attr('sensor.solax_local', 'Data')[168] ) | int(default=0) }}" 
      state_class: measurement

    - name: "Q.Home Batterie Spannung_2"
      unique_id: qhome_battery_voltage2
      state: "{{ (state_attr('sensor.solax_local', 'Data')[170] * 2**16 +  state_attr('sensor.solax_local', 'Data')[169]) | int(default=0) / 100 }}"
      unit_of_measurement: "V"
      state_class: measurement
      device_class: voltage
 
sensor:
  ### Solax Local REST sensor ###
  - platform: rest
    scan_interval: 15
    resource: !secret solax_local_ip
    payload: !secret solax_local_realtime_payload
    method: POST
    name: "solax_rest_local"
    json_attributes:
      - sn
      - ver
      - type
      - Data
      - Information
    value_template: 'OK'  # dummy value, not used; avoids the "State max length is 255 characters" error

#sensor powercalc_label: !include powercalc.yaml

### Commands for controlling the Solax Local inverter

#rest_command:

The two private config values are stored in secrets.yaml:

solax_local_ip: http://192.168.x.x/ 
solax_local_realtime_payload: "optType=ReadRealTimeData&pwd=XXXXXXXXX"

Works quite well with refresh of values each 15 seconds.

1 Like

@rammpeter great job with template! :wink:

Where did you find the information about DATA?
I have the same system, but not three-phase, single-phase (1P).

I find it a bit difficult to associate the DATA string data with its attribute!

This is an example of what I receive with RESt:

Date: 2365, 20, 427, 4999, 0, 0, 0, 0, 0, 0, 2, 5004, 0, 78, 41120, 65436, 65087, 24, 34, 2659, 0, 3095, 0, 42, 100, 0, 26, 4416, 0, 0, 0, 0, 65531, 65535, 7080, 0, 43061, 0, 432, 33, 256, 4672, 3200, 150, 264, 167, 154, 33, 33, 23, 1, 1, 3, 0, 5439, 0, 65113, 65535, 65385, 65535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6000, 0, 65112, 65535, 3600, 0, 61936, 65535, 10, 0, 1042, 0, 0, 0, 0, 114, 40, 78, 0, 0, 360, 0, 10, 0, 0, 0, 0, 0, 0, 13083, 4883, 5900, 2132, 777, 14135, 14135, 14135, 14135, 0, 0, 1, 4170, 65525, 65078, 3267, 3258, 10791, 9, 20564, 12339, 18753, 12851, 18741, 12612, 12593, 20564, 12339, 18754, 12853, 18743, 12868, 13363, 20564, 12339, 18754, 12853, 18743, 12868, 13619, 20564, 12339, 1875 4, 12853, 18743, 13124, 12857, 20564, 12339, 18754, 12853, 18743, 13124, 12601, 1, 7426, 4098, 769, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

data[0] = Inverter AC voltage
data[1] = Inverter AC current
data[2] = Inverter AC output power
data[3] = ??

data[10] = Inverter operative mode ???
data[11] = Inverter AC frequency

I have doubts in choosing the attributes!
Regards for your replay :slight_smile:

…maybe i solved it ???

        "AC voltage R": (0, Units.V, div10),
        "AC current": (1, Units.A, div10),
        "AC power": (2, Units.W),
        "Grid frequency": (3, Units.HZ, div100),
        "PV1 voltage": (4, Units.V, div10),
        "PV2 voltage": (5, Units.V, div10),
        "PV1 current": (6, Units.A, div10),
        "PV2 current": (7, Units.A, div10),
        "PV1 power": (8, Units.W),
        "PV2 power": (9, Units.W),
        "On-grid total yield": (pack_u16(11, 12), Total(Units.KWH), div10),
        "On-grid daily yield": (13, Units.KWH, div10),
        "Battery voltage": (14, Units.V, div100),
        "Battery current": (15, Units.A, div100),
        "Battery power": (16, Units.W),
        "Battery temperature": (17, Units.C),
        "Battery SoC": (18, Units.PERCENT),
        "Grid power": (32, Units.W, to_signed),
        "Total feed-in energy": (pack_u16(34, 35), Total(Units.KWH), div100),
        "Total consumption": (pack_u16(36, 37), Total(Units.KWH), div100),

Where did you find the information about DATA?

Most of them I collected by Google from this forum as well as some others.

What helped me to proof the interpretation and correct some misunderstandings was to add all the attributes as Home Assistant entities and look how they evolved over time compared to the known state of my system at the same time.

and

1 Like

I have a Gen 4 SolaX Inverter Serial H34B and tested if I can write with HA OS 12.1 and HA Core 2024.3.1 via solax-modbus integration 2030307 to the parameter.
There are two entities I tested to write to:

  • number.solax_selfuse_discharge_min_soc
  • sensor.solax_selfuse_discharge_min_soc
    Both parameters are returning the error:

Failed to call service number/set_value. Modbus Error: [Input/Output] ERROR: No response received after 3 retries

Whilst it is possible to change the value via QCells app, it does not work with the integration.
A possible cause is that the app is requiring a password to unlock the system for changing the value. If the integration does not handle this restriction the change of the value will not be possible.

Unlocking the Inverter and Unlocking Inverter - Advanced is greyed out and can not be handled within the integration AFAIK - at least I did not find a way…

Just for completeness: Reading values works just fine. I can see 269 entities.

Try 2024.03.8b1