Page 1 of 1

Battery storage

Posted: Wed Jan 15, 2020 6:22 pm
by jeanmarc
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.

Re: Battery storage

Posted: Thu Jan 30, 2020 8:47 am
by mstuetz
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.

Re: Battery storage

Posted: Sat Feb 01, 2020 5:45 pm
by jeanmarc
thanks for your feedback. Can you re link your code ?

Re: Battery storage

Posted: Tue Feb 11, 2020 8:50 am
by mstuetz
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");