New binding available: SolarEdge binding

Hi @philipsduff,

I will have to wait a long time before we’ll get > 1kW again. :slight_smile: But we’re currenctly getting ~0.2 kW. No rounded values, it seems, I’m getting the same values that I see in the SolarEdge webinterface.

Today we have a bit of clear sky in Greece so can give you this

2017-11-19 10:46:25.632 [ItemStateChangedEvent     ] - Solaredge_live_Production changed from 1 to 2
2017-11-19 10:56:26.064 [ItemStateChangedEvent     ] - Solaredge_live_Production changed from 2 to 1
2017-11-19 11:01:25.500 [ItemStateChangedEvent     ] - Solaredge_Day_Production changed from 2.09 to 2.57
2017-11-19 11:01:25.524 [ItemStateChangedEvent     ] - Solaredge_Month_Production changed from 271.63 to 272.11
2017-11-19 11:01:25.532 [ItemStateChangedEvent     ] - Solaredge_Week_Production changed from 54.86 to 55.34
2017-11-19 11:06:26.191 [ItemStateChangedEvent     ] - Solaredge_live_Production changed from 1 to 2

I remember noticing that the live production value under 1KW was showing in the panel as 678KW (instead of 0,68KW which would be appropriete)

@philipsduff:
I have fixed an issue. The parser did not accept decimals but only integer values therefore the result was wrong in some cases. I have fixed this now. Hopefully all issues are gone now.

@sirpreis: As philipsduff uses the legacy mode he runs different code therefore he has issues that do not occour in your setup.

BR
Alex

Hi @AlexF,

I have tested it and Legacy mode is fully working now.
Thank you so much. :slight_smile:

Best regards.
Javier.

Hi, i’m really excited about this binding, but i have some questions:

First:

as soon as i add items, i got a bunch of errors like this:

20:36:26.286 [ERROR] [org.eclipse.smarthome.core.id        ] - FrameworkEvent ERROR - org.eclipse.smarthome.core.id
org.osgi.framework.ServiceException: Exception in org.apache.felix.scr.impl.manager.SingleComponentManager.getService()
20:36:26.311 [ERROR] [org.eclipse.smarthome.core.id        ] - BundleComponentActivator : Bundle [114] Unexpected failure enabling component holder org.eclipse.smarthome.core.id
java.lang.NoClassDefFoundError: org/eclipse/smarthome/io/rest/RESTResource
20:36:26.481 [ERROR] [org.eclipse.smarthome.core.id        ] - FrameworkEvent ERROR - org.eclipse.smarthome.core.id
org.osgi.framework.ServiceException: Exception in org.apache.felix.scr.impl.manager.SingleComponentManager.getService()
20:36:41.624 [ERROR] [org.eclipse.smarthome.core.id        ] - FrameworkEvent ERROR - org.eclipse.smarthome.core.id
org.osgi.framework.ServiceException: Exception in org.apache.felix.scr.impl.manager.SingleComponentManager.getService()
20:36:49.262 [ERROR] [org.eclipse.smarthome.io.rest.sse    ] - FrameworkEvent ERROR - org.eclipse.smarthome.io.rest.sse
org.osgi.framework.BundleException: Exception in org.eclipse.smarthome.io.rest.sse.internal.SseActivator.start() of bundle org.eclipse.smarthome.io.rest.sse.
20:36:52.076 [ERROR] [.core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-package-standard': Error restarting bundles:
        Exception in org.eclipse.smarthome.io.rest.sse.internal.SseActivator.start() of bundle org.eclipse.smarthome.io.rest.sse.
20:37:07.126 [ERROR] [org.eclipse.smarthome.io.rest.sse    ] - FrameworkEvent ERROR - org.eclipse.smarthome.io.rest.sse
org.osgi.framework.BundleException: Exception in org.eclipse.smarthome.io.rest.sse.internal.SseActivator.start() of bundle org.eclipse.smarthome.io.rest.sse.
20:37:07.282 [ERROR] [core.internal.events.OSGiEventManager] - Dispatching/filtering event for subscriber 'org.eclipse.smarthome.core.events.EventSubscriber' failed: java.lang.ClassCastException: org.eclipse.smarthome.config.discovery.internal.DiscoveryResultImpl cannot be cast to org.eclipse.smarthome.config.discovery.DiscoveryResult

But everythings is working as you can see in the log:

20:36:27.391 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model 'solaredge.things'
20:36:27.834 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'solaredge:generic:SE7K' changed from UNINITIALIZED to INITIALIZING
20:36:29.065 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model 'solaredge.items'
20:36:29.093 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'PVProdDay-solaredge:generic:SE7K:aggregate_day#production' has been added.
20:36:29.098 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'PVProdWeek-solaredge:generic:SE7K:aggregate_week#production' has been added.
20:36:29.102 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'PVProdMon-solaredge:generic:SE7K:aggregate_month#production' has been added.
20:36:29.106 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'PVProdYear-solaredge:generic:SE7K:aggregate_year#production' has been added.
20:36:29.818 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'solaredge:generic:SE7K' changed from INITIALIZING to ONLINE: logged in
20:36:30.999 [INFO ] [smarthome.event.ItemStateChangedEvent] - PVProdMon changed from NULL to 115.17
20:36:31.001 [INFO ] [smarthome.event.ItemStateChangedEvent] - PVProdDay changed from NULL to 2.15
20:36:31.003 [INFO ] [smarthome.event.ItemStateChangedEvent] - PVProdYear changed from NULL to 5628
20:36:31.004 [INFO ] [smarthome.event.ItemStateChangedEvent] - PVProdWeek changed from NULL to 35.07

When i remove the .items the errors dont occur, but i still get a warning about cookies:

20:18:00.092 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'solaredge:generic:SE7K' changed from INITIALIZING to ONLINE: logged in
20:18:00.975 [WARN ] [redge.internal.connector.WebInterface] - Session-Cookie not found: SPRING_SECURITY_REMEMBER_ME_COOKIE
20:18:00.983 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'solaredge:generic:SE7K' changed from ONLINE: logged in to OFFLINE (COMMUNICATION_ERROR): Session-Cookie not found: SPRING_SECURITY_REMEMBER_ME_COOKIE
20:18:02.085 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'solaredge:generic:SE7K' changed from OFFLINE (COMMUNICATION_ERROR): Session-Cookie not found: SPRING_SECURITY_REMEMBER_ME_COOKIE to ONLINE: logged in

My .items:

Number PVProdDay  "Produktion Tag [%.2f kWh]"     <solarplant> {channel="solaredge:generic:SE7K:aggregate_day#production"}
Number PVProdWeek "Produktion Woche [%.0f kWh]"   <solarplant> {channel="solaredge:generic:SE7K:aggregate_week#production"}
Number PVProdMon  "Produktion Monat [%.0f kWh]"   <solarplant> {channel="solaredge:generic:SE7K:aggregate_month#production"}
Number PVProdYear "Produktion Jahr [%.0f kWh]"    <solarplant> {channel="solaredge:generic:SE7K:aggregate_year#production"}

Second:

I cannot set the logging level to DEBUG like mentioned here https://community.openhab.org/t/new-binding-available-solaredge-binding/34852/7
The existing entries in my org.ops4j.pax.logging.cfg file start with log4j2 instead of log4j

Third

Why is this binding not in the openhab2-addons included?
Is this planed in the future?

I’m running OH2.2 snapshot #1098 on raspbian, legacy mode is not enabled

Hi,

in the first snippet I cannot see any refernece to the solaredge binding so I do not have any idea if this is really related to the binding.
The second snippet looks very good values are retrieved.
In the thirs snippet there is a warning that typically occours on startup because the binding has not yet logged in to the solaredge web interface. If this warning is repeated several times and the binding keeps is changing between online and offline all the time then this should be investigated.

Regarding the log configuration: Maybe the logger was changed from log4j to log4j2. Just try the new prefix it should then log with DEBUG.

The binding is quite new and not yet integrated into the official distribution. It needs to pass several quality checks and this takes some time as there is a quite long queue of new bindings or feature extensions waiting for integration.

BR
Alex

Hi Alex,

thanks for the infos… i’ll try to get the logging to DEBUG level tonight.

in the first snippet I cannot see any refernece to the solaredge binding so I do not have any idea if this is really related to the binding.

Here is the full log after a clean startup with thing and items of your binding added:
logSolaredgeBinding.css (81.0 KB)
I changed the file extension from .txt to .css to be able to upload the file…

I’m pretty sure the errors are somehow connected to the binding, because i can “switch” ALL OF THEM on/off by adding/removing the items of it. In both cases my thing is present and untoched.

When i do so, there is no logging at all anymore.
But i can type log:set DEBUG org.openhab.binding.solaredge in the karaf console and i get the debug logging.

But with this workaround it is not possible to see the startup errors and the debug messages

Ok, i’m still having those errors, but lets see if they are gone in future releases…
But i have one last important thing:
I only have updates of the aggregate data, there is no data for live production.
My item:

Number PVProdLive "Produktion Live [%.2f kW]" {channel="solaredge:generic:SE7K:live#production"}

Log:

20:34:43.515 [DEBUG] [edge.handler.SolarEdgeLiveDataPolling] - polling SolarEdge live data org.openhab.binding.solaredge.config.SolarEdgeConfiguration@1c9c504[username=secret,password=secret,solarId=1111111,legacyMode=false,live data pollingInterval=30,aggregate data pollingInterval=300,asyncTimeout=120,syncTimeout=120]
20:34:43.624 [DEBUG] [redge.internal.command.LiveDataUpdate] - received content, length: 27
20:34:43.629 [DEBUG] [redge.internal.command.LiveDataUpdate] - HTTP response 200
20:34:43.633 [DEBUG] [redge.internal.command.LiveDataUpdate] - onComplete()
20:34:43.637 [DEBUG] [redge.internal.command.LiveDataUpdate] - JSON String: {"siteCurrentPowerFlow":{}}

Any ideas?

Please switch to legacy Mode. It should then show live data.

Alright now i see the live data, thank you very much!
I ordered a smartmeter and will install it soon.
Is my setup then compatible with the non-legacymode, so i can see the import/export/etc values as well?

I have installed this solaredge modbus meter which is connected to my inverter (I have a SE2200).

This setup is supported by the solaredge binding. If you install any other meter which is not connected to the inverter it will not be supported.

I ordered exacly the same type of the modbus adapter, My inverter is a SE7K.
So the SolarEdge Monitoring Portal will change its view after setup the modbus adapter?
And i guess this is the reason of the legacymode?

Thank you for the great binding. It works for me and I’m glad it does not use the API because it has a real drawback. Only 300 calls per day are allowed. Thus, no live evaluation is possible.

When displaying in Grafan I unfortunately get a problem with the field BatterCharge, because it also assumes negative values. This is of course technically correct and I am aware that it is unloaded. Is there a way to represent the loading and unloading of two values? If not I would try it over a rule in openhab.

Yes thank you from me also for this binding. I just got my system installed and this had me up and running in no time!

Ive a RGB led changing colour based off import/export amounts.

Next bit is to run the pool pump to use the excess power.

@mimuni:
Good to know that the api has limited calls per day. I implemented the binding this way because I do not have access to the administration to create an api key.
It should be possible to store charge and discharge rate in separate channels I will implement this in a later version.

@mimuni:
I have now added separate channels for charging / discharging. The combined channel is also still available.

Hello Alex,
thanks you for the binding. I have installed it and it works, exept that i have a number conversion issue.

Here are the log entry of my data:

2018-01-03 11:36:07.682 [vent.ItemStateChangedEvent] - Photovoltaik_Live_Production changed from NULL to 288
2018-01-03 11:38:11.415 [vent.ItemStateChangedEvent] - Photovoltaik_Live_Production changed from 288 to 168
2018-01-03 11:42:37.861 [vent.ItemStateChangedEvent] - Photovoltaik_Live_Production changed from 168 to 128
2018-01-03 11:48:11.976 [vent.ItemStateChangedEvent] - Photovoltaik_Live_Production changed from 128 to 0.15
2018-01-03 11:52:12.317 [vent.ItemStateChangedEvent] - Photovoltaik_Live_Production changed from 0.15 to 54
2018-01-03 11:57:38.128 [vent.ItemStateChangedEvent] - Photovoltaik_Live_Production changed from 54 to 0
2018-01-03 12:02:19.016 [vent.ItemStateChangedEvent] - Photovoltaik_Live_Production changed from 0 to 0.06
2018-01-03 12:12:53.731 [vent.ItemStateChangedEvent] - Photovoltaik_Live_Production changed from 0.06 to 102
2018-01-03 12:16:08.610 [vent.ItemStateChangedEvent] - Photovoltaik_Live_Production changed from 102 to 0.04

I used the latest Version from the link. I used it with openhabian on a raspberry. Any suggestions on this Topic?

Thanks
Herb

Hi Herb,

this seems to be an issue related to the automatic unit conversion that is implemented in the binding.
To solve this I need some more details:

  1. Is “legacy mode” enabled in your setup?
  2. I need the RAW data which will be visible in the logs in DEBUG mode (line should contain “JSON String” or “RAW String” depending on the legycy mode setting)

BR
Alex

Hello Alex,
i use “legacy mode”. The site is in german. Maybe that makes a Problem with the conversion. The RAW string is

RAW String: Ext.apply(SE.labels,{overViewPanel:SE.labels.OverViewPanel,overViewPanel1:SE.labels.OverViewPanel1});(function(){varshowCurrentPower=false;if(!SE.isPublic&&SE.Params.hasSEMInDashboard&&SE.permissions.DashboardPowerFlow)showCurrentPower=false;elseshowCurrentPower=true;if(SE.isPhone){showCurrentPower=false;};vardata={lastDayEnergy:“1,96kWh”,lastMonthEnergy:“18,87kWh”,lifeTimeEnergy:“28,39MWh”,formatedRevenue:“3.406,7€”};if(showCurrentPower){Ext.apply(data,{currentPower:“2,47kW”});}varoverViewPanel={showLifeTimeRevenue:true,showCurrentPower:showCurrentPower,data:data};Ext.apply(SE.Params,{overViewPanel:overViewPanel});})();Ext4.define(‘SE.AbsOverViewPanel’,{extend:‘Ext.panel.Panel’,layout:{type:‘hbox’},cls:‘se-overview-panel’,params:SE.Params.overViewPanel,statics:{create:function(params){returnSE.createCmp(‘SE.OverViewPanel’,params);}},adjustLastItemCSS:function(){varlastItem=this.items[this.items.length-1];lastItem.cls=‘se-site-filter-panel-cell-end’;lastItem.style=‘border-right:none’;},createTodayEnergyCell:function(){this.TodayEnergyCell=SE.createCmp(‘SE.OverviewPanelCell’,{id:‘se-today-energy’,cellId:‘TodayEnergy’,text:this.labels.todayEnergy,_data:this.data.lastDayEnergy});this.items.push(this.TodayEnergyCell);},createThisMonthEnergyCell:function(){this.ThisMonthEnergyCell=SE.createCmp(‘SE.OverviewPanelCell’,{id:‘se-this-month-energy’,cellId:‘ThisMonthEnergy’,text:this.labels.thisMonthEnergy,_data:this.data.lastMonthEnergy});this.items.push(this.ThisMonthEnergyCell);},createLifeTimeEnergyCell:function(){this.LifeTimeEnergyCell=SE.createCmp(‘SE.OverviewPanelCell’,{id:‘se-life-time-energy’,cellId:‘LifeTimeEnergy’,text:this.labels.lifeTimeEnergy,_data:this.data.lifeTimeEnergy});this.items.push(this.LifeTimeEnergyCell);},createCurrentPowerCell:function(){this.CurrentPowerCell=SE.createCmp(‘SE.OverviewPanelCell’,{id:‘se-current-power’,cellId:‘CurrentPower’,text:this.labels.currentPower,_data:this.data.currentPower});this.items.push(this.CurrentPowerCell);},createLifeTimeRevenueCell:function(){this.LifeTimeRevenueCell=SE.createCmp(‘SE.OverviewPanelCell’,{id:‘se-life-time-revenue’,cellId:‘LifeTimeRevenue’,text:this.labels.lifeTimeRevenue,_data:this.data.formatedRevenue});this.items.push(this.LifeTimeRevenueCell);},update:function(data){if(this.params.showCurrentPower){this.CurrentPowerCell.dataPanel._data.setHtml(data.currentPower);}this.TodayEnergyCell.dataPanel._data.setHtml(data.lastDayEnergy);this.ThisMonthEnergyCell.dataPanel._data.setHtml(data.lastMonthEnergy);this.LifeTimeEnergyCell.dataPanel._data.setHtml(data.lifeTimeEnergy);if(this.params.showLifeTimeRevenue){this.LifeTimeRevenueCell.dataPanel._data.setHtml(data.formatedRevenue);}}});Ext4.define(‘SE.OverViewPanel’,{extend:‘SE.AbsOverViewPanel’,labels:SE.labels.overViewPanel,width:300,addTitle:true,initComponent:function(){if(this.addTitle)this.title=this.labels.overview;this.data=SE.Params.overViewPanel.data;this.items=[];if(this.params.showCurrentPower){this.createCurrentPowerCell();}this.createTodayEnergyCell();this.createThisMonthEnergyCell();this.createLifeTimeEnergyCell();if(this.params.showLifeTimeRevenue){this.createLifeTimeRevenueCell();}this.adjustLastItemCSS();this.callParent(arguments);}});Ext4.define(‘SE.AbsOverviewPanelCell’

It is just the start of the line. But in the currentPower string is 2,47 and the binding makes 2 instead of 2,47.

BR
Herb