Nefit Easy™

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

Moderator: leecollings

ivovangastel
Posts: 8
Joined: Tuesday 31 January 2017 18:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Netherlands
Contact:

Re: Nefit Easy™

Post by ivovangastel »

@jumbotroll
thanks, I see the devices now. I had a feeling it was something simple i forgot.
spikehome
Posts: 24
Joined: Friday 04 March 2016 15:13
Target OS: -
Domoticz version:
Contact:

Re: Nefit Easy™

Post by spikehome »

jannl wrote:My crontab line is:

Code: Select all

@reboot /home/pi/domoticz/scripts/nefit.sh > /dev/null 2>&1
The contents of the nefit.sh script:

Code: Select all

#!/bin/bash
NEFIT_SERIAL_NUMBER=123456
NEFIT_ACCESS_KEY=mycode
NEFIT_PASSWORD=mypassword
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games

easy-server --serial=$NEFIT_SERIAL_NUMBER --access-key=$NEFIT_ACCESS_KEY --password=$NEFIT_PASSWORD 2>&1

Take care of the path setting in the script. A script run by crontab never has any path settings. Not sure btw if the games thingie is needed.....
did as u said.
but after a reboot
i run "pm2 status /home/pi/nefiteasyhttpserver.sh" to check if the server runs
i get then:
pi@domoticz:~ $ pm2 status /home/pi/nefiteasyhttpserver.sh
[PM2] Spawning PM2 daemon with pm2_home=/home/pi/.pm2
[PM2] PM2 Successfully daemonized
┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │
└──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app
seems not to run.
when i run the nefit.sh script manual i got:
pi@domoticz:~ $ /home/pi/domoticz/scripts/nefit.sh
{ Error: listen EADDRINUSE 127.0.0.1:3000
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at Server._listen2 (net.js:1259:14)
at listen (net.js:1295:10)
at net.js:1405:9
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
code: 'EADDRINUSE',
errno: 'EADDRINUSE',
syscall: 'listen',
address: '127.0.0.1',
port: 3000 }

strange!



edit:
seems to run but the command "pm2 status /home/pi/nefiteasyhttpserver.sh" not works
jannl
Posts: 625
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: Nefit Easy™

Post by jannl »

Not sure if 'my' solution is compatible with pm2. It propably isn't.
jurgen
Posts: 30
Joined: Friday 02 October 2015 19:09
Target OS: NAS (Synology & others)
Domoticz version: stable
Contact:

Re: Nefit Easy™

Post by jurgen »

Hi Ivo,

Please see https://www.domoticz.com/wiki/Synology

I have wrote the tutorial and post it on the wiki.

Good luck.

ivovangastel wrote:Hi all,
is there a manual "installing nefit easy http server" on a synology NAS for dummies?
I have a DS214+ (DSM 6.0.2) with Domoticz V3.5877 and Node.JS V4 installed. I use it to control my blinds and a wallplug via RFXCOM.
now i would like to add control to my Nefit Easy.

I tried to add the server via the hardware menu in Domoticz. but no new devices appear. I see the following in the log:
2017-01-31 18:18:58.290 Error: Webserver: File '/bridge/ecus/rrc/uiStatus': No such file or directory (2)
2017-01-31 18:18:58.352 Error: NefitEasy: Invalid data received (main)!
2017-01-31 18:18:58.353 Error: Webserver: File '/bridge/system/appliance/systemPressure': No such file or directory (2)
2017-01-31 18:18:58.413 Error: NefitEasy: Invalid data received! (Press)

I logged in my NAS via SSH and tried to install the server with the command: npm i nefit-easy-http-server -g
but I get the following:
npm ERR! Linux 3.2.40
npm ERR! argv "/volume1/@appstore/Node.js_v4/usr/local/bin/node" "/usr/local/bin/npm" "i" "nefit-easy-http-server" "-g"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! path /var/services/homes
npm ERR! code EEXIST
npm ERR! errno -17
npm ERR! syscall mkdir

npm ERR! EEXIST: file already exists, mkdir '/var/services/homes'
File exists: /var/services/homes
Move it away, and try again.
npm ERR! Linux 3.2.40
npm ERR! argv "/volume1/@appstore/Node.js_v4/usr/local/bin/node" "/usr/local/bin/npm" "i" "nefit-easy-http-server" "-g"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! path npm-debug.log.2825733194
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open

npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.2825733194'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, open 'npm-debug.log.2825733194']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.2825733194' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /npm-debug.log

So now I am a bit lost. where do I start?
dewagt
Posts: 10
Joined: Thursday 19 February 2015 10:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Nefit Easy™

Post by dewagt »

I installed the nefit server

npm i nefit-easy-http-server -g

started it

created the Nefit Easy HTTP server over LAN interface

But when checking:

curl http://127.0.0.1:3000/bridge/ecus/rrc/uiStatus

I got the next messages:
Error: INVALID_RESPONSE
at pending.(anonymous function).send.then.e (/usr/lib/node_modules/nefit-easy-http-server/node_modules/nefit-easy-core/lib/index.js:211:21)
at tryCatcher (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:649:20)
at tryOnImmediate (timers.js:622:5)

I unplugged the nefit easy, (reset) but this didn't work.

In domoticz I got the next messages in the log:
2017-02-09 21:29:38.890 Error: NefitEasy: Invalid data received (main)!
2017-02-09 21:30:09.088 Error: NefitEasy: Invalid data received! (Press)
2017-02-09 21:30:09.285 Error: NefitEasy: Invalid data received! (Gas)
2017-02-09 21:31:09.592 Error: NefitEasy: Invalid data received (main)!

Someone ideas how to solve this?

I have another question. According to Nefit, they don't save anything on their server, only some information about me, and the installation. So if some information is requested it should come from the easy. Some people got the information after resetting the easy, so seems to be right. But don't I need the IP adres of the easy in the settings? Or is that handled by the nefit server?
1x RPi B+
1x RFXcom433e
KAKU: 1x APA3-1500R (3 switches), 4x AMST-606, 1x ASUN-650, 1x AFR-060, 1x AFR-100
ELRO: 4x AB400
ELRO: 4x COCO GDR2-1000R
Wether: 3x Xiron outdoormeters, Alecto 4500, Alecto 1700
Doorbells: 2x action
LG-tv, Yamaha-receiver
checkdiz
Posts: 14
Joined: Monday 09 January 2017 21:49
Target OS: -
Domoticz version:
Contact:

Re: Nefit Easy™

Post by checkdiz »

I have followed the tutorial and got nefit working.
I got stuck at the point where you have to make a startup script. How do I make it and what should it contain?
jurgen wrote:Hi Ivo,

Please see https://www.domoticz.com/wiki/Synology

I have wrote the tutorial and post it on the wiki.

Good luck.

ivovangastel wrote:Hi all,
is there a manual "installing nefit easy http server" on a synology NAS for dummies?
I have a DS214+ (DSM 6.0.2) with Domoticz V3.5877 and Node.JS V4 installed. I use it to control my blinds and a wallplug via RFXCOM.
now i would like to add control to my Nefit Easy.

I tried to add the server via the hardware menu in Domoticz. but no new devices appear. I see the following in the log:
2017-01-31 18:18:58.290 Error: Webserver: File '/bridge/ecus/rrc/uiStatus': No such file or directory (2)
2017-01-31 18:18:58.352 Error: NefitEasy: Invalid data received (main)!
2017-01-31 18:18:58.353 Error: Webserver: File '/bridge/system/appliance/systemPressure': No such file or directory (2)
2017-01-31 18:18:58.413 Error: NefitEasy: Invalid data received! (Press)

I logged in my NAS via SSH and tried to install the server with the command: npm i nefit-easy-http-server -g
but I get the following:
npm ERR! Linux 3.2.40
npm ERR! argv "/volume1/@appstore/Node.js_v4/usr/local/bin/node" "/usr/local/bin/npm" "i" "nefit-easy-http-server" "-g"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! path /var/services/homes
npm ERR! code EEXIST
npm ERR! errno -17
npm ERR! syscall mkdir

