Har du lyst til at støtte Stoker Pro? Læs mere her: Støt Stoker Pro Forum

MGM plugin for PellMon

Spørgsmål vedr. MGM samt det tilbehør der laves til MGM pillefyret
Brugeravatar
motoz
Stoker IV
Stoker IV
Indlæg: 124
Tilmeldt: 14 feb 2013 08:06
Mit fyr: BioComfort 30kW + termax 25cr
Geografisk sted: Ostrobothnia
Modtaget likes: 11 gange
Kontakt:

Re: MGM plugin for PellMon

Indlæg af motoz » 06 okt 2019 13:11

How's it going jimler75, do you have consumption statistics to show? (Just curious if it works or not)
PellMon open source pellet logger at https://github.com/motoz/PellMon


jimler75
Stoker I
Stoker I
Indlæg: 18
Tilmeldt: 26 sep 2019 09:40
Givet likes: 11 gange
Modtaget likes: 1 gang

Re: MGM plugin for PellMon

Indlæg af jimler75 » 06 okt 2019 20:45

motoz skrev:
06 okt 2019 13:11
How's it going jimler75, do you have consumption statistics to show? (Just curious if it works or not)
Hi ... it’s working great!

Don’t know if the data is correct though? But my best guess is it’s okay :-)

I’m happy - but I’m still learning! Can’t see where to setup alarms (if there is one - then send mail)
Vedhæftede filer
737B8EC0-5FD1-4A32-AE70-DC2C216466B6.png
985BD9C7-9F40-43E2-9F8A-E03724B03C6F.png

Brugeravatar
motoz
Stoker IV
Stoker IV
Indlæg: 124
Tilmeldt: 14 feb 2013 08:06
Mit fyr: BioComfort 30kW + termax 25cr
Geografisk sted: Ostrobothnia
Modtaget likes: 11 gange
Kontakt:

Re: MGM plugin for PellMon

Indlæg af motoz » 07 okt 2019 07:35

Nice!

There is a plugin for custom alarms, creatively called 'customalarms'... Enable it in /etc/pellmon/conf.d/enabled_plugins.conf and set it up in /etc/pellmon/conf.d/plugins/customalarms.conf. Then you can set up monitoring of any amount of 'items' with limits and comparison conditions.

Email is set up in conf.d/email.conf, it will then send a mail whenever an alarm is trigged by the plugin. I use it with a gmail account, but note that due to google being google there is a roadblock: https://github.com/motoz/PellMon/wiki/Gmail-and-PellMon

Note that this is not automatically connected to any 'alarm' condition of the burner, which is of course what we really want. There is probably some kind of alarm state available in the status.xml that could be connected to pellmon by adding it to the mgm.conf file, but I didn't get that far as long as I had access to the burner controller. Maybe you could have a look at the status.xml file and see what changes there when you for instance run out of pellet? Or does anybody already have that info?
PellMon open source pellet logger at https://github.com/motoz/PellMon

MGMJuniorUser
Stoker I
Stoker I
Indlæg: 3
Tilmeldt: 13 okt 2019 11:38
Givet likes: 1 gang

Re: MGM plugin for PellMon

Indlæg af MGMJuniorUser » 13 okt 2019 11:44

Hi guys
Tried installing pellmon on my raspberry pi but cant get it to work. Debug logs shows 401 auth error. Connecting to an MGM Junior with an TCnet controller version 1. I cant seem to find any login info(admin / boiler) in the MGM plugin code. Anybody got it to work with controller version 1 ?

Brugeravatar
motoz
Stoker IV
Stoker IV
Indlæg: 124
Tilmeldt: 14 feb 2013 08:06
Mit fyr: BioComfort 30kW + termax 25cr
Geografisk sted: Ostrobothnia
Modtaget likes: 11 gange
Kontakt:

Re: MGM plugin for PellMon

Indlæg af motoz » 13 okt 2019 14:11

There is indeed no provision made for explicitely setting username and password for http basic authentication, since the TCNET II controller doesn't have it (for some reason). Maybe the reason is that when the connection is not encrypted the username and password is transmitted in plain text so it's not worth much anyway. But since the TCNET I controller apparently uses it, you can simply add it to the IP setting which is just a text string used to form the url.

Enter the IP like this:

Kode: Vælg alt

username:password@1.2.3.4
should work...

I could add settings for username and password later, that would make it simpler to use it with TCNET-I (providing it actually works of course). The configuration file might need adjustment for TCNET-I, and could probably be extended for TCNET-II also as I didn't map out everything from the status.xml in the default configuration. If someones want to dig into the details and map out everything useful...

Thanks for trying out the code!
PellMon open source pellet logger at https://github.com/motoz/PellMon


MGMJuniorUser
Stoker I
Stoker I
Indlæg: 3
Tilmeldt: 13 okt 2019 11:38
Givet likes: 1 gang

Re: MGM plugin for PellMon

Indlæg af MGMJuniorUser » 13 okt 2019 21:48

Thanks, It works with the user:pass@ip :) And thank you for you good work with the plugin - I have looked for years for something like this.

The tcnet controller 1 interface:
1.png
Status.xml:
2.png
<response>
<err0>0</err0>
<err1>0</err1>
<err2>0</err2>
<err3>0</err3>
<err4>0</err4>
<led0>1</led0>
<led1>0</led1>
<led2>0</led2>
<led3>0</led3>
<led4>0</led4>
<led5>1</led5>
<led6>0</led6>
<led7>0</led7>
<btemp>60</btemp>
<utemp>60</utemp>
<otemp>24</otemp>
<ftemp>64</ftemp>
<pwr>0</pwr>
<debug>38</debug>
</response>

developer tools chrome:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" />
<title>TCNET Boiler Controller</title>
<link href="/mchp.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://gc.kis.v2.scr.kaspersky-labs.com ... C1/main.js" charset="UTF-8"></script><script src="/mchp.js" type="text/javascript"></script>
</head>

<body>
<div id="shadow-one"><div id="shadow-two"><div id="shadow-three"><div id="shadow-four">
<div id="page">

<div style="padding:0 0 5px 5px"><img src="/logo.gif" alt="Technoflame" /></div>

<div id="title"><div class="right">TCNET Boiler Controller Web Access</div><span id="hello">&nbsp;</span></div>

<div id="menu">
<a href="/index.htm">Status</a>
<a href="/tsetup.htm">Temperature Setup</a>
<a href="/wtmon.htm">Week Timer Setup</a>
<!-- <a href="/errlog.htm">Error Log</a> -->
<a href="/protect/config.htm">Network Configuration</a>
<a href="/protect/admin.htm">Administration</a>

</div>
<div id="content">
<h1>Welcome!</h1>
<p>Thank you for choosing Technoflame TCNET Boiler Controller.</p>
<p>Current status of your boiler:</p>
<div id="ignition_error" style="display:none"><p class="error">Error: Ignition failed.</p></div>
<div id="nofuel_error" style="display:none"><p class="error">Error: Out of pellets.</p></div>
<div id="overtemp_error" style="display:none"><p class="error">Error: Overtemperature detected.</p></div>
<div id="overcurrent_error" style="display:none"><p class="error">Error: Overcurrent detected.</p></div>
<div id="backburn_error" style="display:none"><p class="error">Error: Back burning to auger!.</p></div>

<div id="status">
<div id="loading" style="display:none"><p class="error">Error: Network connection lost.</p></div>

<div id="display">
<p>Temperatures:<br /></p>
<p>Building Heating: <span id="btemp" style="font-weight:normal">?</span>&deg;C</p>
<p>Utility Water: <span id="utemp" style="font-weight:normal">?</span>&deg;C</p>
<p>Outside Temp: <span id="otemp" style="font-weight:normal">?</span>&deg;C</p>
<p>Flue Temp: <span id="ftemp" style="font-weight:normal">?</span>&deg;C</p>
<p>Output Power: <span id="opwr" style="font-weight:normal">?</span>kW</p>
<p>CPU Load: <span id="loop0" style="font-weight:normal">?</span>%</p>
<p>Outputs:<br />
<span class="leds">
<table width="190" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10"><span id="led0">&bull;</span></td>
<td width="173">System On</td>
</tr>
<tr>
<td width="10"><span id="led1">&bull;</span></td>
<td>Auger</td>
</tr>
<tr>
<td width="10"><span id="led2">&bull;</span></td>
<td>Clean</td>
</tr>
<tr>
<td width="10"><span id="led3">&bull;</span></td>
<td>Refill</td>
</tr>
<tr>
<td width="10"><span id="led4">&bull;</span></td>
<td>Util. Water Pump</td>
</tr>
<tr>
<td width="10"><span id="led5">&bull;</span></td>
<td>Building Heating Pump</td>
</tr>
<tr>
<td width="10"><span id="led6">&bull;</span></td>
<td>Ignition</td>
</tr>
<tr>
<td width="10"><span id="led7">&bull;</span></td>
<td>Fan</td>
</tr>
</table></span></p>

</div>
</div>

