Logic Machine Forum
Automatic meter reading AMR - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2)
+--- Thread: Automatic meter reading AMR (/showthread.php?tid=645)



Automatic meter reading AMR - Max - 24.02.2017

This is my first post and I don't know if it is a question or thread describing my way to the solution yet:-)

However I have offered a customer a solution where we will collect meter readings from ABB KNX electrical energy meters and present them in a compiled format.
The basic requirement is to save and present the reading for each meter each month.

It can be shown in the visualization but I think it will be a good feature to also generate a monthly report and send it on e-mail. 
Beyond this basic requirement my plan is to store the meter reading hourly for future reference and analytics.

I have no prior experience with LM so I start from scratch.

I have searched the forum and have not found a similar thread so I hope this is not a double post.

Advices are welcome, anyhow I now start my journey.


RE: Automatic meter reading AMR - Erwin van der Zwart - 24.02.2017

Hi,

You can create a trend to your metering datapoints and set resolution to 1 hour.

With script you can fetch data from the trends, and with this fetched data you can make either a csv file and send it by mail, or you can build a html energy report on the fly and insert the data from the trends into your html template.

This way you can send any data you like to any format you like.

Samples about how to use trend.fetch or mail csv file are here plenty on the forum...

I included a script to fetch data with script, see attachments.

Here is a short sample how to create a HTML setup and insert on the VAR0 to VAR16 fields your data and check the other dynamic fields, this HTML can be added to a mail message.

Code:
htmldata = [[<html style="font-family:Arial">
<body>

<h1>SSHN Energieoverzicht</h1>

<p>Geachte heer/mevrouw,</p>
<p>Hieronder vindt u de energie- en verbruiksrapportage van ]] .. VAR0 .. [[ locaties studentenhuisvesting xxxx. Na de omschrijving volgt het verbruik van de afgelopen periode (sinds de vorige rapportage die ]] .. old_date .. " om " .. old_hourandseconds .. [[ verstuurd is). Daarachter staat het totale verbruik vanaf de eerste rapportage.</p>
<table style="width:100%">
    <tr>
        <td><b>Omschrijving</b></td>
        <td><b>Verbruik</b></td>
        <td><b>Meterstand</b></td>
    </tr>
    <tr>
        <td>Studentenhuisvesting locatie A - Gasverbruik</td>
        <td>]] .. VAR1 .. [[ m3</td>
        <td>]] .. VAR2 .. [[ m3</td>
        </tr>
    <tr>
        <td>Studentenhuisvesting locatie B - Gasverbruik</td>
        <td>]] .. VAR3 .. [[ m3</td>
        <td>]] .. VAR4 .. [[ m3</td>
    </tr>
    <tr>
        <td>Studentenhuisvesting locatie C - Gasverbruik</td>
        <td>]] .. VAR5 .. [[ m3</td>
        <td>]] .. VAR6 .. [[ m3</td>
    </tr>
    <tr>
        <td>Studentenhuisvesting locatie D - Gasverbruik</td>
        <td>]] .. VAR7 .. [[ m3</td>
        <td>]] .. VAR8 .. [[ m3</td>
    </tr>
    <tr>
        <td>(...)</td>
        <td>(...) m3</td>
        <td>(...) m3</td>
    </tr>
</table>

<p>Onderstaand vindt u het rendement en het aantal draaiuren weergegeven van de ketels van ]] .. VAR0 .. [[ locaties studentenhuisvesting xxxxx. Bij het aantal draaiuren volgt na de omschrijving eerst het aantal draaiuren vanaf de vorige rapportage ]] .. old_date .. [[ en daarna het totale aantal draaiuren. Bij het rendement volgt eerst het rendement van de afgelopen periode en vervolgens het gemiddelde rendement over de gehele looptijd.</p>

<table style="width:100%">
    <tr>

        <td><b>Omschrijving</b></td>
        <td><b>Sinds Datum</b></td>
        <td><b>Totaal</b></td>
    </tr>
    <tr>
        <td>Studentenhuisvesting locatie A - Rendement ketel</td>
        <td>]] .. VAR9 .. [[ %</td>
        <td>]] .. VAR10 .. [[ %</td>
    </tr>
    <tr>
        <td>Studentenhuisvesting locatie A - Draaiuren ketel</td>
        <td>]] .. VAR11 .. [[ uur</td>
        <td>]] .. VAR12 .. [[ uur</td>
    </tr>
    <tr>
        <td>Studentenhuisvesting locatie B - Rendement ketel</td>
        <td>]] .. VAR13 .. [[ %</td>
        <td>]] .. VAR14 .. [[ %</td>
    </tr>
    <tr>
        <td>Studentenhuisvesting locatie B - Draaiuren ketel</td>
        <td>]] .. VAR15 .. [[ uur</td>
        <td>]] .. VAR16 .. [[ uur</td>
    </tr>
    <tr>
        <td>(...)</td>
        <td>(...)</td>
        <td>(...)</td>
    </tr>
</table>

<p>Wanneer u vragen heeft over deze rapportage kunt u contact opnemen met xxxxxx. Dit kan door te bellen naar xxxxxx of door te antwoorden op dit bericht.</p>
<p>Deze rapportage is verzonden op ]] .. current_date .. [[ om ]] .. current_hourandseconds .. [[ uur.</p>
</body>
</html>]]

Small tip: Next time consider ( Schneider iEM (; ) modbus meters, they are a lot cheaper then KNX meters, they contain more data and the dataflow is not impacting your KNX bus...

BR,

Erwin


RE: Automatic meter reading AMR - Max - 24.02.2017

Thank you Erwin,

Initially I was not thinking about trends since the meter reading is just calculating upwards.
But I guess you have a point and I will try it.