npm ERR! EEXIST: file already exists, mkdir '/var/services/homes'
File exists: /var/services/homes
Move it away, and try again.
npm ERR! Linux 3.2.40
npm ERR! argv "/volume1/@appstore/Node.js_v4/usr/local/bin/node" "/usr/local/bin/npm" "i" "nefit-easy-http-server" "-g"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! path npm-debug.log.2825733194
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open

npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.2825733194'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, open 'npm-debug.log.2825733194']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.2825733194' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /npm-debug.log

So now I am a bit lost. where do I start?


Sent from my iPad using Tapatalk
checkdiz
Posts: 14
Joined: Monday 09 January 2017 21:49
Target OS: -
Domoticz version:
Contact:

Re: Nefit Easy™

Post by checkdiz »

Anyone?? I just need some guidance on making the startup script like how to make it, what to put in, where to place it. Again, I got it working but once I close putty session the server stops


Sent from my iPad using Tapatalk
spikehome
Posts: 24
Joined: Friday 04 March 2016 15:13
Target OS: -
Domoticz version:
Contact:

Re: Nefit Easy™

Post by spikehome »

checkdiz wrote:Anyone?? I just need some guidance on making the startup script like how to make it, what to put in, where to place it. Again, I got it working but once I close putty session the server stops


Sent from my iPad using Tapatalk
few messages back
viewtopic.php?p=120175#p117654
checkdiz
Posts: 14
Joined: Monday 09 January 2017 21:49
Target OS: -
Domoticz version:
Contact:

Re: Nefit Easy™

Post by checkdiz »

thanks! so I need cron to make the script and let it run.
I think the lines in the example you are referring to are for a Pi. In my case, for a synology, how would the pathsetting look like?
spikehome
Posts: 24
Joined: Friday 04 March 2016 15:13
Target OS: -
Domoticz version:
Contact:

Re: Nefit Easy™

Post by spikehome »

sorry no experience with synology to get it work
I have a synology to but use the pi for domoticz
jurgen
Posts: 30
Joined: Friday 02 October 2015 19:09
Target OS: NAS (Synology & others)
Domoticz version: stable
Contact:

Re: Nefit Easy™

Post by jurgen »

checkdiz wrote:Anyone?? I just need some guidance on making the startup script like how to make it, what to put in, where to place it. Again, I got it working but once I close putty session the server stops


Sent from my iPad using Tapatalk
Create the following script and save it in the directory /usr/local/etc/rc.d/
Enter your key, password etc.. before save it in the directory.


Code: Select all

#! /bin/sh
### BEGIN INIT INFO
# Provides:          nefit easy http server
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $network $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: nefit-easy-http-server
# Description:       This daemon will start the nefit-easy-http-server for use by Domoticz
### END INIT INFO

# Do NOT "set -e"

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Nefit Easy HTTP Server"
NAME=easy-server
USERNAME=root
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/usr/local/etc/rc.d/$NAME
NEFIT_SERIAL_NUMBER=ENTERYOURSERIAL
NEFIT_ACCESS_KEY=ENTERYOURKEY
NEFIT_PASSWORD=ENTERYOURPASSWORD
NEFIT_HOST=127.0.0.1
NEFIT_PORT=3000


DAEMON=/usr/local/bin/$NAME

DAEMON_ARGS="$DAEMON_ARGS --serial=$NEFIT_SERIAL_NUMBER"
DAEMON_ARGS="$DAEMON_ARGS --access-key=$NEFIT_ACCESS_KEY"
DAEMON_ARGS="$DAEMON_ARGS --password=$NEFIT_PASSWORD"
DAEMON_ARGS="$DAEMON_ARGS --host=$NEFIT_HOST"
DAEMON_ARGS="$DAEMON_ARGS --port=$NEFIT_PORT"


# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

#
# Function that starts the daemon/service
#
do_start()
{
    nohup $DAEMON $DAEMON_ARGS &
  echo `ps w | grep ${DAEMON} | grep -v -E 'grep' | awk '{print $1}' > $PIDFILE`



}



wait_for_status ()
{
    counter=$2
    while [ ${counter} -gt 0 ]; do
        do_status
        [ $? -eq $1 ] && return
        let counter=counter-1
        sleep 1
    done
    return 1
}





