New binding available: SolarEdge binding

I’m not sure why, but I’m getting two calls to the API one minute apart? I’ve set the live polling interval to 10 minutes, and each of these live calls is happening every 10 minutes. I’d completely wiped my setup and any links, I can see in the logs the Thing being initialised only once, so not sure why the second call is being triggered?


2018-06-28 10:09:03.433 [DEBUG] [dge.handler.SolarEdgeLiveDataPolling] - polling SolarEdge live data org.openhab.binding.solaredge.config.SolarEdgeConfiguration@147bcc7[tokenOrApiKey=GeneratedAPIKey,solarId=123456,meterInstalled=false,usePrivateApi=false,live data pollingInterval=10,aggregate data pollingInterval=120,asyncTimeout=120,syncTimeout=120]
2018-06-28 10:09:05.190 [DEBUG] [nal.callback.AbstractCommandCallback] - received content, length: 271
2018-06-28 10:09:05.195 [DEBUG] [nal.callback.AbstractCommandCallback] - HTTP response 200
2018-06-28 10:09:05.198 [DEBUG] [nal.callback.AbstractCommandCallback] - onComplete()
2018-06-28 10:09:05.202 [DEBUG] [nal.callback.AbstractCommandCallback] - JSON String: {"overview":{"lastUpdateTime":"2018-06-28 09:56:50","lifeTimeData":{"energy":4143099.0,"revenue":384.4251},"lastYearData":{"energy":3842267.0},"lastMonthData":{"energy":457852.0},"lastDayData":{"energy":2372.0},"currentPower":{"power":1855.4329},"measuredBy":"INVERTER"}}
2018-06-28 10:09:05.212 [DEBUG] [laredge.handler.SolarEdgeBaseHandler] - Handling channel update.
2018-06-28 10:09:05.217 [DEBUG] [laredge.handler.SolarEdgeBaseHandler] - Channel is to be updated: aggregate_year#production: 3842.27
2018-06-28 10:09:05.222 [DEBUG] [laredge.handler.SolarEdgeBaseHandler] - Channel is to be updated: live#production: 1.86
2018-06-28 10:09:05.230 [DEBUG] [laredge.handler.SolarEdgeBaseHandler] - Channel is to be updated: aggregate_day#production: 2.37
2018-06-28 10:09:05.241 [DEBUG] [laredge.handler.SolarEdgeBaseHandler] - Channel is to be updated: aggregate_month#production: 457.85
2018-06-28 10:09:05.249 [DEBUG] [laredge.handler.SolarEdgeBaseHandler] - Channel is to be updated: aggregate_week#production: 0.0
==> /var/log/openhab2/events.log <==
2018-06-28 10:09:05.249 [vent.ItemStateChangedEvent] - SE5000H_Live_Production changed from 2.2 to 1.86
2018-06-28 10:09:05.271 [vent.ItemStateChangedEvent] - SE5000H_Today_Energy changed from 2.03 to 2.37
==> /var/log/openhab2/openhab.log <==
2018-06-28 10:10:00.163 [DEBUG] [dge.handler.SolarEdgeLiveDataPolling] - polling SolarEdge live data org.openhab.binding.solaredge.config.SolarEdgeConfiguration@1bfd7b7[tokenOrApiKey=GeneratedAPIKey,solarId=123456,meterInstalled=false,usePrivateApi=false,live data pollingInterval=10,aggregate data pollingInterval=120,asyncTimeout=120,syncTimeout=120]
2018-06-28 10:10:00.961 [DEBUG] [nal.callback.AbstractCommandCallback] - received content, length: 271
2018-06-28 10:10:00.970 [DEBUG] [nal.callback.AbstractCommandCallback] - HTTP response 200
2018-06-28 10:10:00.972 [DEBUG] [nal.callback.AbstractCommandCallback] - onComplete()
2018-06-28 10:10:00.974 [DEBUG] [nal.callback.AbstractCommandCallback] - JSON String: {"overview":{"lastUpdateTime":"2018-06-28 09:56:50","lifeTimeData":{"energy":4143099.0,"revenue":384.4251},"lastYearData":{"energy":3842267.0},"lastMonthData":{"energy":457852.0},"lastDayData":{"energy":2372.0},"currentPower":{"power":1855.4329},"measuredBy":"INVERTER"}}
2018-06-28 10:10:00.985 [DEBUG] [laredge.handler.SolarEdgeBaseHandler] - Handling channel update.
2018-06-28 10:10:00.993 [DEBUG] [laredge.handler.SolarEdgeBaseHandler] - Channel is to be updated: aggregate_year#production: 3842.27
2018-06-28 10:10:00.997 [DEBUG] [laredge.handler.SolarEdgeBaseHandler] - Channel is to be updated: live#production: 1.86
2018-06-28 10:10:01.003 [DEBUG] [laredge.handler.SolarEdgeBaseHandler] - Channel is to be updated: aggregate_day#production: 2.37
2018-06-28 10:10:01.014 [DEBUG] [laredge.handler.SolarEdgeBaseHandler] - Channel is to be updated: aggregate_month#production: 457.85
2018-06-28 10:10:01.025 [DEBUG] [laredge.handler.SolarEdgeBaseHandler] - Channel is to be updated: aggregate_week#production: 0.0

This is weird. I cannot reproduce those multiple requests sent.
I tested with these settings:

liveDataPollingInterval=10, 
aggregateDataPollingInterval=120, 
meterInstalled=false

I got exactly 1 request per 10 minutes.

The error “(COMMUNICATION_ERROR): Too Many Requests” which only affects setups with meter installed will be fixed in the next version. There will be a delay between subsequent requests to avoid that parallel query limit.

But nevertheless I got massive problems with the solaredge API at the moment. Even the app on my mobile shows incomplete an inconsistent data.

It looks like this

So there might be issues with the binding which are related to problems @solaredge

This is now solved in the latest DEV version.

The latest version from today supports UoM. This is a breaking change which makes it necessary to adopt your config. See here for a description of UoM in general.
https://www.eclipse.org/smarthome/blog/2018/02/22/units-of-measurement.html

The readme https://github.com/alexf2015/openhab2-addons/blob/solaredge/addons/binding/org.openhab.binding.solaredge/README.md describes how configuration must be adopted.

BR
Alex

The binding is now part of the official openhab distribution and should be part of the 2.4.x builds and should be available in the 2.4.0 release.

5 Likes

after some time i also had to upgrade to the latest 2.4 DEV version of the binding.
i have an older inverter so i use legacy mode.
i also have an API key so i used it in the configuration.
the binding is working fine, i got logged in and the data is showing BUT the values are coming as Wh and not as KWh
i have OH2.3 version now, the monitoring site language is English and this is also the API call return

{"overview":{"lastUpdateTime":"2018-07-21 23:49:51","lifeTimeData":{"energy":7.5491696E7,"revenue":41520.477},"lastYearData":{"energy":6504923.0},"lastMonthData":{"energy":985069.8},"lastDayData":{"energy":51669.73},"currentPower":{"power":0.0},"measuredBy":"INVERTER"}}

The items from log:

2018-07-21 23:33:31.002 [vent.ItemStateChangedEvent] - Solaredge_Day_Production changed from NULL to 51669.73
2018-07-21 23:33:36.011 [vent.ItemStateChangedEvent] - Solaredge_Week_Production changed from NULL to 295468.276
2018-07-21 23:33:41.018 [vent.ItemStateChangedEvent] - Solaredge_Month_Production changed from NULL to 985069.8

Why am i now getting values in Wh ?
Is this having to do with UoM ?

Hi @ngalfas

yes, this is because of UoM. Please use an explicit unit in your item label like this:

Number:Power            SE_CUR_PRODUCTION        "Production [%.2f kW]" .........

Values will then be converted automatically.

BR
Alex

1 Like

just noticed that i never had the current power feed from the binding. it’s null.
never having any update.

here is my current items

Number:Energy 	Solaredge_Day_Production 	"Φ/Β παραγωγή ημέρας [%.2f kWh]" 	<solarplant>	(gSolaredge)	{channel="solaredge:generic:dd99ca66:aggregate_day#production"}
Number:Energy 	Solaredge_Week_Production 	"Φ/Β παραγωγή εβδομάδας [%.2f kWh]" <solarplant>	(gSolaredge)	{channel="solaredge:generic:dd99ca66:aggregate_week#production"}
Number:Energy 	Solaredge_Month_Production 	"Φ/Β παραγωγή μήνα [%.2f kWh]" 		<solarplant>	(gSolaredge)	{channel="solaredge:generic:dd99ca66:aggregate_month#production"}
Number:Power 	Solaredge_live_Production 	"Φ/Β ισχύς τώρα [%.2f kW]" 			<energy>		(gSolaredge)	{channel="solaredge:generic:dd99ca66:live#production"}

i am looking at the PaperUI items and channels declerations, it looks fine.

The API call sends ok the live power (on daylight)

{"overview":{"lastUpdateTime":"2018-07-22 14:12:55","lifeTimeData":{"energy":7.5517856E7,"revenue":41534.867},"lastYearData":{"energy":6531083.5},"lastMonthData":{"energy":1011230.8},"lastDayData":{"energy":26160.938},"currentPower":{"power":6163.669},"measuredBy":"INVERTER"}}

