Solax X1 Hybrid G4 (local & cloud API)

Hi
That looks great, where did you get the 2 different pv array sensor codes?
Also what is the battery gauge you are using please?
Thanks

Hi,

If you use the Solax Modbus integration you should be able to access almost every single entity from the inverter. I have shared the details about it in a previous comment in this same thread. For battery, I am using this custom HACS card, flex-horseshoe-card.

1 Like

Hey Andrew, I was wondering whether you have tried forced discharge yet via HA since this post?

Hi Nick

Yes, I’ve used work mode and manual mode to cause the inverter to force discharge the battery.

I’m controlling solax using a node js application, rather than home assistant, but I assume the same settings will also work with HA.

Andrew

2 Likes

Hello all
Please accept this as a newbie non-tech person and apologies if this question is too silly.
I have just had solax inverter and solax batteries installed and want to find better ways to charge and dis-charge batteries so I can make full use of solar and also smooth my grid output as I have a DNO restriction applied.
I think home assistant seems to be the way to go but I really have NO idea how or where to even begin.
Is there anywhere that does a dummies guide to all this ?
Thanks in advance

Has anyone had any issues connecting to the inverter with a Pocket LanV2.0
My wifi is too iffy to use successfully so fitted a Pocket Lan 2.0 as the inverter is next to my comms cabinet.
It has picked up an DHCP IP address, but it looks as though no ports are open. I cannot connect to it via IP… the API works fine (and the solax cloud website) and I can see the few bits of info it displays, but not having any luck with the scripts or the HACS integration…
I really do want to use the automation to change the charge levels…

so I guess the question is… does either work with a pocket lan 2.0 or do I need to involve Solax support ?

Have you tried the HACS Solax Modbus integration? Works 100% for me.

yeah doesn’t with me… neither with pocket wifi V2 or pocket lan V2

1 Like

are u using an wifi or lan dongle? if wifi which fw version? i’m currently using a wifi pocket V2 with firmware 3.001.02. ModBus TCP Port is open (502) looks like connection is working but no data in solax modbus tcp integration.
the pocket lan v2 doesnt provide an open modbus tcp port.

Wfii - version is :

I assume you have connected the Wifi to your network and you are not just trying to get the data from the hotspot IP?

correct, dongle is connected to one of my wifi’s and i try to get the infos out of it through the ip of my network. currently i’m fighting with the rest api which basically works but the mapping of the values is quite hard to do. would prefer the modbus integration…

It’s a long shot, but sometimes mine stops reporting and requires an unplug and re-plug - then it sends data again. Maybe your adapter is stuck like that - worth a try (assuming you haven’t already tried!)

hm… i see … and you are using this integration for getting the data out of the wifi pocket v2 dongle with firmware 3.001.02?

Hi, just checked and yes - that’s the one I am using.

I’ve just double checked the pocketwifi and although my paperwork says V2 - in tiny writing on the side it says V3 … so sorry. I’m using a V3 and not a V2 as I thought.

ok … that explains it :wink: so i guess i’m stuck with the v2 which doesnt support modbus tcp as far as i know… thanks anyway :+1:

I don’t know if you spotted this, but for anyone that is still running the old firmware, you can bypass the need for a proxy by using the X-Forward-For HTTP header.

curl -d “optType=ReadRealTimeData&pwd=PASSWORD” -X POST http://192.168.1.x -H “X-Forward-For: 5.8.8.8”

Just replace with your password above (we know the default), and change the IP to one you have configured statically from your DHCP server and it’s all systems go!.

In the configuration, just add that in as a header for the rest command and your set.

Check out the post from @markvan with the JSON example…god bless you sir!

So I have a Solax X1-AC, and everything is working briliantly (using the X-Forward header from my previous post to avoid needing the reverse proxy), I’ve worked out where the individual register positions are for the X1 in Force Charge Mode as follows…

38 Is the start of force charge period 1.
39 Is the end of force charge period 1.
42 Is the start of force charge period 1.
43 Is the end of force charge period 1.
150 is the Max charge percentage for period 1.
151 is the Max charge percentage for period 2.

The time format is a bit odd, take minutes, multiply by 256, then add hours…that was a head-scratcher.

