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


  • 0

Production not working in energy panel


JortC

Question

Hi,

 

I currently have my hc3 setup with the quickapp p1 meter for house energy metering and made my own quickapp for metering the solarpanels. I used most of the code from the p1 quickapp to make sure it would work simply because I am not a coding wizard sadly :).

I started running my quickapp and it worked like a charm, except for the energy panel aspect. I was producing megawatt houres of energy... 

The consumption also was acting up wierd at the same time.

Please login or register to see this attachment.

 

The child app resposible for reading the kwh data from the Growatt inverter is setup as an energyMeter like this:

{name="Zon productie vandaag", className="ProductionToday", type="com.fibaro.energyMeter"}

 

some more code of this child:

class 'ProductionToday'(QuickAppChild)
function ProductionToday:__init(device)
    QuickAppChild.__init(self, device) 
    self:updateProperty("rateType", "production")
end
 
function ProductionToday:updateValue(devicedata)
    self:updateProperty("value", tonumber(devicedata.epvtotal)) --tonumber(devicedata.epvtotal)
    self:updateProperty("unit", "kWh")
    self:updateProperty("log", devicedata.update_timestamp)
end

 

When I noticed it starting to register megawatts I removed the line of code responsible for saving the data.

self:updateProperty("storeEnergyData", true)

 

While coding this quickapp I came across multiple "special" ways of fibaro to register certain types of data.

My question now is, how does fibaro read this kwh data and process it?

 

Please login or register to see this image.

/monthly_2022_10/image.png.dffdc0ce0f6ef82406aa1f9aeeab7dfb.png" />

 

Link to comment
Share on other sites

Recommended Posts

  • 0
29 minutes ago, JortC said:

Does the energy panel code check for deltas or does it periodicaly check and change panel values according to the QA values

Yes it does. The energy panel is kind of sensitive to strange values. Look at the SolarEdge Quickapp what I had to do, to handle decreasing values. 

  • Thanks 1
Link to comment
Share on other sites

  • 0
26 minutes ago, JortC said:

I currently have my hc3 setup with the quickapp p1 meter for house energy metering and made my own quickapp for metering the solarpanels.

 

Hi Jort,

 

Most likely your house energy meter levels out consumption with production. So if your consumption is 100 and production is 300 the energy meter wil show 0 consumption and 200 production. 

 

If you use your Growatt quickapp with the solar energy for your energy panel, you will put 300 production from the Growatt quickapp and put 0 consumption from your P1 Monitor quickapp to your energy panel.

 

So the way to use your energy consumption and production, is to put the consumption and production of your P1 Monitor quickapp in your energy panel and use your Growatt quickapp only for insight of your actual production or nice graphs. 

 

(Also: the energy panel works with kWh not kilowatt or megawatt.)

 

