Battery storage

Talks about metering
Post Reply
Posts: 1963
Joined: Thu Aug 29, 2013 7:16 am

Battery storage

Post by jeanmarc » Wed Jan 15, 2020 6:22 pm

I am thinking about adding battery storage but i don't know yet how to get it right. It should obviously visualize in dashboard energy flow but maybe show other information, like amount/remaining storage..

My first thoughts if about making a meter "Elect" "Storage" type and if you want more details (remaining storage,..) it could be shown as plain indicators.
How behave the main gauge.. (Consumption - (Production + Storage)) A nice battery gauge would be nice as well... :think:

Well if some of you have such devices, i am interested to know what values it returns.

Posts: 102
Joined: Sun Dec 29, 2013 1:20 pm

Re: Battery storage

Post by mstuetz » Thu Jan 30, 2020 8:47 am

I'm a long time user of 123solar and metern (started in 2013). Off course I would like to have storage covered better with meterN.
Since a couple of years I run a battery storage, here a pic of how I added it to meterN:
To have a quick overview, I added this java-script on the main side of my house's "website":
Off course efficency of this battery would be cool as well and a project planned for this year.

Posts: 1963
Joined: Thu Aug 29, 2013 7:16 am

Re: Battery storage

Post by jeanmarc » Sat Feb 01, 2020 5:45 pm

thanks for your feedback. Can you re link your code ?

Posts: 102
Joined: Sun Dec 29, 2013 1:20 pm

Re: Battery storage

Post by mstuetz » Tue Feb 11, 2020 8:50 am

Do you mean the battery graphic?
It's basically coded in js:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<meta http-equiv="refresh" content="10">
    <title>Infini Batterie Status</title>
    <script type="text/javascript" src="js/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="js/battery.js"></script>
    <link rel='stylesheet' type='text/css' href='css/battery.css'>
<div id="box">
    <div id="header">
    <span style="display: block;margin-bottom:5px;font-size: large;"><strong>Batterie Daten</strong></span>
    <div id="battery"></div>
    <div id="text">
        <span style="display: block" id="level">Ladezustand: unknown</span>
        <span style="display: block" id="voltage">Spannung: unknown</span>
        <span style="display: block" id="status">Status: unknown</span>
        <span style="display: block" id="current">Ladestrom: unknown</span>
<script type="text/javascript">
// setup the image
        var b = new Battery("assets/bat_empty.png", "assets/bat_full.png", 96, 168);
// get the battery information from system
        var $capacity = <?php echo (file_get_contents('/tmp/iBATTCAP.txt')/100); ?>;
        var $voltage = <?php echo file_get_contents('/tmp/iBATTV.txt'); ?>;
        var $chargestate = "<?php echo trim(file_get_contents('/tmp/iBATTCODE.txt')); ?>";
        var $chargecurr1 =  <?php echo file_get_contents('/tmp/iBATTCHAMP.txt'); ?>;
        var $chargecurr2 =  <?php echo file_get_contents('/tmp/i2BATTCHAMP.txt'); ?>;
        var $chargecurr =  $chargecurr1 + $chargecurr2;

// get the battery information to be displayed
        $('#level').text("Ladezustand: " + Math.round($capacity * 100) + "%");
        $('#voltage').text("Spannung: " + $voltage + " V");
// Show charging state
        if ($chargestate == "D") $('#status').text("Status: Entladen");
        if ($chargestate == "A") $('#status').text("Status: Laden Konst.A");
        if ($chargestate == "B") $('#status').text("Status: Laden Konst.V");
        if ($chargestate == "F") $('#status').text("Status: Erhaltungsl.");

//    b.updateBattery(battery.level * 100); // Diese 100 sind die Prozent!!!
        b.updateBattery($capacity * 100);
        $('#current').text("Ladestrom: " + $chargecurr + " A");

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests