core icon indicating copy to clipboard operation
core copied to clipboard

Solaredge integration

Open Ranur opened this issue 2 years ago • 22 comments

The problem

The solar edge app seems to have changed how the data is named. The lifetime_energy as defined by HA is named lifeTimeData in the app. This is the data I get from the app "overview":{"lastUpdateTime":"2022-07-14 13:58:54","lifeTimeData":{"energy":1.0896296E7},"lastYearData":{"energy":1.0896725E7},"lastMonthData":{"energy":1281100.0},"lastDayData":{"energy":59001.0},"currentPower":{"power":15755.0},"measuredBy":"INVERTER"}} Has there been a change not caught by HA?

What version of Home Assistant Core has the issue?

core-2022-07-04

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Solaredge

Link to integration documentation on our website

https://www.home-assistant.io/integrations/solaredge/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

Ranur avatar Jul 14 '22 16:07 Ranur

Hey there @frenck, mind taking a look at this issue as it has been labeled with an integration (solaredge) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

I'm not seeing the issue you are trying to describe. Could you describe the issue this is causing?

frenck avatar Jul 14 '22 16:07 frenck

Hi I get data from the solaredge api, but only the currentPower. The sensor.solaredge_lifetime_energy however, show up as unknown. When looking at the solaredge API, I notice that it is called lifeTimeData and not "lifetime_energy" as in the HA code. Anyway - I do not get the data for solar production.

Ranur avatar Jul 14 '22 17:07 Ranur

For me solaredge API is working the same as before update - all normal.. maybe inverter has problem connecting to solaredge server? Do you see all info normal in solaredge app?

dolenec avatar Jul 14 '22 21:07 dolenec

Have stopped working for me also as of today. I can see all the data in the solaredge app and on the website. Everything worked fine yesterday. Is there any logs or else I could assist with? Running 2022.7.5.

masaha avatar Jul 17 '22 11:07 masaha

Nevermind my previous post, it has started working again this night. Probably an error at solaredge API side

masaha avatar Jul 18 '22 07:07 masaha

I see all info on the solar edge app When I run https://monitoringapi.solaredge.com/site/YOUR_SITE_ID/overview.json?api_key=YOUR_API_KEY I get "{"overview":{"lastUpdateTime":"2022-07-22 09:48:57","lifeTimeData":{"energy":1.1430624E7},"lastYearData":{"energy":1.1431174E7},"lastMonthData":{"energy":1815549.0},"lastDayData":{"energy":14349.0},"currentPower":{"power":3559.0},"measuredBy":"INVERTER"}}" So as you can seeI get the data. In HA however, the only data received is currentPower. The lifeTimeData is shown as unknown, and I wonder if it has to do with the sensor being named solaredge_lifetime_energy rather than lifeTimeDATA.

Ranur avatar Jul 22 '22 07:07 Ranur

erased my db and tried again. Do get production data but not the lifetime as I did previously. Also get lastyear/month now. But total production seems to be gone.

Ranur avatar Jul 22 '22 08:07 Ranur

I have the same problem. I get current power but no life time energy. See screen shot below. HA_solaredge_energy_issue

JSON response: {"overview":{"lastUpdateTime":"2022-07-25 12:00:12","lifeTimeData":{"energy":1685242.0,"revenue":2481.909},"lastYearData":{"energy":1685335.0},"lastMonthData":{"energy":1241580.0},"lastDayData":{"energy":3881.0},"currentPower":{"power":2585.086},"measuredBy":"INVERTER"}}

AndersHoglund avatar Jul 25 '22 10:07 AndersHoglund

There is a version issue in the SolarEdge API, the response to the "Inverter Technical Data" ("equipment") query has a "Lifetime energy" and other fields only supported starting communication board version 2.474. I have not found what version I may have anywhere, but I do not get any of the new 2.474 data fields. I only have "totalEnergy" etc fields. Hence I think I may have an older communication board version. If that matters for the Overview query used by this SolarEdge integration. Could you guys with a working integration try the equipment query and see if you get the "Lifetime energy" field.

AndersHoglund avatar Jul 26 '22 12:07 AndersHoglund

I think I found the problem. For some reason, SolarEdge reports lifeTimeData.energy smaller than lastYearData.energy. In my case 1685242W vs 1685335W. PRs #68048 and #69998 introduced a fix that requires energy values to be ordered lifeTime>lastYear>lastMonth>lastDay and this results in the behaviour we see in this report. Please @ulmerkott , can you take a look at this again. Thanks.

AndersHoglund avatar Jul 26 '22 15:07 AndersHoglund

I don't really know if this makes any sense for this thread but i got an entity that is enabled, but "Unknown". The entity name is 'sensor.solaredge_lifetime_energy' and the api gives an answer "lifeTimeData":{"energy":7553831.0,"revenue":98218.375}, I don't know if the difference in the naming could be a problem. Should it be solaredge_lifetimedata_energy maybe??

I got the problem like @AndersHoglund too. My yearly production is slightly higher than lifetime production. All HA components up to date.

SE10K inverter, CommPanel version: 4.14.107

See active data here:

{"overview":{"lastUpdateTime":"2022-07-27 09:26:25","lifeTimeData":{"energy":7553831.0,"revenue":98218.375},"lastYearData":{"energy":7554124.0},"lastMonthData":{"energy":1309224.0},"lastDayData":{"energy":10748.0},"currentPower":{"power":5716.108},"measuredBy":"INVERTER"}}

