Solax X1 Hybrid G4 (local & cloud API)

maybe it will be useful for others to know that the time is stored in 2 bytes, but when read, the hours are in the first byte and the minutes are in the second (hours=value/256; minutes=mod(value/256); 6412 => 12:25) and vice versa when writing (value = hours*256+minutes; 12:25 => 3097)!

Hi, It has been a while but I’m still using this code in my HA setup. Since the latest update of HA however I get notifications (several, 12 to be exact), see the atached screenshot. What as happened?
error_solax_HA_sensors

I’m wondering why more people aren’t using it - no reliance at all on the cloud servers and you can poll as quickly as you like. I’ve been using for over 18 months with no issues at all :slight_smile:

I’ve been working on some automations and dashboards to control the inverter, some of you may find them useful. I’ve wrapped @kamilb work into a package to make things simple for adding to your configuration.yaml.

I’d appreciate any feed back/criticism.

A basic summary of what the automations/dashboard allow you to do:

  1. Change basic settings/modes on the inverter
  2. Control when your Zappi is allowed to get an octopus dispatch
  3. Export the battery daily/maually
  4. Prevent house battery discharging into the EV if the CT clamp can see the Zappi load
  5. Send notifications.
  6. Participate in Octoplus Saving Sessions/Free Electric (not tested)

Your Zappi must be the registered device with octopus (not your EV)

1 Like

I love it. Great work @RGx01 !

Since some days I’ve been having issue with powercalc that doesn’t give me correct restults. Am I the only one?

  sensors:
    - entity_id: sensor.solax_local_pv_output
      name: Solar Panels V2
      fixed:
        power: "{{ states('sensor.solax_local_pv_output')| int(default=0) }}"

    - entity_id: sensor.solax_cloud_solar_panel
      name: Solax Cloud Solar Panels V1
      fixed:
        power: "{{ states('sensor.solax_cloud_solar_panel')| int(default=0) }}"

    - entity_id: sensor.solax_cloud_battery_use_in
      name: Solar Cloud Battery In V1
      fixed:
        power: "{{states('sensor.solax_cloud_battery_use_in')}}"

    - entity_id: sensor.solax_cloud_battery_use_out
      name: Solar Cloud Battery Out V1
      fixed:
        power: "{{states('sensor.solax_cloud_battery_use_out')}}"

even if the expression “{{ states(‘sensor.solax_cloud_solar_panel’)| int(default=0) }}” return a value, the results of the sensor from powercalc is 0.

Any idea what to check? I didn’t modify anything, probably just updated powercalc

UPDATE: It seems it get the value when I restart HomeAssistant, but then it doens’t upate or it does for a short period of time

UPDATE 2: the behaviour seems related to version 1.17.7. Rolling back to 1.17.6 seem to fix the issue

Aren’t solax_cloud_solar_panel and solax_cloud_panels_v1_power the same thing? I’m using 1.17.7 and not seeing issues with energy calcs. I’m not calculating power like you seem to be.

Yes, the result should be the same power (W). It is just not updating after the startup of HA. It calculate the first time and not anymore until next restart.
Version 1.17.6 works perfectly

My point is that I’m not sure why you would create this sensor as it is already a real sensor.

The goal was to create an energy sensor from the power sensor to put it in the energy dashboard in HA. Honestly I followed this (and maybe others?) guide some years ago to set it up and it worked since then. I haven’t checked if there is any better way to do it.

Anyway some regression seems to be introduced with last version:

Hello,
I am not an expert in Home Assistant and not an expert in solar energy,
but only the owner of a small solar power plant (for my own needs).
I use a hybrid inverter - X1-Hybrid-LV
and I also have a Home Assistant installation on a Raspberry Pi 5.

I tried to research this and other articles and was able to get data from the inverter over a local network.
I have formed my findings in the form of a small GitHub project,

maybe it will be useful to someone.
I continue my research on obtaining and storing settings for my inverter.

I will be grateful for any feedback/criticism.

Hi @ank, I tried your template/s and not much aligns with the X1 hybrid g4. curious about the process you used to understand the data array returned in solax_local for your inverter. Perhaps I may be able to do the same for mine?

Hi @RGx01
I manually compared each value from the inverter data with Solax dashboard parameters.(https://global.solaxcloud.com/)

Hi Kamilb

Im relatively new to HA and trying to follow this and just not getting it working :( 

Do you have an idiots guide assume I have a clean install?
I have an X1-Hybrid-G4 with 3 batteries
Octopus Intelligent GO with Hub Mini
Ohme Pro charger
HA runs on direct on a Pi4 8GB

so any help you can be would be great

I managed to implement this relatively successfully, with a few changes. The only minor snag I’m running into at the moment is timeouts every hour or so, causing my entire solar dashboard to show ‘unavailable’, which is not ideal.

At the moment I’m thinking I may try to work around this by caching the last known good response, or I may just ignore the issue since it’s not exactly major. I’m open to suggestions if anyone has any! :slight_smile:

Cheers for the resources and writeup :+1:

I’ve made it a bit easier (I hope) to set up controlling X1-G4 inverters.
The readme contains instructions and usage examples.

I’m new to this device. I get an X1 Hybrid G4 with WiFi + LAN 2.0, but I can’t see it on my router, so I can’t get the IP address. The installer told me the IP has been hidden. He doesn’t know how to make it display.
Is anyone able to help me with that?
I can access the data from solaxcloud

6:24 in this video shows how a static IP can be assigned to wifi dongle. You probably need to watch the whole thing to get into the dongle https://youtu.be/RxQgU4mqZj0?t=385s Not my preferred way of doing it but without specifics about your router UI it’s difficult to describe. Principally on your router you would need to set a static IP for the MAC address of your dongle. If you have no idea what any of that means then try the video, failing that the installer needs help you or try googling how to set a static IP on your LAN for your brand of router. You still need the MAC address when doing this but the video should help get that.

Dongle firmware 1.010.04 was deployed to my system (unsolicited) and has broken local access. I believe the dongle now accepts HTTPS requests instead of HTTP. However the dongle won't accept the password (dongle serial number) and locks out after 5 attempts (rebooting the dongle resets the lockout). Any one have a work around?

Apparently "After consulting with our R & D colleagues, we've confirmed that the upgrade will render the previous API unusable. The method you've been using isn't part of our officially provided solutions; it was actually a loophole from before. Currently, for the local interface, the only option we offer externally is Modbus - TCP"