<p>Firmware: v5.25</p>
</div>
<script type="text/javascript">
<!--
// Parses the xmlResponse from status.xml and updates the status box
function updateStatus(xmlData) {
// Check if a timeout occurred
if(!xmlData)
{
document.getElementById('display').style.display = 'none';
document.getElementById('loading').style.display = 'inline';
return;
}

document.getElementById('ignition_error').style.display = (getXMLValue(xmlData, 'err0') == '1') ? 'inline' : 'none';
document.getElementById('nofuel_error').style.display = (getXMLValue(xmlData, 'err1') == '1') ? 'inline' : 'none';
document.getElementById('overtemp_error').style.display = (getXMLValue(xmlData, 'err2') == '1') ? 'inline' : 'none';
document.getElementById('overcurrent_error').style.display = (getXMLValue(xmlData, 'err3') == '1') ? 'inline' : 'none';
document.getElementById('backburn_error').style.display = (getXMLValue(xmlData, 'err4') == '1') ? 'inline' : 'none';
// Make sure we're displaying the status display
document.getElementById('display').style.display = 'inline';
document.getElementById('loading').style.display = 'none';

// Loop over all the LEDs
for(i = 0; i < 8; i++)
document.getElementById('led' + i).style.color = (getXMLValue(xmlData, 'led' + i) == '1') ? '#090' : '#ddd';

// Loop over all the buttons
//for(i = 0; i < 4; i++)
// document.getElementById('btn' + i).innerHTML = (getXMLValue(xmlData, 'btn' + i) == 'up') ? 'OFF' : 'ON';

// Update the POT value
document.getElementById('btemp').innerHTML = getXMLValue(xmlData, 'btemp');
document.getElementById('utemp').innerHTML = getXMLValue(xmlData, 'utemp');
document.getElementById('otemp').innerHTML = getXMLValue(xmlData, 'otemp');
document.getElementById('ftemp').innerHTML = getXMLValue(xmlData, 'ftemp');
document.getElementById('opwr').innerHTML = getXMLValue(xmlData, 'pwr');
document.getElementById('loop0').innerHTML = getXMLValue(xmlData, 'debug');
}
setTimeout("newAJAXCommand('status.xml', updateStatus, true)",2000);
//-->
</script>
<div class="spacer">&nbsp;</div>
<div id="footer">Copyright &copy; 1999-2012 All rights reserved.<br>Developed by: Nusret Suzme &copy; 2010 </div>

</div></div></div></div></div>

</body>
</html>


I hope you can use this for something :)

Brugeravatar
motoz
Stoker IV
Stoker IV
Indlæg: 124
Tilmeldt: 14 feb 2013 08:06
Mit fyr: BioComfort 30kW + termax 25cr
Geografisk sted: Ostrobothnia
Modtaget likes: 11 gange
Kontakt:

Re: MGM plugin for PellMon

Indlæg af motoz » 14 okt 2019 07:13

Greatl!
Looks like it's using different xml tags for everything. You can edit your mgm.conf to match the status xml for what you have, for instance boiler temp was:

Kode: Vælg alt

i1_item = boiler_temp
i1_label = Boiler temp
i1_data = T1
i1_longname= Boiler temperature
i1_description = Boiler temperature
i1_unit = °C
i1_tags = All Basic MGM Temperatures
, change it to:

Kode: Vælg alt

i1_item = boiler_temp
i1_label = Boiler temp
i1_data = btemp
i1_longname= Boiler temperature
i1_description = Boiler temperature
i1_unit = °C
i1_tags = All Basic MGM Temperatures
and so on. Just delete (or comment away) the things you don't have (like oxygen and fan rpm). But to get pellet consumption calculation to work there will have to be some code updates. The plugin code 'hardcodes' the xml tags for power and 'process state' used in the calculation here: https://github.com/motoz/PellMon/blob/2 ... __.py#L202 , these are not found in the tcnet-I so it doesn't work.
PellMon open source pellet logger at https://github.com/motoz/PellMon

MGMJuniorUser
Stoker I
Stoker I
Indlæg: 3
Tilmeldt: 13 okt 2019 11:38
Givet likes: 1 gang

Re: MGM plugin for PellMon

Indlæg af MGMJuniorUser » 14 okt 2019 12:38

ok I will try that - thanks:)

Brugeravatar
Woop
Stoker II
Stoker II
Indlæg: 43
Tilmeldt: 13 aug 2016 23:39
Mit fyr: MGM Junior
Areal: 140
Brændsel: Piller, blandet kvalitet.
Modtaget likes: 6 gange

Re: MGM plugin for PellMon

Indlæg af Woop » 15 okt 2019 16:17

Hi
I’ve been offline for summer project, as I only use my MGM in the winter season.
I have a guide to get started (as I did several re-installs of the Raspberry Pi)
I will post it very soon.
Huge thanks to Motoz for doing and continuing this project.

Brugeravatar
motoz
Stoker IV
Stoker IV
Indlæg: 124
Tilmeldt: 14 feb 2013 08:06
Mit fyr: BioComfort 30kW + termax 25cr
Geografisk sted: Ostrobothnia
Modtaget likes: 11 gange
Kontakt:

Re: MGM plugin for PellMon

Indlæg af motoz » 18 okt 2019 09:22

Hello again Woop! Maybe you noticed that we have a release version now, did you try it out yet? (No changes from what you have, but easy to install)
PellMon open source pellet logger at https://github.com/motoz/PellMon


Besvar