[RE-RELEASE] Fronius Solar Inverter Driver for Hubitat

Hi All, I've forked the Fronius Inverter Driver from @Sebastien and others to make the following improvements:

  • Updated to convert Watt hours to Kilowatt hours
  • Added Dashboard tile
  • Published to HPM for easier access

Dashboard tile:
SCR-20240528-lyym

HPM:

If folk have any other suggestions, I'd be happy to consider adding them (assuming my limited skills can handle them).

Cheers Derek

5 Likes

UPDATES:

2024-05-28 - v2.1.0 - Converted Lifetime Energy to Megawatt hours for improved legibility

2024-05-29 - v2.2.0 - I realised I could have reused some existing functions, so I've rewritten a few bits to make the code more efficient. I also changed generation for this year to MWh's as this number can get pretty big too.
SCR-20240529-muhw

2024-08-24 -v2.3.0 - added GEN24 Inverter compatibility mode

SCR-20240824-kkjr

2 Likes

v2.2.0 has been released (notes above).

1 Like

Hi Derek
I have not been able to get this working on my recently installed Fronius Gen24 Primo inverter.
I have connected the inverter directly to my network via a LAN cable and I have activated the Solar API on the Inverter interface (which I can access via the LAN IP address in a web interface).
I have used the most recent code v2.2.1 for my device driver with the following settings:
Inverter Number set to 1 (although I am not sure this makes too much difference)
IP address is address of the LAN connection for the Inverter
Port set to 80
I have also set the "device name" as it appears on my network.
Are there any steps I am missing? Or any settings I require on the Inverter itself?

Howdy, device name is just for Hubitat use only, you can call it whatever you like.

The IP address and port is just whatever you use to connect to your data manager as per below:

After going through my inverter config, I can’t see anything that needs to be turned on to enable the local API, so I assume it’s in by default.

When I initially updated the code, it was to enable it to support my generation of the inverter. I wonder if there might be some changes in the Gen24 Primo version of the API that make it not work…?

@dave.webby, Turning on debugging and sharing the logs might help. I think I left all of the debug code that allowed me to make it work with my version, so unless @dJOS removed it in the latest and much improved version, it might help identify the issue.

1 Like

I don’t think I removed any debug code, just turning on debug logging should enable it.

PS, my improvements were quite minor, you and others did all the hard work.

1 Like

Thanks @Sebastien and @dJOS. The issue appears to be a connection issue so might be due to a change in API of the Inverter.

On the inverter side, the manual states that the Solar API is ethernet based (I have wired in an ethernet cable to my network). I have also activated communication via Solar API on the Inverter interface:


I can access the Inverter via a web interface on my network using both the wifi IP and the LAN IP. The ethernet cable is connected to LAN1 connector on the Inverter (this was done by the Solar technician).

Here are my Hubitat device settings:

Regards

Hmm, it looks like they have a new API for your series inverter. I’d need to look up the spec to see if we can support it.

Sadly I am not that familiar with the scripting language which is used for the driver code.
I really appreciate the smarter people than me helping out!
I did run the two commands that you have in the device driver script in a browser and did get a return from the Inverter:


Not sure if this helps. At least the data buckets look the same and also shows that the information is able to be called from inverter from my network.

Incidentally the /solar_api/GetAPIVersion.cgi command retuns the following:
{
"APIVersion" : 1,
"BaseURL" : "/solar_api/v1/",
"CompatibilityRange" : "1.7-10"
}

Link for the API for Gen24

Interesting, If you replace “80” in the port section of the driver with:

/solar_api/v1/GetInverterInfo.cgi

Does the driver ingest the data?

Edit: ignore that, it won’t work - that should be very easy to add support for. But I’m still recovering from eye surgery and can’t spend much time on my computer till I get my new glasses (hopefully later this week).

That isnt returning radically different data from my Primo 5.01:

{
   "APIVersion" : 1,
   "BaseURL" : "/solar_api/v1/",
   "CompatibilityRange" : "1.8-1"
}

Inverter Info:

{
   "Body" : {
      "Data" : {
         "1" : {
            "CustomName" : "Primo 5.0-1 (1)",
            "DT" : 76,
            "ErrorCode" : 0,
            "PVPower" : 5400,
            "Show" : 1,
            "StatusCode" : 7,
            "UniqueID" : "556173"
         }
      }
   },
   "Head" : {
      "RequestArguments" : {},
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2024-08-04T14:37:12+10:00"
   }
}

So I'm honestly surprised that it doesn't work as is - It's possible the "InverterState" or "Secondary Meters" fields are tripping it up, but I wouldn't have thought that it would matter, as the driver ignores other fields/sections and only looks for the fields in the sections it's told to (which have the same formatting as mine).

{
   "Body" : {
      "Data" : {
         "Inverters" : {
            "1" : {
               "DT" : 76,
               "E_Day" : 13915,
               "E_Total" : 15119900,
               "E_Year" : 3711509.75,
               "P" : 2235
            }
         },
         "Site" : {
            "E_Day" : 13915,
            "E_Total" : 15119900,
            "E_Year" : 3711509.75,
            "Meter_Location" : "grid",
            "Mode" : "meter",
            "P_Akku" : null,
            "P_Grid" : -980.90999999999997,
            "P_Load" : -1254.0900000000001,
            "P_PV" : 2235,
            "rel_Autonomy" : 100,
            "rel_SelfConsumption" : 56.111409395973169
         },
         "Version" : "12"
      }
   },
   "Head" : {
      "RequestArguments" : {},
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2024-08-04T14:34:32+10:00"
   }
}

@dave.webby Just out of curiosity, what happens if you remove "?Scope=System" from the driver on line 179, hit save and the poll the inverter from the driver?

I've read through the doco you provided, and I'm really struggling to see what is causing the timeout error you are seeing. :thinking:

The only thing I can think of is that some inverters dont support those additional parameters for that API call. In the doco you provided, I can only see that parameter supported for the GetArchiveData call.

That does not seem to make any difference.
Device is still timing out.

I am curious if the destination port is actually required. I certainly do not need this when running the commands from a browser?

It’s not, but port 80 is the default http port anyway, so it shouldn’t make any difference.

One thing you could try to rule out your hub as the issue (as is to makes sure there isn’t something in your network blocking the response getting to your hub), is to write an RM rule to pull the data into a local variable. Eg:

Very odd, I really can’t explain the timeout error. I’ll look into it some more as I’m able.

Hi Derek

My name is Will and I've been helping Dave with Hubitat.

I was looking at the Fronius GitHub code for Home Assistant. It's a different programming language, but there is a clue.

There has been special code added for Fronius Gen24 models with the comment that "Gen24 don't provide GetLoggerInfo". Maybe that will mean something to you guys.

See line 51 of the code here... core/homeassistant/components/fronius/config_flow.py at dev · home-assistant/core · GitHub

1 Like