meterN 1.0

Talks about metering
jeanmarc
Posts: 1856
Joined: Thu Aug 29, 2013 7:16 am

Re: meterN 1.0

Post by jeanmarc » Fri May 31, 2019 1:28 pm

Hello,

Sorry the the fast releases but here's some good changes for meterN 1.1 :

Change: Admin, getting ride of AUTH option. Make a cleaner authentication message.
Change : Getting ride of cookies, you need to save your style and languages in main configuration.
Bug: Admin, com test 'Live command'.
New: Allow other datasets, currently only IEC62056 is writted. It may open other format like IEC60870, any change will be for the whole application though.
Cleanup : Dashboard code

After the update, you need to save your main config.

Bye

jeanmarc
Posts: 1856
Joined: Thu Aug 29, 2013 7:16 am

Re: meterN 1.0

Post by jeanmarc » Sun Jun 16, 2019 4:04 pm

Hello,

Here a small mN 1.1.1 update that correct few things :

- Bug gauge on Firefox
- Bug when decomminssioning
- Avoid warning when testing com. apps if mN if already stopped

Bye

jeanmarc
Posts: 1856
Joined: Thu Aug 29, 2013 7:16 am

Re: meterN 1.0

Post by jeanmarc » Sat Jul 20, 2019 9:00 am

Hello,

mN1.2 is out :

- New : Add json dataset
- Change : IEC62056 dataset rewrited
- Change : Removed state & value mode for live values
- Some usual byte cleanup

In order to always simplify, removed "state & value" mode option. The live command can return anything, like the previously value mode does.
If you want to disable, just leave empty the command field.

If you previously used 'state' mode, it won't show 'On/Off', you need to change your com app to return 'On' or 'Off' rather than 1 and 0.
You can also trick your com app to return HTML tag to show colors like this :
meterid(<font color='#228B22'>On</font>*W)
meterid(<font color='#8B0000'>Off</font>*W)

You will have to save indicators + meters & sensors configurations.

Bye

megamarco83
Posts: 88
Joined: Tue Apr 14, 2015 9:25 am

Re: meterN 1.0

Post by megamarco83 » Sat Jul 20, 2019 11:08 am

Hi JM, i updated today to 1.2
all works fine except to comapps virtmet
i find this error:

Code: Select all

PHP Notice: Undefined variable: LIVEPOOL2 in /var/www/comapps/virtmeter.php on line 499PHP Notice: Undefined variable: LIVEPOOL1 in /var/www/comapps/virtmeter.php on line 5045(0*W) is not valid, the correct format is 5(1234.5*W)
that line inside the code call this:

Code: Select all

} elseif (($argv[4] == 'selfcpower') && (isFascia($calltime, $fascia))) {
        for ($i = 0; $i < count($prodlist); $i++) {
			if (${'LIVEPOOL' . $prodlist[$i]} == 1 && isset($livemem["${'METNAME'.$prodlist[$i]}$prodlist[$i]"])) {
				$prod += $livemem["${'METNAME'.$prodlist[$i]}$prodlist[$i]"];

that should coming from:

Code: Select all

	if (($argv[4] == 'power') && isFascia($calltime, $fascia)) {
		$cnt = count($addnumlist);
        for ($i = 0; $i < $cnt; $i++) {
			if (${'LIVEPOOL' . $addnumlist[$i]} == 1 && isset($livemem["${'METNAME'.$addnumlist[$i]}$addnumlist[$i]"])) {
				$toadd += $livemem["${'METNAME'.$addnumlist[$i]}$addnumlist[$i]"];
			}
		}
        $cnt = count($subnumlist);
        for ($i = 0; $i < $cnt; $i++) {
			if (${'LIVEPOOL' . $subnumlist[$i]} == 1 && isset($livemem["${'METNAME'.$subnumlist[$i]}$subnumlist[$i]"])) {
				$tosub += $livemem["${'METNAME'.$subnumlist[$i]}$subnumlist[$i]"];
do you change something in your code that can't be recognized by virtmet?


last thing, i try in main setting to change data format from IEC to Json, but the system, after saving, show everytime IEC and not json.
anyway if i set JSon, i'm not able to see any live data, and if i use the test i returned error on every sensor:

Code: Select all

Command : poolerconsumi 1 energy

1(38275885*Wh) is not valid
but this is normal i guess because i'm using SDM120 and the format data is different from json, correct?

jeanmarc
Posts: 1856
Joined: Thu Aug 29, 2013 7:16 am

Re: meterN 1.0

Post by jeanmarc » Sat Jul 20, 2019 12:23 pm

Hi,
Thanks for updating. You have to change virtmeter.php app
${'LIVEPOOL' . $xxx} == 1 to isset(${'LIVECOMMAND' . $xxx})
Since LIVEPOOL doesn't exist anymore.

If you wish to use JSON you have to change the output of all your comapps to {"meterid":value}

ps: you've right there a prob in choosing dataset, change line 94 to in admin-main to ($DATASET == $option) :oops:

megamarco83
Posts: 88
Joined: Tue Apr 14, 2015 9:25 am

Re: meterN 1.0

Post by megamarco83 » Sat Jul 20, 2019 1:00 pm

jeanmarc wrote:
Sat Jul 20, 2019 12:23 pm
Hi,
Thanks for updating. You have to change virtmeter.php app
${'LIVEPOOL' . $xxx} == 1 to isset(${'LIVECOMMAND' . $xxx})
Since LIVEPOOL doesn't exist anymore.

If you wish to use JSON you have to change the output of all your comapps to {"meterid":value}

ps: you've right there a prob in choosing dataset, change line 94 to in admin-main to ($DATASET == $option) :oops:
hi JM thanks again for supporting!
...i change the virtmeter.php app like this:


but now i obtain always this:

Code: Select all

		} elseif (($argv[4] == 'imppower') && (isFascia($calltime, $fascia))) {
        for ($i = 0; $i < count($prodlist); $i++) {
			if (isset(${'LIVECOMMAND' . $prodlist[$i]} == 1 && isset($livemem["${'METNAME'.$prodlist[$i]}$prodlist[$i]"])) {
				$prod += $livemem["${'METNAME'.$prodlist[$i]}$prodlist[$i]"];
			}
		}
        for ($i = 0; $i < count($conslist); $i++) {
			if (isset(${'LIVECOMMAND' . $conslist[$i]} == 1 && isset($livemem["${'METNAME'.$conslist[$i]}$conslist[$i]"])) {
				$cons += $livemem["${'METNAME'.$conslist[$i]}$conslist[$i]"];
			}
		}

Code: Select all

Command : virtmeter 3 0 0 imppower 0

PHP Parse error: syntax error, unexpected '{' in /var/www/comapps/virtmeter.php on line 453 is not valid, the correct format is 3(1234.5*W) 

jeanmarc
Posts: 1856
Joined: Thu Aug 29, 2013 7:16 am

Re: meterN 1.0

Post by jeanmarc » Sat Jul 20, 2019 1:08 pm

if (isset(${'LIVECOMMAND' . $prodlist[$i]}) && isset($livemem["${'METNAME'.$prodlist[$i]}$prodlist[$i]"])) {
and
if (isset(${'LIVECOMMAND' . $conslist[$i]}) && isset($livemem["${'METNAME'.$conslist[$i]}$conslist[$i]"])) {

megamarco83
Posts: 88
Joined: Tue Apr 14, 2015 9:25 am

Re: meterN 1.0

Post by megamarco83 » Sat Jul 20, 2019 1:14 pm

sorry, i forgot to put ")" after

${'LIVEPOOL' . $xxx} == 1 to isset(${'LIVECOMMAND' . $xxx})

thanks again for support, now works perfectly!

miki8989
Posts: 6
Joined: Thu Sep 28, 2017 1:15 pm

Re: meterN 1.0

Post by miki8989 » Mon Jul 29, 2019 6:54 am

Hello Jeanmarc
I updated metern yesterday to 1.2
unfortunately, besides the error reported and corrected, unfortunately partly because I find these errors

Code: Select all

pi@raspberrypi:~ $ virtmeter 11 3 0 energy F23
PHP Notice:  Undefined variable: PASSO11 in /var/www/comapps/virtmeter.php on line 430
PHP Warning:  file_put_contents(/dev/shm/produzione1.txt): failed to open stream: Permission denied in /var/www/comapps/pool123s.php on line 66
PHP Warning:  file_put_contents(/dev/shm/consumi2.txt): failed to open stream: Permission denied in /var/www/comapps/pooler.php on line 67
PHP Notice:  Undefined variable: PASSO11 in /var/www/comapps/virtmeter.php on line 543
PHP Notice:  Undefined variable: PASSO11 in /var/www/comapps/virtmeter.php on line 544
PHP Notice:  Undefined variable: PRECI11 in /var/www/comapps/virtmeter.php on line 695
PHP Notice:  Undefined variable: ID11 in /var/www/comapps/virtmeter.php on line 712
PHP Notice:  Undefined variable: UNIT11 in /var/www/comapps/virtmeter.php on line 712
(0*)
pi@raspberrypi:~ $ pooler 2 IE energy
PHP Warning:  file_put_contents(/dev/shm/consumi2.txt): failed to open stream: Permission denied in /var/www/comapps/pooler.php on line 67
2_IE(26912324*Wh)
pi@raspberrypi:~ $ pooler 2 P power
2_P(445*W)
with errors on pmessi file in shm

I tried to restore the old zipped version in the _INSTALL folder but unfortunately it doesn't work as before
maybe there was some other change outside the metern folder ??

thank you

jeanmarc
Posts: 1856
Joined: Thu Aug 29, 2013 7:16 am

Re: meterN 1.0

Post by jeanmarc » Mon Jul 29, 2019 7:22 am

Hi miki,
I don't know much about virtmeter. The issue don't seem related to mN but about permission.
Maybe chmod 666 /dev/shm/consumi2.txt

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest