Nefit Easy™

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

knights
Posts: 17
Joined: Monday 22 February 2016 20:05
Target OS: -
Domoticz version:
Contact:

Re: Nefit Easy™

Post 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.
pepijn
Posts: 251
Joined: Friday 12 July 2013 13:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Nefit Easy™

Post 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.
pepijn
Posts: 251
Joined: Friday 12 July 2013 13:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Nefit Easy™

Post 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
knights
Posts: 17
Joined: Monday 22 February 2016 20:05
Target OS: -
Domoticz version:
Contact:

Re: Nefit Easy™

Post 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.
Niels
Posts: 14
Joined: Friday 15 January 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Nefit Easy™

Post 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
SweetPants

Re: Nefit Easy™

Post by SweetPants »

Does the cron entry works when using:

@reboot /home/pi/scripts/easiest > /dev/null 2>&1
Doler
Posts: 142
Joined: Friday 31 July 2015 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Sint-Oedenrode, Netherlands
Contact:

Re: Nefit Easy™

Post 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.
Mark: Domoticz Beta on Raspberry Pi 4 running Debian Bookworm - Z-Stick 7 - RFXCom - P1 - MySensors - SolarEdge - Dahua - Philips Hue - Docker - Zigbee2mqtt (plugin) - Zwave-js-ui - dzVents - Nodered
Holland
Posts: 179
Joined: Friday 12 July 2013 13:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta Ch
Location: The Netherlands
Contact:

Re: Nefit Easy™

Post 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
Niels
Posts: 14
Joined: Friday 15 January 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Nefit Easy™

Post 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
SweetPants

Re: Nefit Easy™

Post 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
Niels
Posts: 14
Joined: Friday 15 January 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Nefit Easy™

Post by Niels »

PM2 seems to do the job. Next step is to auto-start PM2 at reboot...suggestions appreciated!
Doler
Posts: 142
Joined: Friday 31 July 2015 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Sint-Oedenrode, Netherlands
Contact:

Re: Nefit Easy™

Post 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)?
Mark: Domoticz Beta on Raspberry Pi 4 running Debian Bookworm - Z-Stick 7 - RFXCom - P1 - MySensors - SolarEdge - Dahua - Philips Hue - Docker - Zigbee2mqtt (plugin) - Zwave-js-ui - dzVents - Nodered
pepijn
Posts: 251
Joined: Friday 12 July 2013 13:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Nefit Easy™

Post 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
Holland
Posts: 179
Joined: Friday 12 July 2013 13:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta Ch
Location: The Netherlands
Contact:

Re: Nefit Easy™

Post 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/
Kochmeister
Posts: 17
Joined: Wednesday 24 February 2016 11:50
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Nefit Easy™

Post 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?
Holland
Posts: 179
Joined: Friday 12 July 2013 13:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta Ch
Location: The Netherlands
Contact:

Re: Nefit Easy™

Post 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/
Holland
Posts: 179
Joined: Friday 12 July 2013 13:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta Ch
Location: The Netherlands
Contact:

Re: Nefit Easy™

Post 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
Niels
Posts: 14
Joined: Friday 15 January 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Nefit Easy™

Post by Niels »

Thanks for the walkthrough Holland, works flawlessly!
Henk
Posts: 24
Joined: Tuesday 01 March 2016 11:08
Target OS: Windows
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: Nefit Easy™

Post 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?
pepijn
Posts: 251
Joined: Friday 12 July 2013 13:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Nefit Easy™

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest