Solax X1 Hybrid G4 (local & cloud API)

Ubuntu Linux.

Hi,
Really like this. I just had solar installed and this is the first time I have used home assistant.
Not fully setup powercalc however the automation triggered last night and failed due to this error - Any ideas what the issue is?

Battery - Disable forced charge uses an unknown service
The automation "Battery - Disable forced charge" (automation.battery_disable_forced_charge) has an action that calls an unknown service: rest_command.solax_local_set_forced_charge_start.

Set Solar Battery Target Level uses an unknown service
The automation "Set Solar Battery Target Level" (automation.set_solar_battery_target_level) has an action that calls an unknown service: rest_command.solax_local_set_charge_battery_from_grid.

type or paste code here

Solved it! The register numbers for ‘setReg’ are not a zero-based array, they’re a 1-based array. So it’s 28 and 36 to set, rather than the 27 and 35 that I read!
Gotta love Solax, feels like they’re never knowingly logical or consistent.

That looks like HA doesn’t know those REST commands, which suggests they’re not in your configuration or the names are mis-typed. Have you added kamilb’s rest_command definitions to your configuration somewhere and did you reload or restart HA after adding them?

If you think they’re okay, enable the developer tools and try calling the service from the services page there.

I’ve implemented the Solax local settings and these are great - thank you! I’m on Intelligent Octopus so when my car is charging, to stop the battery discharging I set the Minimum State of Charge to 100% - this works fine! However, when the car stops charging and I go to reset the minimum State of Charge parameter back to the usual 10% it fails. Looking into this in more detail, it fails because the inverter has gone into idle mode. According to Solax, idle mode will be exited when either the battery starts charging (this won’t happen as it’s at 100%) or the PV starts generating power - but at 6:00am it’s dark!! Is there a way I can stop it going into idle mode or alternatively is there another way to stop the battery discharging whilst the car is charging!?

Bonjour à tous

Merci Kamilb pour tous vos recherches, elle mon été très bénéfique.
J’ai démarré Home assistante il y a 6 mois et je m’intéresse sur la suite de l’intégration avec la gestion intelligente de la batterie.
Cependant je ne comprends pas pourquoi mon code ne fonctionne pas.
Je souhaite juste passer l’état :

  • “solax_local_set_inverter_mode”
    - “Self Use” vers “Manual” respectivement “0” vers “3”
    -“solax_local_set_manual_mode_behaviour”
    - “Do Nothing” vers “Forced charge” respectivement “0” vers “2”

Comme je ne suis pas alèse avec le codage j’utilise NODE-RED pour tous les déclanchement et gestion qui suivrons.

- id: '3008'
  alias: Battery - Saving Sessions - Return to Self-Use
  description: Stop forced discharge and return to normal operation
  trigger:
  - platform: time
    at: '17:30:00'
  condition:
  - condition: template
    value_template: '{{ (states(''sensor.solax_local_inverter_mode'') == ''Manual''
      ) }}    '
  action:
  - repeat:
      sequence:
      - delay:
          hours: 0
          minutes: 0
          seconds: 15
          milliseconds: 0
      - service: rest_command.solax_local_set_inverter_mode
        data:
          value: '{{ 0 }}

            '
      - delay:
          hours: 0
          minutes: 0
          seconds: 15
          milliseconds: 0
      - service: rest_command.solax_local_set_manual_mode_behaviour
        data:
          enabled: '{{ 0 }}

            '
      - delay:
          hours: 0
          minutes: 0
          seconds: 15
          milliseconds: 0
      - service: homeassistant.update_entity
        entity_id: sensor.solax_rest_local_settings
      until:
      - condition: template
        value_template: '{{ (states(''solax_local_manual_mode_behaviour'') == ''Do
          Nothing'' and states(''sensor.solax_local_inverter_mode'') == ''Self Use'')
          or repeat.index == 3 }}'
  mode: single

Pour information si je modifie a la main les paramètre sur l’onduleur ou sur solax cloud j’ai bien les modification des ID suivent:
- “sensor.solax_local_inverter_mode”
- “sensor.solax_local_manual_mode_behaviour”
- “sensor.solax_local_manual_mode_behaviour”

Je ne comprends pas trop mon erreur ci quelqu’un veux bien prendre de temps de me lire merci a vous :slight_smile:

@doudou49000 I’ve described changing the modes in this article - maybe this will help: Automated Octopus Saving Sessions with Solax X1 Hybrid G4

Merci Kamilb
La seule erreur que j’avais c’était le PWD :frowning:
je vais pourvoir avancer.

@kamilb really thanks for the help to integrate solax into Home Assistant, i followed your instruction and i have no issue haveing both cloud and local values, but… after a system restart i don’t see cloud values, only local and i don’t know how to debug it…

image

The url for cloud values is working of course…

Amazing work! Used all your insights to build my own automation for X1 G4.
Have you found a way to update advanced settings registers via local API. Due to cold weather I’m looking to automate battery heating management, however API always response with failed status.

I use a different solution that is totally local and uses TCP.

This is what I get to play with for battery heating :

image

image

Here’s the link (do not assume it is modbus only like others have - it is 100% TCP compliant as well and I use it with PocketWifi)

https://github.com/wills106/homeassistant-solax-modbus

It installs through HACS and all you need for TCP is the IP address it has on your network. That’s it. Simple.

I poll every 5 seconds :slight_smile:

Thanks for the reference. I’ve read your comments on Modbus and tried it. But for some reason it shows Disabled even when I enable it via the app. I’m a bit concerned about reliability of Modbus over tcp that I saw in several discussions. So I decided to go with http api.
I’ve sorted the issue - totally forgot that with HTTP API reading and writing registers are zero-based and not zero-based accordingly.
Now it’s working perfectly

Glad you got it sorted. I’ve been using the modbus/tcp solution for almost 12 months and have had zero issues :slight_smile:

1 Like

That’s interesting, that’s different to how my SolaX behaves. I have two inverters - the one with the battery is always online. What model is yours? It seems that no two SolaX models behave the same way!
Another way to achieve what you want, is to change the operating mode to ‘backup’ while charging the car. That should stop the battery discharging unless the grid power fails. Then set it back to ‘self-use’ when done.
Whether that will keep the inverter online for API access, though, only testing will find out!

I have found the problem:
image
The sensor does not exist even if is in the sensor.yaml with “solax_rest_local” and “solax_rest_local_settings” (both working)… any suggestion?
Thanks for all

Problem solved adding some other sensor to sensor.yaml… i haven’t touch the solax_rest_cloud sensor…i don’t understand…

Hi, Solax Hybrid G4 7.5kw with pocket LAN 3.0 works with Home Assistant ? Can I use official integration?

Thanks a lot

@kamilb thank you so much for your guide. I’ve just got a Solax system and the dongle’s open SSID just really freaked me out.

I came across this reverse engineering repo to get the local data translation. Have you had a look at it? https://github.com/nazar-pc/solax-local-api-docs/blob/fe4d46346fb3936963e8c31ada53b870f0d73b61/Data2.txt

Witam. U mnie też działają sensory. Mam tylko jedno pytanie, czy można to pokazać w jakiś ładnych wykresach.

Been trying to get this to work but keep getting 401 unauthorized error message, I’ve changed the REG_NO and can access the inverter using a web browsers on the same network, only thing is, it doesn’t ask for a password to access the site and I think this might be complicating the process? any thoughts as I’m slowly going out my mind!

I’ve tried admin, ADMIN, Admin, the inverter 4 digit pin, blank (removing the pwd prompt) and all sorts… this really is the last part of a puzzle as we use Agile and I would really like some intelligence as to when the batteries are charging etc

(full error code content: “\r\n\r\nError\r\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">\r\n\r\n

401 Unauthorized.

\r\n”
status: 401)