But it’s all working perfectly now…just need to write my automations!

Hi Kamil, silly question but what is the easiest way to obtain the IP address of the inverter? It does not broadcast on my network with a SSID that is obvious. Many thanks.

Piggybacking in this topic I’ve made an automation so I could use as much as possible from the Octopus Flux Tariff:

I’m only now starting to code so I believe some of it could be tidied but it’s a start and it’s working as intended.

  • changes the inverter into manual mode and discharge mode until,
  • The battery discharges until the set minimum and then the inverter goes into feed in priority (stopping the battery from discharging anymore)
  • stays in feed in priority until,
  • when the solar production is below 200w switches the over back into self use mode and deactivates the automation.

I then have another automation to enable the day time automations.

Battery discharge during Flux Peak time:

alias: Battery discharge during Flux Peak time
description: >-
  Change between Force discharge and Self use based on time of the day and Solax
  Battery
trigger:
  - platform: time
    at: "16:01:00"
    id: Start peak
  - platform: time
    at: "18:59:00"
    id: Stop peak
  - platform: numeric_state
    entity_id: sensor.solax_local_battery_soc
    below: input_number.minimum_battery_flux_peak
    id: Batery below minimum
  - platform: numeric_state
    entity_id: sensor.solax_local_pv_output
    for:
      hours: 0
      minutes: 2
      seconds: 0
    below: 200
    id: Solar output < 200
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: Start peak
          - condition: template
            alias: Battery above minimum -1
            value_template: >-
              {{ states('sensor.solax_local_battery_soc')|int >
              states('input_number.minimum_battery_flux_peak')|int -1}}
        sequence:
          - service: input_select.set_options
            data:
              options: 3
            target:
              entity_id: input_select.operation_mode
            alias: Set inverter to manual mode
          - service: input_select.set_options
            data:
              options: 2
            target:
              entity_id: input_select.manual_mode_setting
            alias: Set Manual mode to Force Discharge
      - conditions:
          - condition: or
            conditions:
              - condition: trigger
                id: Stop peak
              - condition: trigger
                id: Batery below minimum
          - condition: time
            before: "19:01:00"
            after: "15:59:00"
        sequence:
          - service: input_select.set_options
            data:
              options: 1
            target:
              entity_id: input_select.operation_mode
            alias: Set inverter to feed in priority
          - service: input_select.set_options
            data:
              options: 0
            target:
              entity_id: input_select.operation_mode
            alias: Set inverter to self use
            enabled: false
      - conditions:
          - condition: trigger
            id: Solar output < 200
        sequence:
          - service: input_select.set_options
            data:
              options: 0
            target:
              entity_id: input_select.operation_mode
            alias: Set inverter to self use
            enabled: true
          - service: automation.turn_off
            data:
              stop_actions: false
            target:
              entity_id: automation.flux_set_inverter_mode
  - repeat:
      count: "3"
      sequence:
        - service: rest_command.solax_local_set_inverter_mode
          data:
            value: "{{ states('input_select.operation_mode') }}"
          enabled: true
          alias: Set inverter mode
        - delay:
            hours: 0
            minutes: 0
            seconds: 5
            milliseconds: 0
        - service: rest_command.solax_local_set_manual_mode_setting
          data:
            value: "{{ states('input_select.manual_mode_setting') }}"
          enabled: true
          alias: Set manual mode setting
        - delay:
            hours: 0
            minutes: 0
            seconds: 5
            milliseconds: 0
        - service: homeassistant.update_entity
          entity_id: sensor.solax_rest_local_settings
        - delay:
            hours: 0
            minutes: 0
            seconds: 5
            milliseconds: 0
mode: single

Enable day time automations

alias: Enable daytime automations
description: ""
trigger:
  - platform: sun
    event: sunrise
    offset: 0
condition: []
action:
  - service: automation.turn_on
    data: {}
    target:
      entity_id: automation.flux_set_inverter_mode
mode: single

What would you simplify here? I bet there’s a lot

Did anyone else experienced a sudden change of Solax Aggregated export units from kWh to Wh?

From 31/05/2023 1PM GMT?