#
# Function that stops the daemon/service
#

do_stop()

{
    # Kill the application
    kill `cat ${PIDFILE}`
    wait_for_status 1 20 || kill -9 `cat ${PIDFILE}`
    rm -f ${PIDFILE}
}



do_status ()
{
    if [ -f ${PIDFILE} ] && kill -0 `cat ${PIDFILE}` > /dev/null 2>&1; then
        return
    fi
    rm -f ${PIDFILE}
    return 1
}





case "$1" in
  start)
        do_start
        ;;
  stop)
        do_stop
        ;;
  restart)
        do_stop
        do_start
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
        exit 3
        ;;
esac

:
johanv
Posts: 7
Joined: Sunday 05 March 2017 14:24
Target OS: Linux
Domoticz version: 2020.2
Contact:

Re: Nefit Easy™

Post by johanv »

On my raspberry pi 3 I installed nefit-easy as documented on the domoticz wiki.
I installed the latest node.js and for test i installed nefit-easy-cli, but i can get the connection to the thermostat.
The serial, acceskey and password are corrent (these params works with my nefit app on my ipad.)
The raspberry and nefit easy are in the same subnet and i can ping it from the raspberry.
What can be the problem?
checkdiz
Posts: 14
Joined: Monday 09 January 2017 21:49
Target OS: -
Domoticz version:
Contact:

Re: Nefit Easy™

Post by checkdiz »

thanks Jurgen Im gonna try it!!
Awst6000
Posts: 108
Joined: Thursday 12 February 2015 7:51
Target OS: Linux
Domoticz version:
Contact:

Re: Nefit Easy™

Post by Awst6000 »

I have problems to get the nefit webserver running.

These are the errors:
SyntaxError: Unexpected token �
at Object.parse (native)
at /usr/local/lib/node_modules/nefit-easy-http-server/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/lib/index.js:222:28
at tryCatcher (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:17:14)
at processImmediate [as _immediateCallback] (timers.js:383:17)
192.168.2.222 - - [18/Mar/2017:12:42:04 +0000] "GET /bridge/ecus/rrc/uiStatus HTTP/1.1" 500 1748 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/602.37 (KHTML, like Gecko) Chrome/54.0.24091.0 Safari/602.37"
Error: Invalid character in statusMessage.
at ServerResponse.writeHead (_http_server.js:195:11)
at ServerResponse.writeHead (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/morgan/node_modules/on-headers/index.js:55:19)
at ServerResponse._implicitHeader (_http_server.js:157:8)
at ServerResponse.OutgoingMessage.end (_http_outgoing.js:573:10)
at ServerResponse.send (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/express/lib/response.js:211:10)
at /usr/local/lib/node_modules/nefit-easy-http-server/lib/cli/server.js:46:18
at Layer.handle_error (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/express/lib/router/layer.js:71:5)
at trim_prefix (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/express/lib/router/index.js:315:13)
at /usr/local/lib/node_modules/nefit-easy-http-server/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/express/lib/router/index.js:335:12)
at Immediate.next (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/express/lib/router/index.js:275:10)
at Immediate.<anonymous> (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/express/lib/router/index.js:635:15)
at Immediate.immediate._onImmediate (timers.js:435:18)
at processImmediate [as _immediateCallback] (timers.js:383:17)


I start the server with (I deleted the values here ofcourse):
export NEFIT_SERIAL_NUMBER=
export NEFIT_ACCESS_KEY=
export NEFIT_PASSWORD=
easy-server --serial=$NEFIT_SERIAL_NUMBER --access-key=$NEFIT_ACCESS_KEY --password=$NEFIT_PASSWORD --host=192.168.2.211 --port=3000

What went wrong?

In another thread I saw that it could help to click the Nefit from the wall and click it back on again.
Didn't work for me.
checkdiz
Posts: 14
Joined: Monday 09 January 2017 21:49
Target OS: -
Domoticz version:
Contact:

Re: Nefit Easy™

Post by checkdiz »