csomyy avatar Jul 27 '22 08:07 csomyy

@AndersHoglund You can check the Communication Panel version on the Solaredge monitoring site. Go to layout panel and select your inverter. In the toolbar az 'i' icon appears. Open it and there you can see your inverter data.

csomyy avatar Jul 27 '22 08:07 csomyy

Yeah, I have "Kommunikationskort (CPU) Version 4.15.119". But that number does not look anything like the format of the version number in the API spec. But this is not the issue at hand. Neither is entity name format, there is an internal HA name and an SE API name format, as I have understood it. Problem is the lifeTime and lastYear values differs in the wrong way and being trapped by this piece of code:

    # Sanity check the energy values. SolarEdge API sometimes report "lifetimedata" of zero,
    # while values for last Year, Month and Day energy are still OK.
    # See https://github.com/home-assistant/core/issues/59285 .
    if set(energy_keys).issubset(self.data.keys()):
        for index, key in enumerate(energy_keys, start=1):
            # All coming values in list should be larger than the current value.
            if any(self.data[k] > self.data[key] for k in energy_keys[index:]):
                LOGGER.info(
                    "Ignoring invalid energy value %s for %s", self.data[key], key
                )
                self.data.pop(key)

I will try to make a case on SolarEdge support to fix the energy values.

AndersHoglund avatar Jul 27 '22 09:07 AndersHoglund

Looks like the different value problem existed in other cases too but somehow the dev considered the problem done here: https://github.com/home-assistant/core/pull/69998

csomyy avatar Jul 27 '22 09:07 csomyy

Yeah, seems we have two problems with the lifeTimeData.energy value in the SE API. Value of zero and value less than lastYearData.energy. PR #68048 tried to fix the first and was later adjusted by #69998. We need either a new variant of this validation, or revert the two above, to fix our problem. Suggested fix:
if lifeTimeData.energy is less than lastYearData.energy, use lastYearData.energy else use lifeTimeData.energy Or wait till 2023 when the problem will probably go away....

BTW: SE case no: 3312126

AndersHoglund avatar Jul 27 '22 09:07 AndersHoglund

I am testing another integration, trying to avoid the problems with SolarEdge remote API. Instead using Solaredge MODBUS/TCP locally and the custom integration https://github.com/WillCodeForCats/solaredge-modbus-multi . There is also another alternative here: https://github.com/erikarenhill/solaredge-modbus-hass , not tested yet. At first, I could not get the Energy dashboard to accept the "Solaredge I1 AC Energy kWh" entity. Wrong icon, changed to the solar energy icon and now it all seems to work just fine.

AndersHoglund avatar Aug 01 '22 13:08 AndersHoglund

BTW: SE case no: 3312126

Do you have a link? I would follow that thread. Thanks!

csomyy avatar Aug 03 '22 12:08 csomyy

I am testing another integration ... using Solaredge MODBUS/TCP locally.

Does this eliminate the web telemetry? Or you need to set up the hotspot on the inverter only for the time of enabling modbus config?

csomyy avatar Aug 03 '22 12:08 csomyy

@csomyy Not much happening with the SE-case, and I think it is private. Stale, not any problem for me any more.

MODBUS/TCP is enabled by accessing the VR local AP Web service. Access is then over the normal VR network connection you have, ethernet cable or WiFi. Direct local connection from VR to HA. No remote SE web service API involved anymore. No special hotspot needed either.
Instructions in the link above.

AndersHoglund avatar Aug 03 '22 19:08 AndersHoglund

MODBUS/TCP Sadly i got no LAN connected on install of my system and the RJ45 socket is under the hood of my inverter. AND MODBUS/TCP is only available over cable and i'm not allowed to connect the cable because of the warranty. So no modbus for me. Waiting for the standard integration to get well, or for new years eve where lifetime and yearly yield values will move away from each other.

csomyy avatar Aug 09 '22 15:08 csomyy

Final response on SE case no 3312126 received. Case closed.

The data for lifeTimeData.energy and lastYearData.energy are sampled at different times asynchronously and the values can differ in this way. Nothing to be done about it at the SE end. So the validation logic in the HA integration must be adjusted to deal with this in a better way than current attempt.

Or use the MODBUS/TCP interface instead, as I do.

AndersHoglund avatar Sep 05 '22 14:09 AndersHoglund

Right now i got it working based on the online monitoring site. I'm using 'solaredge (Production Energy)' entity wich is a daily amount of energy. It works in the energy tab, however you cannot read out the total amounts. For me right now this is enough for the daily monitoring and data collection.

csomyy avatar Sep 06 '22 07:09 csomyy

Hi all, I was just about to file an issue myself before I found that one.

I have the same problem that the display of the lifetime energy data just stopped working. In my case that's due to the lifeTimeData energy now being returned in scientific notation (1.234567E7) instead of regular Wh like all other energy values. Looks like that applies to all energy values beyond a certain threshold on the REST API (smart...) and this is not expected by the integration.

If you force the "energy" value from the REST API to float, it worked again for me. If someone else could test and confirm, I might raise a PR.

https://github.com/home-assistant/core/blob/8792d664e7b8e7fe6ddf65e1430f8cab17f22cca/homeassistant/components/solaredge/coordinator.py#L85

Change that line to

data = float(value["energy"])

and restart homeassistant

golden-guy avatar Nov 19 '22 20:11 golden-guy

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.