meterN 1.0

Talks about metering
fabioe
Posts: 9
Joined: Fri May 24, 2019 10:20 am

Re: meterN 1.0

Post by fabioe » Fri Aug 23, 2019 5:10 pm

Hi jeanmarc,
I have update to 1.2.1 ....tks for your work to fix.
In older versions, the skipped meters were not displayed in the live values ​​list and in the dashboard.
Also the live values ​​of the non-skipped meters that had not entered the command (for example my meters 33 34 and 35) did not appear in the list of live values.
I don't remember if they didn't even appear in dasboard.
In this way the table of live values and the dashboard ​​remains clean with only the operating values.
What do you think about it ?
Is it possible in the next versions to return to this type of live view and dashboard?
thanks again for the wonderful work.
good evening

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

Re: meterN 1.0

Post by jeanmarc » Fri Aug 23, 2019 6:08 pm

Yup, i'll add that to my todo list. It may takes few weeks as it's not bugging also i have to test next 123s release ;)

fabioe
Posts: 9
Joined: Fri May 24, 2019 10:20 am

Re: meterN 1.0

Post by fabioe » Fri Aug 23, 2019 7:56 pm

Tks again Jeanmarc !

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

Re: meterN 1.0

Post by megamarco83 » Thu Aug 29, 2019 3:38 pm

hi JM, just a minor issue.
with new version of metern devices that in previous version show status as "on/off" now are showing anly "1" when they are active, why? :-)

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

Re: meterN 1.0

Post by jeanmarc » Thu Aug 29, 2019 3:54 pm

It's not an issue, it's a feature ;)
Check the release note details

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

Re: meterN 1.0

Post by megamarco83 » Fri Aug 30, 2019 11:53 am

hi JM, sorry my mistake!

my reqsdm is:

Code: Select all

      } elseif ($argv[1] == 'boiler-status') {
        $outstr = exec('echo "pwm_ssr_dimmer("`pgrep -c pwm_ssr`"*X)"');
and the output of pgrep -c pwm_ssr is
0 when off
1 when on

so i try to modify comapps like this:

Code: Select all

      } elseif ($argv[1] == 'boiler-status') {
        //$outstr = exec('echo "pwm_ssr_dimmer("`pgrep -c pwm_ssr`"*X)"');
		$outstr1 = exec('`pgrep -c pwm_ssr`');
		if ($outstr1 == 1)
			$outstr = ('"pwm_ssr_dimmer(<font color='#228B22'>"ON"</font>*X)"');
		elseif
		    $outstr = ('"pwm_ssr_dimmer(<font color='#8B0000'>"OFF</font>*X")"');
but i receive this error:
pi@raspberrypi:~ $ reqsdm boiler-status
PHP Parse error: syntax error, unexpected '$outstr' (T_VARIABLE), expecting '(' in /var/www/comapps/reqsdm.php on line 108

can you help me ? :-)
thanks for your patience!

ps: i tried to add also font colour

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

Re: meterN 1.0

Post by jeanmarc » Fri Aug 30, 2019 1:55 pm

No problem,
You could try this

Code: Select all

if ($outstr1 == 1) {
    $outstr = ('pwm_ssr_dimmer(<font color=\'#228B22\'>ON</font>*X)');
} else {
    $outstr = ('pwm_ssr_dimmer(<font color=\'#8B0000\'>OFF</font>*X")');
}
I guess not a lot previously used "state" mode ;)

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

Re: meterN 1.0

Post by megamarco83 » Fri Aug 30, 2019 4:30 pm

hi JM, i tested but it not works because it show always OFF

if it's active:

Code: Select all

pi@raspberrypi:~ $ reqsdm boiler-status
sh: 1: 1: not found
pwm_ssr_dimmer(<font color='#8B0000'>OFF</font>*X")pi@raspberrypi:~ $
if it's not active:

Code: Select all

pi@raspberrypi:~ $ reqsdm boiler-status
sh: 1: 0: not found
pwm_ssr_dimmer(<font color='#8B0000'>OFF</font>*X")pi@raspberrypi:~ $
the reqsmd.php is:

Code: Select all

      } elseif ($argv[1] == 'boiler-status') {
        //$outstr = exec('echo "pwm_ssr_dimmer("`pgrep -c pwm_ssr`"*X)"');  //COMANDO ORIGINALE PRIMA DI METERN 1.1
		$outstr1 = exec('`pgrep -c pwm_ssr`');
		if ($outstr1 == 1) {
		$outstr = ('pwm_ssr_dimmer(<font color=\'#228B22\'>ON</font>*X)');
		} else {
		$outstr = ('pwm_ssr_dimmer(<font color=\'#8B0000\'>OFF</font>*X")');
		}
p.s. when i use command from shell (putty)
active:
pi@raspberrypi:~ $ pgrep -c pwm_ssr
1

not active:
pi@raspberrypi:~ $ pgrep -c pwm_ssr
0

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

Re: meterN 1.0

Post by jeanmarc » Fri Aug 30, 2019 4:50 pm

Your script in in bash ? Could you paste it completely ?

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

Re: meterN 1.0

Post by megamarco83 » Fri Aug 30, 2019 5:44 pm

sure, thanks

Code: Select all

#!/bin/sh
# /var/www/MyScripts/PWM/pwm_ssr_dimmer
# ln -s /var/www/MyScripts/PWM/pwm_ssr_dimmer.sh /usr/bin/pwm

case "$1" in
	start)
		pkill pwm_ssr.php
		nohup /var/www/MyScripts/PWM/pwm_ssr.php > /dev/null 2>&1 &
		# echo "Start PWM ssr dimmer..."
		;;
	stop)
		echo "Stop PWM ssr dimmer..."
		pkill pwm_ssr.php
		nohup /var/www/MyScripts/PWM/pwm_stop.php > /dev/null 2>&1 &
		;;
	*)
		echo "Usage: pwm (start|stop)"
		exit 1
		;;
esac

exit 0
with command

Code: Select all

pgrep -c pwm_ssr
i simply verify if it's running (start) or stopped (stop)

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests