Page 15 of 37

Re: Nefit Easy™

Posted: Monday 22 February 2016 22:28
by knights
@pepijn: is it also possible to pull the amount of m3 of gas and put this in a meter of somekind. Would love yo pull this data and put it into a chart.

Re: Nefit Easy™

Posted: Monday 22 February 2016 23:36
by pepijn
knights wrote:@pepijn: is it also possible to pull the amount of m3 of gas and put this in a meter of somekind. Would love yo pull this data and put it into a chart.
Yes it is, i'am working on that but have two issues:
1) time
2) the easy has 2 gas recordings yearly total and daily split by usage type (heating/hot water) i want to use the split data but this a day behind and only showing daily usage.

Re: Nefit Easy™

Posted: Monday 22 February 2016 23:39
by pepijn
Holland wrote:Question related to the nefit http server functionality of Domoticz. I tried to use another Domoticz server (in my case 10.58.60.84 and port 3000) as the remote server and it didn't work. Whereas locally, using 127.0.0.1 port 3000, it works without a problem. So a bit strange. Is this a known limitation?
Nefit easy server binds to the localhost by default. So you need to add the --host parameter as described in the documentation.

https://github.com/robertklep/nefit-eas ... /README.md

So not strange but as designed

Re: Nefit Easy™

Posted: Tuesday 23 February 2016 7:08
by knights
pepijn wrote:
knights wrote:@pepijn: is it also possible to pull the amount of m3 of gas and put this in a meter of somekind. Would love yo pull this data and put it into a chart.
Yes it is, i'am working on that but have two issues:
1) time
2) the easy has 2 gas recordings yearly total and daily split by usage type (heating/hot water) i want to use the split data but this a day behind and only showing daily usage.
will follow this thread for any new developments then. I am very happy with getting readouts from the nefit btw! Good luck with the project.

Re: Nefit Easy™

Posted: Wednesday 24 February 2016 20:32
by Niels
Hi all,
I reinstalled my Rpi with Jessie and updated node(v5.6.0) and NPM(v3.6.0), but can't the get Easy-server started up from a cronfile. My Linux-knowledge is (still) limited...I hope someone can help me out:

The script Sweetpants created (sligthly adapted, located in /home/pi/scripts) is working fine:

Code: Select all

#!/bin/bash

NEFIT_SERIAL_NUMBER=1234
NEFIT_ACCESS_KEY=abcd
NEFIT_PASSWORD=xyz

echo "running Easy Server"

/usr/local/bin/easy-server --serial=$NEFIT_SERIAL_NUMBER --access-key=$NEFIT_ACCESS_KEY --password=$NEFIT_PASSWORD >/tmp/easiest.log
It doesn't matter if I'm running this script as 'pi' or as root: it works just fine.

But:when I try to fire the script from a cron-file with this content:

Code: Select all

@reboot /home/pi/scripts/easiest > /tmp/cron.log 2> /tmp/cron.err
...there is something going wrong: the output in cron.err:

Code: Select all

