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


Please add support for Aeotec ZW095 (Gen 5 HEM)


AutoFrank

Recommended Posts

  • Topic Author
  • @petergebruers

    @morpheus75

     

    okay.. after a lot of data, numbers and almost blind from staring at graphs.... I think I have figured it out .. at least for our house

    ..... but could do with a second / third opinion...

     

    This is the setup for reference

     

    Please login or register to see this attachment.

    • Clamp A (Gen 5 p2 = 1) on in-feed into utility board is what I am billed for - This is consistent with my Utility Meter increases
    • Clamp B (Gen 5 p2 = 1) on output of PV and is my PV generation - This is consistent to my PV app data
    • Clamp C ( Gen 2) is also on the in-feed into the Utility board is now redundant and has been removed. I may re-purpose this for my heat pump and see how much that consumes by itself 

     

    Total House Consumption = Grid + PV + extra ( see below for 'extra' that is related to when I am generating more than I am consuming)

     

    Chart for a portion of today and it rained most of the day ...

    Please login or register to see this attachment.

     

    Chart is the same as before. I took a specific segment from today where we generated more than we consumed and this can be seen clearly above as per Peters explanation.

     

    I added a line for 10 min rolling average (sampled every minute) for Grid Wh (red line) to smooth out the sudden peaks and troughs of the regular Wh trend line and provide a better directional trend indicator. (I don't think this will add a much of a discrepancy error even for the numerical calculations)  

    I'm also hoping to use this as a visual indicator in the final VD.

     

    I can detect when I'm exporting to the grid when the Wh goes negative relative to the last positive increase (thanks Peter) 

    Please login or register to see this attachment.

     

    if I scale up the second dip/curve and add some guide marks to help discuss

     

    Please login or register to see this attachment.

     

    A-B : Power that is generated by the PV but not used by the house and thus exported to the Grid

    C-B: This is power that is generated by the PV but this is used by the house and thus NOT exported to the grid

     

    If correct then calculations would be as follows....

    • Total House Consumption = PV Clamp + Grid Clamp (when Wh is increasing) + (C-B for each ABC curve) 
    • Excess PV power (unused) = A-B for each ABC curve

     

    Thoughts  ?

     

    Thanks

    _f

     

     

     

     

     

     

     

     

    Edited by AutoFrank
    Link to comment
    Share on other sites

    @AutoFrank looks like you are getting there. I'd say re-purposing the third clamp is a bonus ;). I'll look into the details before the end of the week.

    Link to comment
    Share on other sites

  • Topic Author
  • 43 minutes ago, petergebruers said:

    @AutoFrank looks like you are getting there. I'd say re-purposing the third clamp is a bonus ;). I'll look into the details before the end of the week.

     

    Thanks @petergebruers

     

    I've re-purposed it for my heat pump and am getting more information...

     

    Here is an interesting view from the energy panel ....all good except it counts the PV as consumption instead of generation... but at least I can see the clamp data moving in real time as I would expect

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    hello

    after 2 days of monitoring my solar readings are comparable. HEM measured 44 units. my meters measured 43 units.

    house usage was 70 units according to HEM

    i checked the elec meter and that had changed by 30.

    So House - Solar is 34 units so almost the correct billed figure for me.

     

    However the billing clamp measured in at 42 units. my parameter 2 setting was 2 ie positive flow but it looks like it didnt perform that well.

    i have now changed it to 1 and let see what happens.

    the weather has changed here to overcast and rain so i doubt i will actually be exporting any energy over the next day or so.

     

    i may end up doing same as @autofrank and removing the billed clamp and use elsewhere...

    Link to comment
    Share on other sites

  • Topic Author
  • 28 minutes ago, morpheus75 said:

    hello

    after 2 days of monitoring my solar readings are comparable. HEM measured 44 units. my meters measured 43 units.

    house usage was 70 units according to HEM

    i checked the elec meter and that had changed by 30.

    So House - Solar is 34 units so almost the correct billed figure for me.

     

    However the billing clamp measured in at 42 units. my parameter 2 setting was 2 ie positive flow but it looks like it didnt perform that well.

    i have now changed it to 1 and let see what happens.

    the weather has changed here to overcast and rain so i doubt i will actually be exporting any energy over the next day or so.

     

    i may end up doing same as @autofrank and removing the billed clamp and use elsewhere...

     

    @petergebruers @morpheus75

     

    Some more data from today and lot of ups and downs which is good and is helping the understanding... (sorry for more charts) 

    I've also given up on p2=2 or p2=3. The clamp is setup with p2 = 1

    The chart is the kWh for the clamp in my main in-feed

     

    Please login or register to see this attachment.

     

    If I was to measure just the difference between start of day and end of day for kWh I would get 3.3 kWh (line A)

    I reckon I should be measuring all the up slopes (B + C + D + E = 6.1 kWh) to get an accurate reading on what I am consuming from the grid and being charged for. The down slopes are when I am exporting unused power back to the grid

    This is more consistent with the delta from my actual start of day/end of day utility meter readings

    I'll continue to monitor for the next few days but will also start to work on how I can calculate this using lua code 

     

     

     

     

     

     

    Link to comment
    Share on other sites

  • Topic Author
  •  

    @petergebruers, @morpheus75. I've been plugging away at this and think I'm making progress. I have a basic VD that now reads the GRID clamp energy (kwh) and looks for negative and positive value relative to the previous readings and accumulate into 2 variables. This follows the theory that positive values should accumulate to what I am being billed for and negative values are what I am feeding back to the grid. I'll modify it a little this evening, zero my clamps and take the default reading from my utility meter. If the theory is correct then accumulated positive values over a given period should equal (or be close) to the increase in my utility meter reading over the same time....

     

     

     

    Link to comment
    Share on other sites

    3 minutes ago, AutoFrank said:

     

    @petergebruers, @morpheus75. I've been plugging away at this and think I'm making progress. I have a basic VD that now reads the GRID clamp energy (kwh) and looks for negative and positive value relative to the previous readings and accumulate into 2 variables. This follows the theory that positive values should accumulate to what I am being billed for and negative values are what I am feeding back to the grid. I'll modify it a little this evening, zero my clamps and take the default reading from my utility meter. If the theory is correct then accumulated positive values over a given period should equal (or be close) to the increase in my utility meter reading over the same time....

     

     

     

    my billed readings sometimes are correct and within expected values when i have calculated using solar and house power and sometimes way off!

    so im gonna remove the billed clamp and continue with just 2.

    solar and house.

    Link to comment
    Share on other sites

    2 minutes ago, AutoFrank said:

     

    @petergebruers, @morpheus75. I've been plugging away at this and think I'm making progress. I have a basic VD that now reads the GRID clamp energy (kwh) and looks for negative and positive value relative to the previous readings and accumulate into 2 variables. This follows the theory that positive values should accumulate to what I am being billed for and negative values are what I am feeding back to the grid. I'll modify it a little this evening, zero my clamps and take the default reading from my utility meter. If the theory is correct then accumulated positive values over a given period should equal (or be close) to the increase in my utility meter reading over the same time....

     

     

     

     

    BTW is your meter "OBIS" compatible? In that case, you should be able to select different meter results by selecting data that corresponds to a code from a standard table:

     

    1.8.1 Positive active energy (A+) in tariff T1 [kWh]

    2.8.1 Negative active energy (A+) in tariff T1 [kWh]

     

    Then maybe you also can display

     

    16.8.1 Sum active energy without reverse blockade (A+ - A-) in tariff T1 [kWh]

     

    Assuming you have only one tariff, the 16.8.1 should match the clamp (with p2 set to 1) and the 1.8.1 and 2.8.2 require math on historical data of the kWh reported by the clamp.

     

    If you want to match 1.8.1 and 2.8.1 exactly, you should have 2 clamps on grid, one with p2=2 and one with p2=3. As far as I understand these parameters, and judging by reports by you and @morpheus75 gave, this setup would be the only possible way to get results without doing math... It's slightly frustrating that you need 2 clamps, because one clamp could calculate what you want - that's how the smart utility meters do it - but they didn't design the device to report this stuff. Of course, one could also argue that the Aeon device has no notion of different tariffs either (day, night, peak). So maybe, ultimately the solution would be to have a smart meter and an interface to connect to your network. Then read al the OBIS counters. I'm waiting since 2014 for the company to enable that "socket" on my meter.

     

    Please login or register to see this link.

    Link to comment
    Share on other sites

  • Topic Author
  • 7 minutes ago, petergebruers said:

    BTW is your meter "OBIS" compatible? In that case, you should be able to select different meter results by selecting data that corresponds to a code from a standard table

     

    Thanks @petergebruers

    Unfortunately I have no access to my meter or data from it :-(

    I have a dumb meter and the smart meter variant is not much cleverer and the people that have them cannot interrogate them for dat . The Irish energy providers are a good bit behind the curve with this 

     

    I couldn't get any indication of positive or negative flow or data with p2 = 2 and p2 = 3. p2 = 1 , I seem to be getting the best results from p2 = 1

    I'm okay calculating it with some maths if I can work it out accurately.

     

    Ultimately what I'm looking to try and get to the following (over 7 days ( mon-sun)  or last 7 days rolling)

    • % or my consumption that comes from my PV
    • % of my PV generation that I am actually consuming
    • How much I consume daily and can I influence that with smarter practices that enable me to consume more of my PV

    I am beginning to think that it's possible with the data I can get...

    ...

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • @morpheus75

    @petergebruers

     

     

    I'm ready to start tracking the power for the next few days

    • Tracking kWh for Grid IN (from utility company) and PV (from panels)
    • Sampling once per minute through VD
    • Tracking relative changes to kWh data point (trend up - consuming power, trending down - sending excess power out), dropping data points into 2 globals
    • Tracking Grid IN consumption when panels are active to get more accurate PV Contribution (opportunity to contribute)
    • Tracking PV total and PV excess (sending power it to grid, "Grid IN - trend down") using this to calculate PV utilisation (how much of my PV am I actually using)
    • Will track for next few days
    • Scene to extract data at the end of 24 hrs (11pm nightly) and generate percentages and send on and reset counters
    • Formulae

    Please login or register to see this code.

    Using a VD to capture, process and store data (very rough with debug lines and code comments for me)

     

    Please login or register to see this code.

     

    Scene to process data once per 24 hrs

    Please login or register to see this code.

     

    Expected Daily output

     

    Please login or register to see this code.

     

    I should also be able to confirm (or not) that my Grid IN data through sampling and comparing for all up trends will be my actual billed kWh

     

    fingers crossed....

     

    _f

     

     

     

    Edited by AutoFrank
    Link to comment
    Share on other sites

    @AutoFrank had a look at the code and one think that strikes me is that you use rounding when you are calculating stuff and I think, broadly speaking, that is incorrect. One should only round results if you *for display*. I'd say there is one exception to this rule: you can round a variable, a measurement, if you know it only meets a certain accuracy. For example, someone measures the length of a table and tells me: "length = 1221.47 mm". I would be really impressed if that person was able to measure one meter to 0.01 mm accuracy. If he then tells you he used a simple ruler and "guessed the fractional part", then I'd round the result to the nearest mm. In this case, I'd round the measurement *before* I started the calculations. In fact, you have already done something similar when you say: "if PVinW > 8 then" in your script. You get a number, say "4" for production and you realise this clamp isn't very accurate below 8 W and 0 sin't really 0 so you "round" it (or truncate it).

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 10 minutes ago, petergebruers said:

    @AutoFrank had a look at the code and one think that strikes me is that you use rounding when you are calculating stuff and I think, broadly speaking, that is incorrect. One should only round results if you *for display*. I'd say there is one exception to this rule: you can round a variable, a measurement, if you know it only meets a certain accuracy. For example, someone measures the length of a table and tells me: "length = 1221.47 mm". I would be really impressed if that person was able to measure one meter to 0.01 mm accuracy. If he then tells you he used a simple ruler and "guessed the fractional part", then I'd round the result to the nearest mm. In this case, I'd round the measurement *before* I started the calculations. In fact, you have already done something similar when you say: "if PVinW > 8 then" in your script. You get a number, say "4" for production and you realise this clamp isn't very accurate below 8 W and 0 sin't really 0 so you "round" it (or truncate it).

     

     

     

    Thanks @petergebruers

    Good point - It grew a bit organically and I was rounding for display and kept it.

    I also kept it as it was easier to read in the debug window but if the approach works, I'll remove the rounding for the calculations and keep for display 

     

    I had a quick look at the data and I think the sample being generated should help understand if this approach works and is reasonably accurate

     

    Please login or register to see this code.

     

    Grid IN - accumulated kWh when the house is consuming power from utility grid

    Grid OUT - negative dips in the Grid IN kWh which I am hoping is power going back out to the grid (ie PV excess)

    PV GEN - Electricity generated by my PV Panels

    ....all HEM were reset to zero at 11:00pm last evening.

     

    I'm seeing some good time when Grid IN is not increasing which means I have an excess from my PV panels

    The acid test is if the Grid IN accumulated value is approx the same amount that my utility grid meter has increased by

     

    As an aside I was seeing my max PV peaking at 2.2 kW even though I have 2.75 kW of panels

    It turns out the invertor I was provided peaks at 2.8 kW DC but only 2.2kW AC

    The provider are swapping out for a more powerful invertor next week that will peak at 3kW  AC

    .. a good find :-)

     

     

     

     

    Link to comment
    Share on other sites

    54 minutes ago, AutoFrank said:

    (...)I'm seeing some good time when Grid IN is not increasing which means I have an excess from my PV panels

    The acid test is if the Grid IN accumulated value is approx the same amount that my utility grid meter has increased by

     

    As an aside I was seeing my max PV peaking at 2.2 kW even though I have 2.75 kW of panels

    It turns out the invertor I was provided peaks at 2.8 kW DC but only 2.2kW AC

    The provider are swapping out for a more powerful invertor next week that will peak at 3kW  AC

    .. a good find :-)

     

    I think I understand 100% of your code and I'd say it is correct. Splitting the "grid" measurement into "in" and "out" should give a good approximation. But the only exact measurements are the numbers reported by the clamps. My gut feeling tells me that solar production can vary faster than your 1 minute sample rate can detect. I'm very much interested in the match between utility meter and "grid IN" calculated. BTW to keep terminology consistent with what the clamps and other power meters use ... I'd rename 'Grid IN" to "Grid POS" and "Grid OUT" to "Grid NEG".

    Good you found out about the inverter. I'd say you could get about 20% more energy from those panels with the new inverter!

    Link to comment
    Share on other sites

  • Topic Author
  • @petergebruers

     

    I did a quick check when I got home and the Grid POS value approx matched the delta between my start reading last evening and my reading today

     

    Of course my meter reading is in units/kWh 'whole numbers where as my Grid POS  is to three decimal places so the match is approx but here are the readings 

     

    Meter Last evening - 19668

    Meter reading at 16.50 today- 19676

    Grid POS @ 16.50 today -  7.376

    ... so good so far :)

     

    Please login or register to see this attachment.

    (Pv reading above never reset  last evening and really has an offset of about 10.803 from the 17.326 above)

     

    This would make my house consumption

    6.573 from pv + 7.376 from grid 

    Total 13.979kWh so far today and ~47% from pv which I expect will drop to 40% in 24hrs 

     

    Not too bad ...

     

     

    The code is rough and ready and I'll optimise for final vd. I'll also use a global table instead of multiple globals 

     

    I think I'll sample somewhere around 15 or 20 seconds providing that much polling won't impact my system 

     

    .. more to follow 

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • @petergebruers

     

    I did a quick check when I got home and the Grid POS value approx matched the delta between my start reading last evening and my reading today

     

    Of course my meter reading is in units/kWh 'whole numbers where as my Grid POS  is to three decimal places so the match is approx but here are the readings 

     

    Meter Last evening - 19668

    Meter reading at 16.50 today- 19676

    Grid POS @ 16.50 today -  7.376

    ... so good so far :)

     

    Please login or register to see this attachment.

    (Pv reading above never reset  last evening and really has an offset of about 10.803 from the 17.326 above)

     

    This would make my house consumption

    6.573 from pv + 7.376 from grid 

    Total 13.979kWh so far today and ~47% from pv which I expect will drop to 40% in 24hrs 

     

    Not too bad ...

     

     

    The code is rough and ready and I'll optimise for final vd. I'll also use a global table instead of multiple globals 

     

    I think I'll sample somewhere around 15 or 20 seconds providing that much polling won't impact my system 

     

    .. more to follow 

     

     

    Update...... 

     

    Another check this morning supports the same conclusion. After 36 hrs the  grid POS calculation and the utility meter reading are within 1.1 kWh 

    I think I can improve the accuracy by sampling more frequently and not rounding before the calculations 

     

    I'll check again later tonight but I think this approach will work 

    I'll need to decide what data to store and table structure and hope start to rewrite the code over the next few days ....

     

     

    Link to comment
    Share on other sites

    @AutoFrank polling at 15 sec with only a few devices seems possible to me. Anyway, if you experience delays on other sensors or actors then you know what caused it. :-) Later, you can check if multiples of 60 s polling give a good enough approximation. I think with the resolution of the utility meter, this is about as accurate as you can get. So, no Grid NEG, meaning not enough solar to compensate the house consumption? Cloudy weather, like here, close to Brussels?

    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, petergebruers said:

    So, no Grid NEG, meaning not enough solar to compensate the house consumption? Cloudy weather, like here, close to Brussels?

     

    @petergebruers

    Thanks, I'll start with 15 seconds and see how I get on...

    yes, no Grid NEG means that all PV is being used by the house

     

    BTW - I just upgraded to 4.13 (stable release) and my PV HEM was a causality. It ended up as 'Not Configured' and i couldn't recover it.. so I'll have to exclude and then re-include it...

     

    Link to comment
    Share on other sites

    i did the upgrade aswell to 4.131 beta and all was OK. the built in energy monitoring has shown up.

    i have reset the values again and taken meter readings.

    now i have 2 clamps only.

    will continue to monitor.

    also @AutoFrank will be interested to see your final code for the VD. i will try and use your current code but i dont have the pushover service set up yet so am waiting to get some free time to go through and try and understand it all before implementing it.

    cheers for the work

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • 6 minutes ago, morpheus75 said:

    i did the upgrade aswell to 4.131 beta and all was OK. the built in energy monitoring has shown up.

    i have reset the values again and taken meter readings.

    now i have 2 clamps only.

    will continue to monitor.

    also @AutoFrank will be interested to see your final code for the VD. i will try and use your current code but i dont have the pushover service set up yet so am waiting to get some free time to go through and try and understand it all before implementing it.

    cheers for the work

    Please login or register to see this attachment.

     

    @morpheus75

    I won't be going to 4.131 (at least not in the next while) but it does give me an idea about which data to present in the final version of the vd

     

    You don't really need pushover for the logger I use, you could use the built in email in the HC2 instead of pushover.

    If you have the smart message hub running I can send you the logger I use which can leverage hc2 email

     

    I'll share all the code I create...

     

     

     

    Link to comment
    Share on other sites

    @AutoFrank

    to be honest dont use the smart message hub as yet.

    its just time!!!

    i always like to try and understand the code and implement it so that if anything goes wrong i can troubleshoot it and try and fix it.

    when i get some time will read your tutorials and start to implement them.

    thanks

    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
    Reply to this topic...

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