Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


SolarEdge Monitor 2.0.0

   (4 reviews)

3 Screenshots

About This File

----------==========     SolarEdge Monitor Virtual Device     ==========----------

 

I want to share my virtual device to monitor SolarEdge solar panels.

SolarEdge have the possibility to read your system data with API.

 

What you need is the VD to download and ad into the Fibaro

Make a LUA scene where you copy the code

 

The code is based on @jompa68  Consumption Monitor Scene and I have permission to share my version of it with the change/ integrate of SolarEdge

With this it also supports 

@AutoFrank SmartMessageHub and

@Sankotronic Time Based Events Control

 

First you need the API key that only a admin of the portal can give to you.

When the SolarEdge was installed at my home I register the system by myself.

You only need the serial number that is on the invertor

 

Go to:

https://monitoring.solaredge.com

  • And select new installer
  • Fill in the information needed
  • see example of serial number to fill in

 

Or ask the site admin to enable the API key

 

To generate a Site API key:

For most time people will have standard access to the portal and will not be able to set the API Key them self
Ask your Installer/ manufacturer to enable the API key by these steps or do it yourself.

In the Site Admin >> Site Access tab >> Access Control tab >> API Access > section:

  1. Acknowledge reading and agreeing to the SolarEdge API Terms & Conditions.
  2. Click Generate API key.
  3. Copy the key.
  4. Click Save
  5. Use the key in all API requests

 

SolarEdge Scene setup

  • Line 23 local vDevId > enter the VD id
  • SE_API > Your API Key
  • SE_CLIENT_ID > Your Client ID
  • Line 41 (true or false) and 42 possibility to calculate rates with the the power you get from the solar panels
  • Line 51 refresh rate > set 60 or higher due API data restrictions of SolarEdge
  • setup you push message when and in what way you want, see description in the scene.
  • Like 4
  • Thanks 1

Other Files from D-Vine


User Feedback

Recommended Comments

Hi!

You can also post the produced power of your inverter to physical Fibaro device. That way you can see the power on the energy panel:

 

  jtable = "{\"properties\":{\"power\":-" .. data.PAC .. "}}"
  response, status, errorCode = HC2:PUT("/api/devices/" .. SolarPowerID , jtable)  

 

(data.PAC is the power in Watts, SolarPowerID is the device ID of an (unused) switch which I am abusing for this hack)

Link to comment
Share on other sites

Thanks for this awesome vd to have my SolarEdge integrated in my HC2!

 

Edit: there already was an icon but I missed it... :-)

 

Kind regards

Ron

 

solaredge.png.fe9958e5313a4928e781e7e79c981e10.png

Edited by degroeten
Link to comment
Share on other sites

My problem:

 

[DEBUG] 21:13:20: AUTO START - SolarEdge Monitore Scene 2.0
[DEBUG] 21:13:20: pushService: telegram - Daily report will be sent: 21:00
[DEBUG] 21:13:20: [1;31m2018-05-26 21:13:20.766001 [ fatal] LUA error: /opt/fibaro/scenes/47.lua:175: bad argument #2 to 'format' (number expected, got nil)

 

Somebody have a idea how to fix it?

API works fine so far i can see. 

 

With kind regards

Link to comment
Share on other sites

On 5/29/2018 at 10:48 AM, powerbox said:

My problem:

 

[DEBUG] 21:13:20: AUTO START - SolarEdge Monitore Scene 2.0
[DEBUG] 21:13:20: pushService: telegram - Daily report will be sent: 21:00
[DEBUG] 21:13:20: [1;31m2018-05-26 21:13:20.766001 [ fatal] LUA error: /opt/fibaro/scenes/47.lua:175: bad argument #2 to 'format' (number expected, got nil)

 

Somebody have a idea how to fix it?

API works fine so far i can see. 

 

With kind regards

Same Problem here did you already find a solution?

Link to comment
Share on other sites

On 5/29/2018 at 4:48 PM, powerbox said:

My problem:

 

[DEBUG] 21:13:20: AUTO START - SolarEdge Monitore Scene 2.0
[DEBUG] 21:13:20: pushService: telegram - Daily report will be sent: 21:00
[DEBUG] 21:13:20: [1;31m2018-05-26 21:13:20.766001 [ fatal] LUA error: /opt/fibaro/scenes/47.lua:175: bad argument #2 to 'format' (number expected, got nil)

 

Somebody have a idea how to fix it?

API works fine so far i can see. 

 

With kind regards

 

On 6/3/2018 at 5:20 AM, David86vm said:

Same Problem here did you already find a solution?

 

I had the same problem as well and seemed to of figured it out - this worked for me.

 

It appears to be that if you haven't got revenue setup in the SolarEdge Portal it will give you the error above as there is no revenue data to get. After some digging I commented the following lines:

 

Lines 174 & 175

--            local jsonlifeTimeDataReturns = jsonTable.overview.lifeTimeData.revenue
--            local jsonlifeTimeDataReturns = string.format("%.2f", jsonlifeTimeDataReturns)

 

Line 233

--        fibaro:call(vDevId , "setProperty", "ui.lbLTDR.value", "$ "..jsonlifeTimeDataReturns);

 

Line 243

--        logbug("lightgreen", "Life Time Data Returns $ "..jsonlifeTimeDataReturns)

 

After doing this it worked perfectly.

 

If you go to the SolarEdge Portal and setup revenue you won't have to comment out those lines and it will retrieve the data and calculate correctly.

 

Cheers

Link to comment
Share on other sites

Hi,

 

 

i'm getting:

[DEBUG] 15:25:07: AUTO START - SolarEdge Monitore Scene 2.0
[DEBUG] 15:25:07: pushService: hc2Push - Daily report will be sent: 21:00
[DEBUG] 15:25:08: 2018-10-13 15:25:08.101028 [ fatal] LUA error: /opt/fibaro/scenes/353.lua:175: bad argument #2 to 'format' (number expected, got nil)

 

With "revenue" still this error..??????

 

 

P.S. im not good at LUA srry..... :/

 

 

Link to comment
Share on other sites

Hi,

 

i changed line 174 to:

local jsonlifeTimeDataReturns = jsonTable.overview.lifeTimeData.energy

 

now it works for me.....;D

 

and added yearly saves in € (in the LUA code and the vd)

 

THX for the LUA script and the vd, looks and works great!!!

 

greetings TSN

Edited by TSN
Link to comment
Share on other sites

Hi, The solaredge VD works great. 

 

I now want to experiment with LUA and in a scene I want to ask the value (Current Power) and store this into a variable. 

The only thing is, I can't make it working. 

 

This is what i do

 

local Power = fibaro:setGlobal("CurrentPower", fibaro:getValue(43, "ui.lbCP.value")) -- record current power

fibaro: debug('ui.lbCP.value')

 

I don't get a number back in the debug but just : ui.lbCP.value 

 

Isn't it possible to get a value from a virtual device? 

 

Many thanks in advance.

 

Frank

Link to comment
Share on other sites

This working perfect but i have one question. How to i use this data for electric boiler. If Solaredge current power is 6 kw then i want switch on boiler and if current power is <6kw switch boiler off ?

Link to comment
Share on other sites

On 3/28/2018 at 4:39 PM, doezel said:

Hi!

You can also post the produced power of your inverter to physical Fibaro device. That way you can see the power on the energy panel:

  

  jtable = "{\"properties\":{\"power\":-" .. data.PAC .. "}}"
  response, status, errorCode = HC2:PUT("/api/devices/" .. SolarPowerID , jtable)  

 

(data.PAC is the power in Watts, SolarPowerID is the device ID of an (unused) switch which I am abusing for this hack)

 

How to do it? I want to turn on and off boiler.

Link to comment
Share on other sites

something like this:

if (data.PAC>6000) then

-- lua command for turning boiler on

else

-- lua command for turning boiler off

endif;

Link to comment
Share on other sites

On 8/2/2020 at 1:08 PM, bigesdiges2 said:

[ERROR] 13:05:33: line 184: Assertion failed

 

Ktoś miał podobny problem?

I had it too. How I solved is to make a separate scene with the solaredge LUA in it (so not as LUA script in de Virtual Device).

Now it works.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...