/usr/local/lib/node_modules/nefit-easy-http-server/lib/cli/index.js:32
  return client.connect().then(() => {
                                ^
SyntaxError: Unexpected token )
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/nefit-easy-http-server/bin/easy-server:3:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
Any idea on how to fix this?

Cheers,
Niels

Re: Nefit Easy™

Posted: Wednesday 24 February 2016 21:01
by SweetPants
Does the cron entry works when using:

@reboot /home/pi/scripts/easiest > /dev/null 2>&1

Re: Nefit Easy™

Posted: Wednesday 24 February 2016 21:18
by Doler
Niels wrote:Hi all,
I reinstalled my Rpi with Jessie and updated node(v5.6.0) and NPM(v3.6.0), but can't the get Easy-server started up from a cronfile. My Linux-knowledge is (still) limited...I hope someone can help me out:

The script Sweetpants created (sligthly adapted, located in /home/pi/scripts) is working fine:

Code: Select all

#!/bin/bash

NEFIT_SERIAL_NUMBER=1234
NEFIT_ACCESS_KEY=abcd
NEFIT_PASSWORD=xyz

echo "running Easy Server"

/usr/local/bin/easy-server --serial=$NEFIT_SERIAL_NUMBER --access-key=$NEFIT_ACCESS_KEY --password=$NEFIT_PASSWORD >/tmp/easiest.log
It doesn't matter if I'm running this script as 'pi' or as root: it works just fine.

But:when I try to fire the script from a cron-file with this content:

Code: Select all

@reboot /home/pi/scripts/easiest > /tmp/cron.log 2> /tmp/cron.err
...there is something going wrong: the output in cron.err:

Code: Select all

/usr/local/lib/node_modules/nefit-easy-http-server/lib/cli/index.js:32
  return client.connect().then(() => {
                                ^
SyntaxError: Unexpected token )
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/nefit-easy-http-server/bin/easy-server:3:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
Any idea on how to fix this?

Cheers,
Niels
I too just switched to Jessie and followed the instructions on http://nodered.org/docs/hardware/raspberrypi.html, scroll down to chapter "Adding Autostart capability using SystemD" and follow instructions there to install the service and make it auto-start (not using cron).
Worked for me.

Re: Nefit Easy™

Posted: Wednesday 24 February 2016 22:03
by Holland
Experienced exactly the same problem, and to be honest I'm tired of fighting with cron. Cron is just a real pain.... So I dropped cron, and I now use PM2.

PM2 is similar to Forever, but I prefer PM2

After installing PM2, just run ; pm2 start nefiteasyhttpserver.sh

See below the script


#!/bin/bash

/usr/local/bin/easy-server --serial=asdasdasdasd --access-key=asdasdasdasd --password=asdasdasd > /dev/null

Re: Nefit Easy™

Posted: Wednesday 24 February 2016 22:18
by Niels
Thanks for your responses!

@SweetPants: Unfortunately not. No errorfile of course (because > null), but also no http-server running
@Doler: I'm not using node-red (yet), but will keep this suggestion in mind.
@Holland: I'll try this first...Glad to hear there is an alternative to cron.

I'll keep you posted. Thanks again!
Niels

Re: Nefit Easy™

Posted: Wednesday 24 February 2016 22:43
by SweetPants
It's complaining over line 32 in index.js
I use node v 4.3.1, maybe there is where your problem is

Re: Nefit Easy™

Posted: Thursday 25 February 2016 15:30
by Niels
PM2 seems to do the job. Next step is to auto-start PM2 at reboot...suggestions appreciated!

Re: Nefit Easy™

Posted: Thursday 25 February 2016 16:51
by Doler
Niels wrote:PM2 seems to do the job. Next step is to auto-start PM2 at reboot...suggestions appreciated!
pm2 start nefiteasyhttpserver.sh toevoegen aan /etc/rc.local (vóór de regel met exit 0)?

Re: Nefit Easy™

Posted: Thursday 25 February 2016 17:20
by pepijn
Doler wrote:
Niels wrote:PM2 seems to do the job. Next step is to auto-start PM2 at reboot...suggestions appreciated!
pm2 start nefiteasyhttpserver.sh toevoegen aan /etc/rc.local (vóór de regel met exit 0)?
Please keep it in English ;)

You must execute

Code: Select all

pm2 startup
Once, this wil generatie a startup script

See https://github.com/Unitech/pm2/blob/master/README.md

Re: Nefit Easy™

Posted: Thursday 25 February 2016 22:01
by Holland
For PM2, you need to do 2 things, to make apps restart at reboot

First as Pepijn mentioned;

Code: Select all

sudo pm2 startup
secondly

Code: Select all

sudo pm2 save


See also the docs pm2 -h

and

http://pm2.keymetrics.io/docs/usage/startup/

Re: Nefit Easy™

Posted: Friday 26 February 2016 15:01
by Kochmeister
Hi,

Beïng new in the Domoticz I read the Nefit Easy with interest.
I wonder if and how it would be possible to controll the nefit easy from my domoticz running on my Synology NAS.

Can someone shine a light on this?

Re: Nefit Easy™

Posted: Friday 26 February 2016 22:31
by Holland
To add a little color to PM2 thingy. I had myself some issues to let it autostart. (used the work perfectly)

Only if you are using Jessie (check via hostnamectl) the following workaround solves the autostart issue;

1. Delete the pm2*.sh file in /etc/init.d
2. sudo pm2 startup systemd –u pi
3. pm2 start nefiteasyhttpserver.sh
4. pm2 save

Then reboot the machine to check if it works


* credits to this guy: http://tech.scargill.net/pm2-node-red-and-the-rock/

Re: Nefit Easy™

Posted: Sunday 28 February 2016 1:01
by Holland
Nefit easy server binds to the localhost by default. So you need to add the --host parameter as described in the documentation.

https://github.com/robertklep/nefit-eas ... /README.md

So not strange but as designed
Thanks. Got it working now

Re: Nefit Easy™

Posted: Sunday 28 February 2016 17:48
by Niels
Thanks for the walkthrough Holland, works flawlessly!

Re: Nefit Easy™

Posted: Tuesday 01 March 2016 11:21
by Henk
Hi,

I have got my Rasberry Pi 0 running with Raspbian and Domoticz. All latest versions and working fine. But I can't get this installation for Nefit Easy get to work. I'll gues it is going wrong in the first stage. Tough I managed to install node v5.3.0 I get a 'Segmentation fault' as a reaction to the command node -v. When i ignore this fault and move on to installing the nefit client, I also get the samen notification on npm install. Any ideas of what is going wrong?

Re: Nefit Easy™

Posted: Tuesday 01 March 2016 13:07
by pepijn
Henk wrote:Hi,

I have got my Rasberry Pi 0 running with Raspbian and Domoticz. All latest versions and working fine. But I can't get this installation for Nefit Easy get to work. I'll gues it is going wrong in the first stage. Tough I managed to install node v5.3.0 I get a 'Segmentation fault' as a reaction to the command node -v. When i ignore this fault and move on to installing the nefit client, I also get the samen notification on npm install. Any ideas of what is going wrong?
Did you install the armv7 binaries instead of the armv6 needed for the 1st generation Pi's