jurgen wrote:
checkdiz wrote:Anyone?? I just need some guidance on making the startup script like how to make it, what to put in, where to place it. Again, I got it working but once I close putty session the server stops


Sent from my iPad using Tapatalk
Create the following script and save it in the directory /usr/local/etc/rc.d/
Enter your key, password etc.. before save it in the directory.


Code: Select all

#! /bin/sh
### BEGIN INIT INFO
# Provides:          nefit easy http server
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $network $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: nefit-easy-http-server
# Description:       This daemon will start the nefit-easy-http-server for use by Domoticz
### END INIT INFO

# Do NOT "set -e"

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Nefit Easy HTTP Server"
NAME=easy-server
USERNAME=root
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/usr/local/etc/rc.d/$NAME
NEFIT_SERIAL_NUMBER=ENTERYOURSERIAL
NEFIT_ACCESS_KEY=ENTERYOURKEY
NEFIT_PASSWORD=ENTERYOURPASSWORD
NEFIT_HOST=127.0.0.1
NEFIT_PORT=3000


DAEMON=/usr/local/bin/$NAME

DAEMON_ARGS="$DAEMON_ARGS --serial=$NEFIT_SERIAL_NUMBER"
DAEMON_ARGS="$DAEMON_ARGS --access-key=$NEFIT_ACCESS_KEY"
DAEMON_ARGS="$DAEMON_ARGS --password=$NEFIT_PASSWORD"
DAEMON_ARGS="$DAEMON_ARGS --host=$NEFIT_HOST"
DAEMON_ARGS="$DAEMON_ARGS --port=$NEFIT_PORT"


# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

#
# Function that starts the daemon/service
#
do_start()
{
    nohup $DAEMON $DAEMON_ARGS &
  echo `ps w | grep ${DAEMON} | grep -v -E 'grep' | awk '{print $1}' > $PIDFILE`



}



wait_for_status ()
{
    counter=$2
    while [ ${counter} -gt 0 ]; do
        do_status
        [ $? -eq $1 ] && return
        let counter=counter-1
        sleep 1
    done
    return 1
}





#
# Function that stops the daemon/service
#

do_stop()

{
    # Kill the application
    kill `cat ${PIDFILE}`
    wait_for_status 1 20 || kill -9 `cat ${PIDFILE}`
    rm -f ${PIDFILE}
}



do_status ()
{
    if [ -f ${PIDFILE} ] && kill -0 `cat ${PIDFILE}` > /dev/null 2>&1; then
        return
    fi
    rm -f ${PIDFILE}
    return 1
}





case "$1" in
  start)
        do_start
        ;;
  stop)
        do_stop
        ;;
  restart)
        do_stop
        do_start
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
        exit 3
        ;;
esac

:
i have the script ready and saved on my laptop (.sh).
how do i get it into the folder you mentioned?
johanv
Posts: 7
Joined: Sunday 05 March 2017 14:24
Target OS: Linux
Domoticz version: 2020.2
Contact:

Re: Nefit Easy™

Post by johanv »

I can't get easy-server running.
Domoticz doesn't connect.
I found out that looking with netstat i can't find any process listening on port 3000.
The serialnumber, key, password are ok i checked that serveral times.
jurgen
Posts: 30
Joined: Friday 02 October 2015 19:09
Target OS: NAS (Synology & others)
Domoticz version: stable
Contact:

Re: Nefit Easy™

Post by jurgen »

Hi Johan and CheckDiz

Are you able to start easy-server using this command and then check if it is listening on port 3000 ?
sudo easy-server --serial=SERIAL --access-key=KEY --password=PASSWORD

netstat -a |grep 3000
tcp 0 0 localhost:3000 0.0.0.0:* LISTEN

if you would use the the following script easy-server.sh to run easy-server after booting put easy-server.sh in directory /usr/local/etc/rc.d

I also recommend to copy and paste the script in a file with text editor from synology and move the script using ssh in the right directory like
sudo cp /volume1/homes/username/easy-server.sh /usr/local/etc/rc.d/easy-server.sh

Please make sure you name it easy-server.sh and change the rights so it is executeable.
sudo chmod 755 easy-server.sh

test the script
sudo ./easy-server.sh start

netstat -a |grep 3000
tcp 0 0 localhost:3000 0.0.0.0:* LISTEN

Code: Select all

#! /bin/sh
### BEGIN INIT INFO
# Provides:          nefit easy http server
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $network $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: nefit-easy-http-server
# Description:       This daemon will start the nefit-easy-http-server for use by Domoticz
### END INIT INFO
 
# Do NOT "set -e"
 
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Nefit Easy HTTP Server"
NAME=easy-server
USERNAME=root
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/usr/local/etc/rc.d/$NAME
NEFIT_SERIAL_NUMBER=ENTERSERIAL
NEFIT_ACCESS_KEY=ENTERKEY
NEFIT_PASSWORD=ENTERPASSWORD
NEFIT_HOST=127.0.0.1
NEFIT_PORT=3000
 
 
DAEMON=/usr/local/bin/$NAME
 
DAEMON_ARGS="$DAEMON_ARGS --serial=$NEFIT_SERIAL_NUMBER"
DAEMON_ARGS="$DAEMON_ARGS --access-key=$NEFIT_ACCESS_KEY"
DAEMON_ARGS="$DAEMON_ARGS --password=$NEFIT_PASSWORD"
DAEMON_ARGS="$DAEMON_ARGS --host=$NEFIT_HOST"
DAEMON_ARGS="$DAEMON_ARGS --port=$NEFIT_PORT"
 
 
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
 
#
# Function that starts the daemon/service
#
do_start()
{
    nohup $DAEMON $DAEMON_ARGS &
  echo `ps w | grep ${DAEMON} | grep -v -E 'grep' | awk '{print $1}' > $PIDFILE`

}

wait_for_status ()
{
    counter=$2
    while [ ${counter} -gt 0 ]; do
        do_status
        [ $? -eq $1 ] && return
        let counter=counter-1
        sleep 1
    done
    return 1
}

#
# Function that stops the daemon/service
#

do_stop()

{
    # Kill the application
    kill `cat ${PIDFILE}`
    wait_for_status 1 20 || kill -9 `cat ${PIDFILE}`
    rm -f ${PIDFILE}
}


do_status ()
{
    if [ -f ${PIDFILE} ] && kill -0 `cat ${PIDFILE}` > /dev/null 2>&1; then
        return
    fi
    rm -f ${PIDFILE}
    return 1
}


case "$1" in
  start)
        do_start
        ;;
  stop)
        do_stop
        ;;
  restart)
        do_stop
        do_start
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
        exit 3
        ;;
esac
 
:
Good luck!
johanv
Posts: 7
Joined: Sunday 05 March 2017 14:24
Target OS: Linux
Domoticz version: 2020.2
Contact:

Re: Nefit Easy™

Post by johanv »

I'm trying for month's to connect to my Nefit easy from pi pi3 .
I removed all soft ware and reinstalled the client.
But the only thing i get is: [Error: MAX_RETRIES_REACHED]
I'm completeley lost. i checked the serialnumber, accesskey and password several times.
Is there a debug or trace mode so i can check what is going wrong?
hremijn
Posts: 2
Joined: Monday 16 May 2016 18:04
Target OS: Linux
Domoticz version: 3.5146
Location: Netherlands
Contact:

Re: Nefit Easy™

Post by hremijn »

@johanv, check wiki (https://www.domoticz.com/wiki/NefitEasy).
Start easy-server with using --host=127.0.0.1.
No need to specify the port number if you use 3000.
Make sure the PI can access the internet.
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Nefit Easy™

Post by mvveelen »

I have the easy-server running for a very long time now on my Synology, but once in a while (every few days) the connection is lost with the Bosch backend. At least, that is what I think happens.

When I detach the Nefit Easy from the wall and connect it again, everything is initialised and working again.

2 questions:

1. do others have the same issue?
2. how can I automate this detaching: I want the 2-wires that run to the Nefit to be disconnected for a few seconds and reconnect again using a Wemos D1 Mini or something like that: someone who can give me a hint on how I can do that?

Or is there another solution to force the connection to be restored (I prefer a software solution of course) ?
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests