Re: Nefit Easy™
Posted: Sunday 05 June 2016 9:50
Exactly, that is exactly what is stated in the conditions of Bosch. (As that it is forbidden to reverse engineer [WINKING FACE])
I second this. As a relative newbie regarding linux I would very much like to see a comprehensive guide to make the Easy visible in domoticz. Can anyone guide us through? (I don't want to mess up my domoticz setup with wrong commandsDutchsea wrote:Hi, I really appreciatean updated post on how to install the Nefit Easy for Domoticz. The info is now so fragmenten and often outdated that its hard for novice user to make a start. Especially as the instruction in the initial post is not working anymore.
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
:
Great work on documenting it for DSM6 on the Synology. I'm still running DSM5, but maybe....someday,...jurgen wrote:Dear all,
Today I have installed domoticz with easy-http server on my synology. I could not find a complete tutorial so i decided to document and share the steps that I did to get this working. I hope that you can use it.
Tutorial
Nefit easy on synology with DSM 6.0.2
Install node.js v4.2.6-0158 using package center from publisher Synology.inc
Install nefit easy http server on synology nas using ssh
npm i nefit-easy-http-server -g
Run the nefit easy http server as test
easy-server --serial=serialnumber --access-key=enteryourkey --password=enteryourpassword
Check if you can reach the http server using the following command:
curl http://127.0.0.1:3000/bridge/ecus/rrc/uiStatus
Go to domoticz which is running on my synology server
Add new hardware
Nefit easy http server over lan interface
name: nefit-easy
Remote address: 127.0.0.1
poort: 3000
Go to Devices and check if there are nefit devices available and add the devices to the dashboard!![]()
if there are no devices available check the logging in domoticz and verify with curl if the easy http server is running.
Create Startup script called easy-server.sh and place it in the directory /usr/local/etc/rc.d/
Reboot the nas and check that the process is running.
ps -aux | grep easy-http
@thanks to mvveelen
I edit the scriptname directory because of the change in DSM 6.0.2Code: 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 :
jurgen wrote:Dear all,
Today I have installed domoticz with easy-http server on my synology. I could not find a complete tutorial so i decided to document and share the steps that I did to get this working. I hope that you can use it.
Tutorial
Nefit easy on synology with DSM 6.0.2
Install node.js v4.2.6-0158 using package center from publisher Synology.inc
Install nefit easy http server on synology nas using ssh
npm i nefit-easy-http-server -g
Run the nefit easy http server as test
easy-server --serial=serialnumber --access-key=enteryourkey --password=enteryourpassword
Check if you can reach the http server using the following command:
curl http://127.0.0.1:3000/bridge/ecus/rrc/uiStatus
Go to domoticz which is running on my synology server
Add new hardware
Nefit easy http server over lan interface
name: nefit-easy
Remote address: 127.0.0.1
poort: 3000
Go to Devices and check if there are nefit devices available and add the devices to the dashboard!![]()
if there are no devices available check the logging in domoticz and verify with curl if the easy http server is running.
Create Startup script called easy-server.sh and place it in the directory /usr/local/etc/rc.d/
Reboot the nas and check that the process is running.
ps -aux | grep easy-http
@thanks to mvveelen
I edit the scriptname directory because of the change in DSM 6.0.2Code: 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 :
Code: Select all
admin@DiskStation:~$ npm i nefit-easy-http-server -g
/var/services/homes/admin/.npm-global/bin/easy-server -> /var/services/homes/admin/.npm-global/lib/node_modules/nefit-easy-http-server/bin/easy-server
[email protected] /var/services/homes/admin/.npm-global/lib/node_modules/nefit-easy-http-server
+-- [email protected]
+-- [email protected] ([email protected])
+-- [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
+-- [email protected]
+-- [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
+-- [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
+-- [email protected] ([email protected], [email protected])
Code: Select all
admin@DiskStation:~$ easy-server
-sh: easy-server: command not found
admin@DiskStation:~$
admin@DiskStation:~$ curl http://127.0.0.1:3000/bridge/ecus/rrc/uiStatus
curl: (7) Failed to connect to 127.0.0.1 port 3000: Connection refused
admin@DiskStation:~$
cvdb wrote:jurgen wrote:Dear all,
Today I have installed domoticz with easy-http server on my synology. I could not find a complete tutorial so i decided to document and share the steps that I did to get this working. I hope that you can use it.
Tutorial
Nefit easy on synology with DSM 6.0.2
Install node.js v4.2.6-0158 using package center from publisher Synology.inc
Install nefit easy http server on synology nas using ssh
npm i nefit-easy-http-server -g
Run the nefit easy http server as test
easy-server --serial=serialnumber --access-key=enteryourkey --password=enteryourpassword
Check if you can reach the http server using the following command:
curl http://127.0.0.1:3000/bridge/ecus/rrc/uiStatus
Go to domoticz which is running on my synology server
Add new hardware
Nefit easy http server over lan interface
name: nefit-easy
Remote address: 127.0.0.1
poort: 3000
Go to Devices and check if there are nefit devices available and add the devices to the dashboard!![]()
if there are no devices available check the logging in domoticz and verify with curl if the easy http server is running.
Create Startup script called easy-server.sh and place it in the directory /usr/local/etc/rc.d/
Reboot the nas and check that the process is running.
ps -aux | grep easy-http
@thanks to mvveelen
I edit the scriptname directory because of the change in DSM 6.0.2Code: 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 :
Hello all,
Just installed Domoticz on my Synology, and got it working with some switches
Now i really would like to connect to my Nefit easy as well, but after a few evenings trying, its not that easy for me... because i am not so familiar with this code.
i am glad some people are, and thanks for puting it on this forum, and i hope they can help me in the right direction.
my configuration:
Synology DS412+ DSM 6.0.2-8451
installed node.js v4.2.6-0158
I am trying to follow the steps from the tutoral, but got lost..
I am connecting to Synology with PuTTY SSH
I changed the npm install directory to ~/.npm-global ( because it generated some errors on permissions.. )
https://docs.npmjs.com/getting-started/ ... ermissions
and when i do:
Code: Select all
admin@DiskStation:~$ npm i nefit-easy-http-server -g /var/services/homes/admin/.npm-global/bin/easy-server -> /var/services/homes/admin/.npm-global/lib/node_modules/nefit-easy-http-server/bin/easy-server [email protected] /var/services/homes/admin/.npm-global/lib/node_modules/nefit-easy-http-server +-- [email protected] +-- [email protected] ([email protected]) +-- [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) +-- [email protected] +-- [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) +-- [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) +-- [email protected] ([email protected], [email protected])
Its not starting the easy server...Code: Select all
admin@DiskStation:~$ easy-server -sh: easy-server: command not found admin@DiskStation:~$ admin@DiskStation:~$ curl http://127.0.0.1:3000/bridge/ecus/rrc/uiStatus curl: (7) Failed to connect to 127.0.0.1 port 3000: Connection refused admin@DiskStation:~$
So please help me with where i go wrong
I placed an easy-server.sh file (with my serial #, access key and passwd) in the /usr/local/etc/rc.d directory, and rebooted the nas, but the process is not running.. any idea ?Create Startup script called easy-server.sh and place it in the directory /usr/local/etc/rc.d/
Reboot the nas and check that the process is running.
ps -aux | grep easy-http