Wiser and 2 Measurement modules Problems

Discussion in 'C-Bus Wiser 1 Controller' started by Charlie Crackle, Oct 8, 2011.

  1. Charlie Crackle

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    If you change the scaling for the widget so that it starts at a negative number then the bar chart starts at whatever that negative number is and increases from there. For example, if your widget scaling is from -1000W to +2000kW then the bottom of the bar chart will be at -1000wh. This looks a bit poxy as "zero" is at some arbitrary point on the bar chart, as the upper limit of the bar chart dynamically scales to suit the data range being displayed. The same applies to the "speedometer" widget.

    -ve numbers are handled correctly by all the underlying maths but they just don't look nice when graphed. I ended up just setting the minimum value for the widget scaling to 0. The totals still all work out correct and I just live with the bar graph columns sitting at 0 when the total for those hours/days is negative.
     
    Newman, Oct 21, 2011
    #21
  2. Charlie Crackle

    bmerrick

    Joined:
    Jun 13, 2007
    Messages:
    437
    Likes Received:
    35
    Location:
    Sydney
    Hi Guys,

    For those interested in seeing more than one 5504CMU output in Wiser, I just did a few extra channels in logic at a site with 2 solar panels and 3 phases hence 5 channels to monitor. This way also had the benefit of being seen on iPhone pages where the 1.1 Wiser app didn't show power monitors, but now fixed in 1.2. Most of the method I swiped from NickD's measurement app logic note in another post.

    Module 1 - Grid Instant Power
    once (Second = 55) then
    begin
    r_powerphase1 := GetRealIBSystemIO("Measurement App Real Value", 254, 28, 1);
    Format(s_powerphase1, r_powerphase1:2);
    Append(s_powerphase1, ' W');
    SetStringSystemIO("Red Phase #", s_powerphase1);
    r_powerphase2 := GetRealIBSystemIO("Measurement App Real Value", 254, 28, 2);
    Format(s_powerphase2, r_powerphase2:2);
    Append(s_powerphase2, ' W');
    SetStringSystemIO("White Phase #", s_powerphase2);
    r_powerphase3 := GetRealIBSystemIO("Measurement App Real Value", 254, 28, 3);
    Format(s_powerphase3, r_powerphase3:2);
    Append(s_powerphase3, ' W');
    SetStringSystemIO("Blue Phase #", s_powerphase3);
    r_powergridtotal := r_powerphase1 + r_powerphase2 + r_powerphase3;
    Format(s_powergridtotal, r_powergridtotal:2);
    Append(s_powergridtotal, ' W');
    SetStringSystemIO("Grid Input #", s_powergridtotal);
    end;

    Module 2 - Solar Instant Power

    once (Second = 55) then
    begin
    r_powersolar1 := GetRealIBSystemIO("Measurement App Real Value", 254, 35, 1);
    Format(s_powersolar1, r_powersolar1:2);
    Append(s_powersolar1, ' W');
    SetStringSystemIO("Solar Array 1 #", s_powersolar1);
    r_powersolar2 := GetRealIBSystemIO("Measurement App Real Value", 254, 35, 2);
    Format(s_powersolar2, r_powersolar2:2);
    Append(s_powersolar2, ' W');
    SetStringSystemIO("Solar Array 2 #", s_powersolar2);
    r_powersolartotal := r_powersolar1 + r_powersolar2;
    Format(s_powersolartotal, r_powersolartotal:2);
    Append(s_powersolartotal, ' W');
    SetStringSystemIO("Total Solar Output #", s_powersolartotal);
    end;


    Module 3: - Net Instant Power

    once (Second = 59) then
    begin
    r_powerNETtotal := r_powergridtotal - r_powersolartotal;
    Format(s_powerNETtotal, r_powerNETtotal:2);
    Append(s_powerNETtotal, ' W');
    SetStringSystemIO("Net Power Usage #", s_powerNETtotal);
    end;

    In the above Local Network is 254, 5504CMU unit addresses are 28 and 35, and the monitored channels are 28 channel 1,28 channel 2 and 28 channel 3 for grid and 35 channel 1 and 35 channel 2 for solar.

    Then just configured the 8 System I/O - see image 1

    Then just configured 8 widgets - see image 2

    The '#' were just so the SystemIO variable names didn't conflict with my actual power meters names, which were named the same for display as power meters using the normal widgets.

    With this logic you can add and subtract any mix of any number of channels to make up your Totals and then display them, albeit in text.

    hope this helps someone doing something similar to my client.

    All the best,

    Brad
     

    Attached Files:

    Last edited by a moderator: Oct 22, 2011
    bmerrick, Oct 21, 2011
    #22
  3. Charlie Crackle

    Charlie Crackle

    Joined:
    Aug 3, 2004
    Messages:
    815
    Likes Received:
    8
    Location:
    Melbourne

    Thank you for sharing that.
     
    Charlie Crackle, Oct 22, 2011
    #23
  4. Charlie Crackle

    wappinghigh

    Joined:
    Dec 20, 2005
    Messages:
    198
    Likes Received:
    0
    Hey...

    I like that. Thanks!!!
     
    wappinghigh, Oct 22, 2011
    #24
  5. Charlie Crackle

    Brendan Rogers

    Joined:
    Aug 3, 2004
    Messages:
    124
    Likes Received:
    0
    Thanks Brad,

    ... and you may condense your Wiser Logic code for each text-only power meter display a little further by replacing:
    Format(s_powerphase1, r_powerphase1:2);
    Append(s_powerphase1, ' W');


    With:
    Format(s_powerphase1, r_powerphase1:2, ' W');

    So we only need three lines of code for each text power meter instead of four. :)
     
    Brendan Rogers, Oct 22, 2011
    #25
  6. Charlie Crackle

    Brendan Rogers

    Joined:
    Aug 3, 2004
    Messages:
    124
    Likes Received:
    0
    Also, we should be able to use the one pair of real (e.g. r_powerphase1) and string (e.g. s_powerphase1) variables in the Wiser Logic successively over and over again for each text power meter, without having to set up a unique pair for each text power meter - unless you need these variables for some other purpose like calculating new totals.
     
    Brendan Rogers, Oct 22, 2011
    #26
  7. Charlie Crackle

    bmerrick

    Joined:
    Jun 13, 2007
    Messages:
    437
    Likes Received:
    35
    Location:
    Sydney
    Hi Guys,

    Glad some of you found some use for it.

    Brendan, thanks for the compression ideas which are also a good idea to add in. I had left it long hand as I was interstate onsite with limited time but also so those new to the logic could easily understand it.

    I now want to play around with it a bit more to get it to write to a file 'somewhere' as CSV as a pseudo database output / energy log. Feel free to write something for me :)

    All the best,

    Brad
     
    bmerrick, Oct 22, 2011
    #27
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.