is this a Legacy mode problem?

Also, it seems that API stopped sending pv_status and grid_status for my older inverter :frowning:

Lastly, i think it would be usefull to have the lastUpdateTime channel added as an indication

Well the configuration looks good so far. To be able to help you further I need debug log output.

This is my config

Number:Power            SE_CUR_PRODUCTION        "Produktion"                             <solarplant>                  (gSolarEdge_General, PersistHistory, PersistHourly)            { channel="solaredge:generic:se2200:live#production" }
Number:Energy           SE_DAY_PRODUCTION        "Ges. Produktion [%.1f kWh]"             <solarplant>                  (gSolarEdge_DAY, PersistHistory)                               { channel="solaredge:generic:se2200:aggregate_day#production" }
Number:Energy           SE_MONTH_PRODUCTION      "Ges. Produktion (Monat) [%.1f kWh]"    <solarplant>                  (gSolarEdge_LT, PersistHistory)                                { channel="solaredge:generic:se2200:aggregate_month#production" }
Number:Energy           SE_YEAR_PRODUCTION       "Ges. Produktion (Jahr) [%.1f kWh]"      <solarplant>                  (gSolarEdge_LT)                                                { channel="solaredge:generic:se2200:aggregate_year#production" }

My log output looks like this:

2018-07-22 16:50:29.917 [DEBUG] [b.s.h.SolarEdgeLiveDataPolling:48   ] - polling SolarEdge live data org.openhab.binding.solaredge.config.SolarEdgeConfiguration@3f590548[tokenOrApiKey=******,solarId=******,meterInstalled=false,usePrivateApi=false,live data pollingInterval=10,aggregate data pollingInterval=120,asyncTimeout=120,syncTimeout=120]
2018-07-22 16:50:30.334 [DEBUG] [.s.i.c.AbstractCommandCallback:123  ] - received content, length: 249
2018-07-22 16:50:30.335 [DEBUG] [.s.i.c.AbstractCommandCallback:98   ] - HTTP response 200
2018-07-22 16:50:30.335 [DEBUG] [.s.i.c.AbstractCommandCallback:54   ] - onComplete()
2018-07-22 16:50:30.335 [DEBUG] [.s.i.c.AbstractCommandCallback:68   ] - JSON String: {"overview":{"lastUpdateTime":"2018-07-22 16:37:26","lifeTimeData":{"energy":5514946.0},"lastYearData":{"energy":1981855.0},"lastMonthData":{"energy":337398.0},"lastDayData":{"energy":10688.0},"currentPower":{"power":993.0},"measuredBy":"INVERTER"}}
2018-07-22 16:50:30.367 [DEBUG] [.i.m.LiveDataResponseMeterless:103  ] - Channel WEEK_PRODUCTION: no value/unit provided
2018-07-22 16:50:30.367 [DEBUG] [s.handler.SolarEdgeBaseHandler:153  ] - Handling channel update.
2018-07-22 16:50:30.367 [DEBUG] [s.handler.SolarEdgeBaseHandler:158  ] - Channel is to be updated: aggregate_day#production: 10688.0 Wh
2018-07-22 16:50:30.377 [DEBUG] [s.handler.SolarEdgeBaseHandler:158  ] - Channel is to be updated: aggregate_month#production: 337398.0 Wh
2018-07-22 16:50:30.379 [DEBUG] [s.handler.SolarEdgeBaseHandler:158  ] - Channel is to be updated: live#production: 993.0 W
2018-07-22 16:50:30.379 [DEBUG] [s.handler.SolarEdgeBaseHandler:158  ] - Channel is to be updated: aggregate_year#production: 1981855.0 Wh
2018-07-22 16:50:30.381 [DEBUG] [s.handler.SolarEdgeBaseHandler:158  ] - Channel is to be updated: aggregate_week#production: UNDEF
2018-07-22 16:50:30.381 [INFO ] [smarthome.event.ItemStateEvent:53   ] - SE_DAY_PRODUCTION updated to 10.688 kWh
2018-07-22 16:50:30.382 [INFO ] [smarthome.event.ItemStateEvent:53   ] - SE_MONTH_PRODUCTION updated to 337.398 kWh
2018-07-22 16:50:30.382 [INFO ] [smarthome.event.ItemStateEvent:53   ] - SE_CUR_PRODUCTION updated to 993.0 W
2018-07-22 16:50:30.382 [INFO ] [smarthome.event.ItemStateEvent:53   ] - SE_YEAR_PRODUCTION updated to 1981.855 kWh
2018-07-22 16:50:30.383 [INFO ] [smarthome.event.ItemStateEvent:53   ] - SE_WEEK_PRODUCTION updated to UNDEF
2018-07-22 16:50:30.384 [INFO ] [s.event.ItemStateChangedEvent :53   ] - SE_DAY_PRODUCTION changed from NULL to 10.688 kWh
2018-07-22 16:50:30.384 [INFO ] [s.event.ItemStateChangedEvent :53   ] - SE_MONTH_PRODUCTION changed from NULL to 337.398 kWh
2018-07-22 16:50:30.385 [INFO ] [s.event.ItemStateChangedEvent :53   ] - SE_CUR_PRODUCTION changed from NULL to 993.0 W
2018-07-22 16:50:30.385 [INFO ] [s.event.ItemStateChangedEvent :53   ] - SE_YEAR_PRODUCTION changed from NULL to 1981.855 kWh
2018-07-22 16:50:30.385 [INFO ] [s.event.ItemStateChangedEvent :53   ] - SE_WEEK_PRODUCTION changed from NULL to UNDEF

So the live production as well as the aggregate production for day, month and year should be available.

hey guys,
i tried both 2.3.0 and 2.4.0 snapshot but i get problems with my openhabian when the binding is installed.
after a reboot my channels start to disappear and do not come back. when uninstalled binding every thing returns.

i tried enabling debug logging (in a seperate file) in v2.3 but it didn’t work.

can anyone post his Log4j2 config for this binding?

Hi @nick_woodforth: I need more details to analyze it. Logs, more details about your setup, bindings, versions, etc. I do not think this is a general problem as you are the first one reporting it.

@ngalfas: The easiest way to enable debug logging is to use the karaf console:

log:set DEBUG org.eclipse.smarthome.binding.solaredge

To unset the logging either use DEFAULT or any other level like INFO or WARN

log:set DEFAULT org.eclipse.smarthome.binding.solaredge

Hello!

Thank you adding this binding!

I have tried to use it, but I stuck at the connection part: I use OH on synology. This does not have a browser so I cannot use SPRING_SECURITY_REMEMBER_ME_COOKIE. I tried to add the value of my laptop’s browser’s cookie, but cannot connect with this.

Does somebody have any idea how to get this cookie without browser, or is there a possibility to use this bindings without this adding username/password?

The binding supports two modes. Depening on the mode you need either the Cookie or an API key. It does not matter if you retrieve the Cookie on your laptop and use it on your raspberry pi, synology NAS or whatever.

Thank you for the quick reply!

However, as I mentioned in the previous, I tried with the cookie of the laptop, but without success: I checked the value of SPRING_SECURITY_REMEMBER_ME_COOKIE for monitoring.solaredge.com (in chrome), and copied the value to the appropriate field on the binding’s formular.
After saving it says: “UNKNOWN, configuration error, invalid api key or solarId is not valid for this api key”. Session id is good.
Do you have any hints what could be wrong?

Well, it seems that your binding is configured to use the public API which requires an API key but you provided the token. So either use the API key or switch to the private API.

BR
Alex

Great, thanks!
Now, I am a step further: “OFFLINE - COMMUNICATION_ERROR HTTP protocol violation: Authentication challenge without WWW-Authenticate header”

Could you please post your binding configuration (thing config is sufficient). Please mask your token/api-key.
Also I would like to see your logs. Please also mask your token/api-key there

I have a SolarEdge SE7K 3-phase converter (and optimizers on all panels) installed as of last week and I just wanted to report that it works fine in my setup. I’ve created an API key on the SolarEdge website and inserted it, along with the Site ID in the binding configuration.

solaredge:generic:se7k [tokenOrApiKey="SoMeThInGsEcReT", solarId="12345", liveDataPollingInterval=10, aggregateDataPollingInterval=120, meterInstalled=false]

And my Item definitions:

Number:Power SELiveProd "Productie Nu [%.2f %unit%]" <solarplant> (gHistory) {channel="solaredge:generic:se7k:live#production"}
Number:Energy SEDayProd "Dagproductie [%.2f %unit%]"  <solarplant> (gHistory) {channel="solaredge:generic:se7k:aggregate_day#production"}
Number:Energy SEMonthProd "Maandproductie [%.2f %unit%]" <solarplant> (gHistory) {channel="solaredge:generic:se7k:aggregate_month#production"}
Number:Energy SEYearProd "Jaarproductie [%.2f %unit%]" <solarplant> (gHistory) {channel="solaredge:generic:se7k:aggregate_year#production"}

That’s all (besides a sitemap entry to show values and graphs in Basic UI) it took for me. Since the API doesn’t support the optimizer I have no data on that at the moment.