Link to comment
Share on other sites

  • 0
  • Inquirer
  • 1 hour ago, SmartHomeEddy said:

     

    Hi Jort,

     

    Most likely your house energy meter levels out consumption with production. So if your consumption is 100 and production is 300 the energy meter wil show 0 consumption and 200 production. 

     

    If you use your Growatt quickapp with the solar energy for your energy panel, you will put 300 production from the Growatt quickapp and put 0 consumption from your P1 Monitor quickapp to your energy panel.

     

    So the way to use your energy consumption and production, is to put the consumption and production of your P1 Monitor quickapp in your energy panel and use your Growatt quickapp only for insight of your actual production or nice graphs. 

     

    (Also: the energy panel works with kWh not kilowatt or megawatt.)

     

     

    I'm not really understanding the problem here, when for example the solar panels produce 400 and the consumption is 200 the p1 quickapp activepower will actually show -200. This resulted in false values in the yubii app for active consumption so I fixed this by adding another child that hows grid use and another that shows active watt flowing back in to the grid (both handled by checking if active power is negative or not), I had to do this due to the necessary inputs needed for the energy panel configuration i'm running.

     

    Because of this odd setup the p1 quickapp only registers the kWh of the "sold" energy to the grid and not the true daily generated power. (sum of used power from solar and sold power from solar in kWh).

     

    Without enabling the save to database, the production tab in the energy panel stays on 0.

    But if it is enabled, it incrementally steps up both produced and consumed to unrealistic numbers as shown in first post.

    Please login or register to see this attachment.

    clarification: "energy production meters" and "instantaneous power production meters" are both values pulled from the growatt QA.

    "actief teruglevering" -> Active production sold to grid.

    "actief net verbruik" -> Active usage from the grid

     

    • Like 1
    Link to comment
    Share on other sites

    • 0

    The P1 Monitor quickapp child devices “Todays consumption” and “Todays production” are of the type “Energy meter” and are used to insert the kWh into the energy panel. That has nothing to do with the main device. The main device just is the calculation of production versus consumption in Watt (not Wh). 
     

    The Yubii app doesn’t handle the “power” devices (watt) very well and in the next firmware you will be able to select which “watt” device will show up in the Yubii app. 
     

    If you can measure the real consumption in your house, so not production minus consumption which most energy meters do, you can use the actual solar production from your Growatt quickapp. So it depends on your energy meter setup. 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 15 minutes ago, SmartHomeEddy said:

    The P1 Monitor quickapp child devices “Todays consumption” and “Todays production” are of the type “Energy meter” and are used to insert the kWh into the energy panel. That has nothing to do with the main device. The main device just is the calculation of production versus consumption in Watt (not Wh). 
     

    The Yubii app doesn’t handle the “power” devices (watt) very well and in the next firmware you will be able to select which “watt” device will show up in the Yubii app. 
     

    If you can measure the real consumption in your house, so not production minus consumption which most energy meters do, you can use the actual solar production from your Growatt quickapp. So it depends on your energy meter setup. 

    The "today consumption" meters of the p1 QA seem to work perfect, also in the energy panel its showing the values correctly.

    For my Growatt QA I copy pasted the exact code from the p1 QA "Today Production" and edited so it takes values from a different source and removed the code part where it resets to day values due to the growatt inverter already zeroing this every day.

    Despite this exact code copy the energy panel shows nothing. But when adding a save to database property change in the Growatt QA it starts to act up wierd in the energy panel.

    Does the energy panel code check for deltas or does it periodicaly check and change panel values according to the QA values?

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Just now, SmartHomeEddy said:

    Yes it does. The energy panel is kind of sensitive to strange values. Look at the SolarEdge Quickapp what I had to do, to handle decreasing values. 

    Will do, thanks :)

    Link to comment
    Share on other sites

    • 0
    On 10/31/2022 at 7:18 PM, JortC said:

     

    I'm not really understanding the problem here, when for example the solar panels produce 400 and the consumption is 200 the p1 quickapp activepower will actually show -200. This resulted in false values in the yubii app for active consumption so I fixed this by adding another child that hows grid use and another that shows active watt flowing back in to the grid (both handled by checking if active power is negative or not), I had to do this due to the necessary inputs needed for the energy panel configuration i'm running.

     

    Because of this odd setup the p1 quickapp only registers the kWh of the "sold" energy to the grid and not the true daily generated power. (sum of used power from solar and sold power from solar in kWh).

     

    Without enabling the save to database, the production tab in the energy panel stays on 0.

    But if it is enabled, it incrementally steps up both produced and consumed to unrealistic numbers as shown in first post.

    Please login or register to see this attachment.

    clarification: "energy production meters" and "instantaneous power production meters" are both values pulled from the growatt QA.

    "actief teruglevering" -> Active production sold to grid.

    "actief net verbruik" -> Active usage from the grid

     


    is deze QA ook te vinden op de Marketplace voor Growatt (shinelink) ?

     

    thanks alvast

    • Like 1
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Beste Stephan,

     

    Zelf heb ik niks kunnen vinden voor de shinelink en ben zelf aan de slag gegaan. Met behulp van een raspberry pi als proxy is het gelukt om realtime informatie te verkrijgen over de Growatt en met een eigen QA registreer ik die info op mijn HC3. Mocht je hier meer info over willen hebben laat ik u daar graag meer over weten.

    11 hours ago, StephanvProoijen said:


    is deze QA ook te vinden op de Marketplace voor Growatt (shinelink) ?

     

    thanks alvast

     

    Link to comment
    Share on other sites

    • 0

    Dag Jort, daar zou ik zeer graag wat meer info over ontvangen. Ik heb namelijk geen idee waar te beginnen.

    Het zou eventueel ook kunnen met een KwH meter van Homewizard, maar leuker om deze via een QA in fibaro te implementeren ;-)

     

    Groet, Stephan

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • On 12/16/2022 at 5:49 PM, StephanvProoijen said:

    Dag Jort, daar zou ik zeer graag wat meer info over ontvangen. Ik heb namelijk geen idee waar te beginnen.

    Het zou eventueel ook kunnen met een KwH meter van Homewizard, maar leuker om deze via een QA in fibaro te implementeren ;-)

     

    Groet, Stephan

    Beste Stephan,

    Ik heb dit helaas niet meer gelezen destijds, echter heb ik de Quickapps weer opgepakt en een "refresh" gegeven.

    Op dit moment heb ik 3 Qa's. Eentje om de P1 meter uit te lezen, eentje voor de homewizard watermeter en 1 die de data van de Growatt verwerkt. 

    Alle data word correct verwerkt en de QA's werken uitstekend dus mocht je deze nog willen hebben is dat zeker mogelijk. 

    Voor de Growatt is er iets meer dan alleen een QA, de documentatie valt niet te begrijpen en de python module die ik had gevonden voor de growatt restapi werkt uiteraard niet in de lua code van fibaro, daarom heb ik dit anders aan moeten pakken. Maar het werkt nu dus ik vertel je er graag alles over mocht je het nog willen gebruiken. 

     

    On 10/31/2022 at 8:08 PM, SmartHomeEddy said:

    The P1 Monitor quickapp child devices “Todays consumption” and “Todays production” are of the type “Energy meter” and are used to insert the kWh into the energy panel. That has nothing to do with the main device. The main device just is the calculation of production versus consumption in Watt (not Wh). 
     

    The Yubii app doesn’t handle the “power” devices (watt) very well and in the next firmware you will be able to select which “watt” device will show up in the Yubii app. 
     

    If you can measure the real consumption in your house, so not production minus consumption which most energy meters do, you can use the actual solar production from your Growatt quickapp. So it depends on your energy meter setup. 

    I refreshed all my quickapps and I now face a problem which I don't really understand, the active production and consumption graphs work great, but the production and consumption energy meters (kWh) on the energy panel are not displaying information correctly. I currently have energy meters setup and working for: Solar production today, Grid export today and Grid import today. The production and consumption values don't get used directly in the panel but instead slowly count up, is it possible to change this behavior? Also both consumption and production are always the same which is not quite right. What could be the cause of this?

     

     

    Link to comment
    Share on other sites

    • 0
    11 minutes ago, JortC said:

    I refreshed all my quickapps and I now face a problem which I don't really understand, the active production and consumption graphs work great, but the production and consumption energy meters (kWh) on the energy panel are not displaying information correctly. I currently have energy meters setup and working for: Solar production today, Grid export today and Grid import today. The production and consumption values don't get used directly in the panel but instead slowly count up, is it possible to change this behavior? Also both consumption and production are always the same which is not quite right. What could be the cause of this?


    I am a bit confused. About which QuickApp are you writing? The P1 Monitor doesn’t have solar prodcution today or grid import today. 
     

    If you use the P1 Monitor quickapp, all you have to do is use todays consumption and todays production to feed the energy panel with kWh and use consumption and production to show Watt in the Yubii app (instantaneous power). Thats all, don’t mix it up with other quickapps. 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 2 minutes ago, SmartHomeEddy said:


    I am a bit confused. About which QuickApp are you writing? The P1 Monitor doesn’t have solar prodcution today or grid import today. 
     

    If you use the P1 Monitor quickapp, all you have to do is use todays consumption and todays production to feed the energy panel with kWh and use consumption and production to show Watt in the Yubii app (instantaneous power). Thats all, don’t mix it up with other quickapps. 

    Since the last version of the P1 meter didnt work i went back and grabbed the older version and started changing and removing some code of it, this include some minor things like removing the T1 and T2 (import and export) and combining them together since I only have 1 tariff over the whole day, this was just to "clean up" some things i didnt need, with that I also changed the naming of the child devices. to clarify:

    • From the modified P1 meter i use: "Grid import today" and "Grid export today" these originate from the original p1 meter child devices consumption high and low meters i believe they were called.
    • From the growatt QA I only have and use the "solar production today"

     

    Last year when i had this setup the energy panel started counting in mWh and did not want to delete history values. I turned off the settings under "advanced" for all child devices with energy metering ->"Save energy to database" and "Use stored energy data in Energy Panel" and left the project clueless about what the issue might be.

    After posting the earlier comment about how and what the problem might be i rememberd those settings being an issue a time ago, so i turned all the boxes on for the 3 metering child devices and it looks like its working as it should, both consumption and production meters are displaying realistically in the energy panel, rightnow with the wrong values but that has to do with the panel being setup only a few hours ago so it missed the production of the hours before that.

    I dont know what the exact purpose is of the 2 settings to be honest, because if i select the metering devices in the energy panel then whats the purpose of turning on  "save energy to database"?

     

    I will monitor the values throughout the day and also check on them tomorrow to see if they are being registered correctly.

     

    Again thanks for writing the P1 QA in the first place, this helped me alot learning lua code.

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • On 4/19/2023 at 12:55 PM, SmartHomeEddy said:

    I still think you are writing about another quickapp, not the P1 Monitor Quickapp: 

     

    I did not know there where 2 versions of it, i use the homewizard p1 meter not an raspberry pi.

     

    I checked today an noticed a slight problem, the "production" meter is showing correct in the energy panel, but the consumption meter in the energy panel is showing "18,78 Kwh" but this is not correct when i calculate this value myself.

     

    The production meter at this moment shows "7,1 Kwh"

    The Grid export meter at this moment shows "4,63 Kwh"

    The Grid import meter at this moment show "3,64 Kwh"

    Note that there are no other meters active on my fibaro system since i modified the original p1 meter to combine the 2 tariffs hours together in one (for both import and export).

    Also i use the "Grid consumption" setting in the energy panel since this is applicable for my current setup.

     

    I assume then that the correct consumption should be, "Production meter (7,1) " - "Grid export meter (4,63) " = 2,47 Kwh consumed from solarpanels today

    and add the Grid import (3,64 Kwh) = 6,11 Kwh.

    instead it shows consumption (18,78 Kwh)????

     

    What am I missing here?
    Am I misunderstanding the therm "Consumption" here?

    Link to comment
    Share on other sites

    • 0
    2 hours ago, JortC said:

    I did not know there where 2 versions of it, i use the homewizard p1 meter not an raspberry pi.

     

    Who build the Homewizard P1 Meter QuickApp ?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • On 4/20/2023 at 5:33 PM, SmartHomeEddy said:

     

    Who build the Homewizard P1 Meter QuickApp ?

    I cant find it anymore online. the code of what you send looks similar to what i found over a year ago but I attached the p1 qa i use now so maybe you know which version of the p1 meter it was.

     

     

    Edited by JortC
    Link to comment
    Share on other sites

    • 0
    9 hours ago, SmartHomeEddy said:

    Maybe someone used some of my code, but I didn’t wrote this QuickApp. 

     

    It looks like my first HW P1 meter QA with my standard banner, version and name stripped out. 😒

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • On 4/22/2023 at 8:51 AM, Joep said:

     

    It looks like my first HW P1 meter QA with my standard banner, version and name stripped out. 😒

     

    I'm sorry for doing that, i used ChatGPT multiple times for finding errors in my code, mostly had to do with brackets and end statements and wrong placements of returns but ChatGPT doesnt really appreciate large code texts so i removed as much unused text as i could. Will remove the old code I send and put back the credits.

     

    (edit)

    I added you're information in the code. Additionally, I wanted to inquire if the current information banner is acceptable to you or if you would prefer any modifications to be made.

     

    Please login or register to see this attachment.

    Edited by JortC
    Added information
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I'm now trying different combinations of settings on the meters used in the energy panel to understand why its not displaying data correctly.

    To be exact I am changing these settings on the meters used in the energy panel.

    Save energy to database
    Use stored energy data in Energy Panel
     
    Yesterday I set the solar production settings showed above both to "on" or checked, and the rest of the meters all unchecked (Off). The energy panel then correctly showed solar production but showed that the consumption was exactly the same as the production, which obviously was not right. I have now checked(turned on) the "save energy to database" setting on all the meters and kept/turned off the "use stored energy data in energy panel" in also all of the meters.
     
    I cant find an detailt explanation on how the values are used and calculated in the energy panel and so i cant find out why its displaying these faulty values.
    It's not that difficult to display numbers that are directly given to you is it? 🙃
     
    I also noticed that deleting history data just does nothing, when i click the "year" tab on the energy panel it displays hundereds of kwh, also the day values are kept and are not being deleted. The values displayed when opening the "advanced" tab on metering devices are being deleted as supposed to. How can i fix this issue?
    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
    Answer this question...

    ×   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...