Giter Site home page Giter Site logo

nefit-easy-http-server's Introduction

Nefit Easy™ HTTP server

HTTP server to access Nefit/Bosch XMPP backend over HTTP.

Installation

This library requires Node.js 6.0.0 or later!

$ npm i nefit-easy-http-server -g

This will install the easy-server CLI tool in a well-known "bin/" directory (npm config get prefix will show you where).

Docker

@balk77 has created a Docker image to easily install and run the HTTP server. More information here.

If you want to build your own Docker image, there's a Dockerfile included in this repository.

Problems on recent Linux distributions

If you're having problems getting any data from the HTTP server, and you're using a recent Linux distribution (for instance, Raspbian Buster), take a look at this comment.

In short: OpenSSL defaults have changed to require a minimum TLS version and cipher implementation. These defaults cause the Nefit client code to not be able to connect to the Nefit/Bosch backend.

The solution is mentioned here: edit the file /etc/ssl/openssl.cnf and change the following keys to these values:

MinProtocol = None
CipherString = DEFAULT

Usage

Starting

$ easy-server

By default, the server will be accessible through http://127.0.0.1:3000/

Configuration

Configuration is done through command line options. See Options below.

Endpoints

The server exposes two endpoint prefixes:

  • /bridge/, which serves as a raw HTTP-to-XMPP bridge (see "Examples");
  • /api/, which implements higher-level commands (provided by nefit-easy-commands);

Examples

The server isn't meant to be opened in a browser. Its intended use is to be called using tools like curl or httpie, or from other programs/scripts, through HTTP calls. The following examples will use curl.

HTTP-to-XMPP bridge

The HTTP-to-XMPP bridge provides two actions:

  • retrieving an endpoint;
  • writing data to an endpoint;

To retrieve an endpoint (for example, /ecus/rrc/uiStatus):

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

To write data to an endpoint:

$ curl -XPOST http://127.0.0.1:3000/bridge/heatingCircuits/hc1/temperatureRoomManual -d '{"value":20}' -H 'Content-Type: application/json'

For POST requests, the data should be a valid JSON string. There is no input validation.

Commands API

For now, the commands API only supports "get" commands:

$ curl http://127.0.0.1:3000/api/status
$ curl http://127.0.0.1:3000/api/pressure
$ curl http://127.0.0.1:3000/api/hotWaterSupply
$ curl http://127.0.0.1:3000/api/location
$ curl http://127.0.0.1:3000/api/program
$ curl http://127.0.0.1:3000/api/userMode

Options

$ easy-server -h

easy-server – Nefit Easy™ HTTP-server

Usage:
  easy-server [options]

Options:
  -h --help                Show this screen
  -v --version             Show version
  -V --verbose             Be more verbose
  --serial=SERIAL          Nefit Easy™ serial number (without whitespace or hyphens)
  --access-key=ACCESS_KEY  Nefit Easy™ access key (without whitespace or hyphens)
  --password=PASSWORD      Nefit Easy™ password
  --port=PORT              Port to listen on [default: 3000]
  --host=HOST              Host to bind to [default: 127.0.0.1]
  --timeout=TIMEOUT        Request timeout in seconds [default: 30]

Instead of specifying serial number, access key or password through
options, you can also define them through environment variables:

  NEFIT_SERIAL_NUMBER
  NEFIT_ACCESS_KEY
  NEFIT_PASSWORD

nefit-easy-http-server's People

Contributors

robertklep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nefit-easy-http-server's Issues

On installing in raspbian and debian: this package is deprecated

Hi Robert,

Do you know what the issue might be?

pi@raspberrypi:~ $ sudo npm i nefit-easy-http-server -g
npm WARN deprecated [email protected]: this package is deprecated please use https://www.npmjs.com/package/@xmpp/client
npm WARN deprecated [email protected]: this package is deprecated please use https://github.com/xmppjs/xmpp.js
npm WARN deprecated [email protected]: this package is deprecated please use https://github.com/xmppjs/xmpp.js
/usr/bin/easy-server -> /usr/lib/node_modules/nefit-easy-http-server/bin/easy-server

MAX_RETRIES_REACHED

Hi, after upgrading to the latest versions of nefit-easy-http-server and nefit-easy-core I often get the following mesages:

Error: MAX_RETRIES_REACHED at queueMessage.catch.e (/home/sander/.npm-global/lib/node_modules/nefit-easy-http-server/node_modules/nefit-easy-core/lib/index.js:199:51) at <anonymous>

I have increased maxRetries to 100 but that does not help. What is the shortest interval the Bosch backend accepts when polling? By the way, it does not matter if I use --verbose or not, output is the same.

I have just disabled ipv6 on my Ubuntu 16.04 box. Maybe at has to do with network issues. The box is wired by the way.

Receive xmpp messages from backend

When i change anything on my nefit easy iOS app it instantly changes on my wall thermostat and vice versa. I assumed an xmpp message is sent to the thermostat/iOS device to inform about the change.

  • Is my assumption correct?
  • Are these messages also sent to the nefit-easy-core client?
  • With debug=* I didn't see anything. Is there a way for the nefit-easy-core to sync a change other than to poll every x seconds?

again ... NefitEasy: Error getting http data! (are the servers really that unresponsive ?)

Hi,
I see a lot of
2019-08-14 08:57:35.560 Error: NefitEasy: Error getting http data!
2019-08-14 08:58:59.636 Error: NefitEasy: Error getting http data!
in my domoticz logging,
sometimes they disappear after a couple of hours, sometimes they disappear after I restart the RPI.
This happens a couple of times each week …
Is there any way to debug this to see what is going on ?
It would be nice to fix this

Eddie

easy-server Unhandled promise rejection

Since a few weeks I get the error like below. I need to restart the easy-server to solve this issue. Unfortunately I cannot find a reason for this.
I run it on Windows Server 2016

(node:8892) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5583): TypeError: Cannot read property 'write' of null
Error: MAX_RETRIES_REACHED
    at Error (native)
    at queueMessage.catch.e (C:\Users\Administrator\AppData\Roaming\npm\node_modules\nefit-easy-http-server\node_modules\nefit-easy-core\lib\index.js:199:51)
127.0.0.1 - - [18/Oct/2018:19:04:03 +0000] "GET /bridge/ecus/rrc/uiStatus HTTP/1.1" 500 206 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/601.37 (KHTML, like Gecko) Chrome/54.0.32418.0 Safari/601.36"

node-xmpp-core error module.js:540

I've installed easy-server, but something keeps preventing it from running. I use a synology nas. Here are the outputs I get:
`
root@NASDS216:/# node -v
v8.9.4
root@NASDS216:/# npm -v
5.6.0
root@NASDS216:/# easy-server
module.js:540
throw err;
^

Error: Cannot find module 'node-xmpp-core'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/lib/scram-auth-mechanism.js:4:19)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/lib/index.js:10:20)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
`
Consequently, Domoticz keeps reporting it cannot get any data. Well, that's unfortunate, but first I need to get easy-server running. Any ideas? I'm a huge noob, so if you can provide me with the specific codes I need to insert into putty, than that would be super helpfull.

CPU usage is getting higher an higher

Hi I have the following problem I use a Raspberry B with msata disk running Domoticz so far no problem. But when I install Nefit Easy(it works great, all 10 sensors) the processor activity is higher and higher beginning with 1.5 % and every day 1 % higher. I have looked to the tasks and the Node task is making the high activity. I am not a Unix expert, and 69 years old, never to old to learn something. But I would ask, have you an idea? I use node -v (versie 10.4.1)
npm -v (6.1.0) easy-server -v (4.0.1) pm2 -v=2.10.4 and Raspbian stretch kernel 4.14
Thanks for the work already done on this project.
Regards, Rien.

Connection refused

Hi,

After using the easy server on a RPI3 for a while it broke down half a year ago. With winter coming, I'm now trying to set it up again. So I tried to do a clean install using the instructions provided.
Every seems to be fine, the RPI says HTTP server listening on http://127.0.0.1:3000
But I can't get a connection using
curl http://127.0.0.1:3000/bridge/ecus/rrc/uiStatus.
The return is: Failed to connect to 127.0.0.1 port 3000: Connection refused
When I use the actual IP address of the RPI the result is the same.

NPM version is 6.4.1
Node version is 8.12.0
raspbian:2018-06-27-raspbian-stretch

I made sure no other stuff was installed which could mess things up. I only did a clean install of raspian and then installed Node and NPM.

Do you have any thoughts on how to get this running?

Regards,

Erik

Bosch Easycontrol CT100 -> CT200 - connection error XMPP authentication failure

I just switched the controller model from CT100 to CT200, entered the new serial, access code and my new password as before but now I get always a connection error XMPP authentication failure.

I double checked all credentials, the iOS app Bosch EasyControl works fine. Are there any recently known changes in the API / XMPP process for authentication?

Starting the current easy-server 5.0.2 with DEBUG=* results in showing 'not-authorized' too.

50.000 queries to wa2-mz36-qrmzh6.bosch.de

Dear Robert,
Last weekend I've updated my Domoticz to the latest version on a Raspberry Pi.
The same I did for the "nefit-easy-http-server" and all is working fine.
Today I saw on my pi-hole extremely many requests to the domain wa2-mz36-qrmzh6.bosch.de. These requests are stopping immediately as soon I stop the "nefit-easy-http-server"
Is there something that I can do to decrease the amount of queries to bosch.de?

Many thanks in advance.

Kind regards

B.S.

Timeout, no reconnect?

Small issue found....

When starting the server, and doing a request, works
waiting some minutes, and doing a request results in a timeout
but it seems the connection is never rebuild, from this moment there is always a timeout

Is it possible to send a ping to the server every xx seconds when connected, or request some state
and/or if there is really a timeout, that the connection is rebuild ?

Error: REQUEST_TIMEOUT at null. (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/nefit-easy-core/lib/index.js:109:23) at Timer.listOnTimeout (timers.js:92:15)

Set showertimer through http server

I'm using the Nefit-easy-http-server in domoticz and i'm searching for a way to set the showertimer, in the app it's possible to set this for X minutes but it resets itself after use of hot water. I asked Nefit about this and they said it was by design.

If I can set this option through the Nefit-easy-http-server then I can possibly script in dzvents that it enables again after use of hot water.

So my question is if i can set the showertimer through the http server? I can't find anything on it in the docu.

easy-server and easy command 'hangs'

Since a few weeks, both easy-server -V and easy -V just hangs (with or without the verbose option) and doesn't give valid output or response. Stopping/starting makes no difference, neither does reboot.

Versions:
node -v: v10.15.2
npm -v: 5.8.0
easy-server: 5.0.2

Where can I find a log file (nothing in daemon.log or syslog)?

Domoticz reports: NefitEasy Error getting http data

Hi !

Recently I have been getting the error from Domoticz that it cant get any http data. I've found your readme stating the issue around the default SSL protocol, and tried to update the parameters in the /etc/ssl/openssl.cnf file, however these parameters are not at all avaialble in the file:

    MinProtocol = None
    CipherString = DEFAULT

Not with these values, not with any values. I tried adding them, which didnt work, so now I'm back to finding the issue. I do have a recent installation of raspbian on a Pi 3b+.

I did ran: curl http://127.0.0.1:3000/bridge/ecus/rrc/uiStatus
which resulted in:

Error: MAX_RETRIES_REACHED
at queueMessage.catch.e (/usr/lib/node_modules/nefit-easy-http-server/node_modules/nefit-easy-core/lib/index.js:179:51)
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:517:31)
at Promise._settlePromise (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:574:18)
at Promise._settlePromise0 (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:619:10)
at Promise._settlePromises (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:695:18)
at _drainQueueStep (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)

Get status of the proximity sensor

Hi, I was wondering if it is possible to retrieve the status of the proximity sensor of the Nefit Easy. In other words, to see if someone is standing in front of the panel? Alternatively, to see whether the display lights up.
Thanx for considering!
/Wol

Nothing happening

I installed the software on Ubuntu 14.04 with the following command:
npm -i nefit-easy-http-server -g

The installation works well, no errors.

When I try to start the application easy-server, nothing happens.
Also trying easy-server -h does nothing.

Any ideas what could be wrong?

SyntaxError calling http://127.0.0.1:3000/api/pressure

Installed using npm command and after starting server a SyntaxError is reporterd

SyntaxError: Unexpected token c in JSON at position 0 at JSON.parse () at pending.(anonymous function).send.then.response (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/nefit-easy-core/lib/index.js:216:30) 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 runCallback (timers.js:696:18) at tryOnImmediate (timers.js:667:5) at processImmediate (timers.js:649:5)

Easy-server now needs Node.js 6.0.0 of later?

As of this morning the http server did not function properly and gave a steady XMPP authentication error. I have found that updating Node.js from 4.9.1 to version 10.2.1 ( latest stable version ) did resolve this issue.

I think the readme has yet to be updated? Could you please verify?

Thanks

Frank

XMPP authentication failure

Hello,

I'm using the Buderus (Belgium) branded version but I'm unable to login:

$ node -v
v6.2.0
$ npm -v
3.8.9
$ easy-server -v
2.1.0
$ easy-server --serial=123456789 --access-key=XXXXXXXX --password=xxxxxx
XMPP authentication failure

When using strace I can see it connecting to a bosch.com ip address.

INVALID RESPONSE when setting temperature

Hi, I am trying to override the temperature setpoint of the running program (while remaining in clock mode). I have the server running on port 8124 (curl http://127.0.0.1:8124/api/status gives proper output)

curl http://127.0.0.1:8124/bridge/heatingCircuits/hc1/manualTemperatureOverride/temperature -d '{"value":20}' -H 'Content-Type: application/json'
gives an error (see below). Can you please help me?

Error: INVALID_RESPONSE at send.then (/usr/lib/node_modules/nefit-easy-http-server/node_modules/nefit-easy-core/lib/index.js:253:19) 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:512:31) at Promise._settlePromise (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromise0 (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/usr/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:693: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:789:20) at tryOnImmediate (timers.js:751:5) at processImmediate [as _immediateCallback] (timers.js:722:5)

API request interval

Are there any limits on the number of requests to the API (or: how is trothling at Nefit/Bosch side handled, if any)?
E.g. can I call the API /status endpoint every minute or every 5 minutes?

keeps trying to setup connection / loop

Hi / Hoi,

I've installed the easy-server, using all kind of different guides and ways. All without any success at the moment.
When i start the server with:
env DEBUG=* easy-server --serial= --access-key=<myAccessKey --password= --host=localhost --port=3001

it will keep rotating throught the following:
easy

How can i solve this?

EADDRINUSE error

I'm using Domoticz on a Pi 3B. Easy-server was working but lately, after updating node-js, I get the following error:
{ Error: listen EADDRINUSE 127.0.0.1:3000
at Server.setupListenHandle [as _listen2] (net.js:1327:14)
at listenInCluster (net.js:1375:12)
at doListen (net.js:1501:7)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'EADDRINUSE',
code: 'EADDRINUSE',
syscall: 'listen',
address: '127.0.0.1',
port: 3000 }

I use node 10.4.1, npm 6.1.0, easy-server 4.0.1 and pm2 2.10.3.
I'm not really familiar with Linux.
My question: what could be wrong?

Many thanks for your work on this project.

Regards,
Guus.

Hot Water log

Hello,

I was wondering if there is any way to log when and how long the hot water is running?

Or just simply query if hot water is currently being used.
I know the boiler status shows hot water and off. But with domoticz sometimes the central heating starts before the off signal for the hot water is received. So then the off signal is for the central heating.

Any help would be appreciated.
Reactie in het Nederlands mag ook :)

Greetings,
Jos

Error: NefitEasy: Error getting http data!

Sorry in advance for dumb questions caused by my noobness.

I'm trying to install the Nefit Easy server for use in Domoticz with the following install guide:
https://www.domoticz.com/wiki/NefitEasy
The Easy Server starts but in the Domoticz log I keep seeing:

Error: NefitEasy: Error getting http data!

The Nefit Easy server is running, but when I test it using:

curl http://127.0.0.1:3000/bridge/ecus/rrc/uiStatus
I get a can't connect error.

My Android Nefit Easy app works, so serial, access-key and password are OK. I also double-checked for typo's.

There were some install errors with the "sudo npm i nefit-easy-http-server -g" command saying that some XMPP packages were deprecated? Maybe something went wrong during install.
I tried reinstalling node version 12.x, but that did not work. Uninstalled node and reinstalled node version 10.x but that also did not work. I'm afraid I messed up dependencies with several rounds of installing and de-installing and I have no idea how to get back to clean slate before re-installing from scratch again. I also read on the Domoticz forum that PM2 is not necessary? But then how to start the nefit-easy-http-server?

Any help is greatly appreciated!

Password field does not support #

Recently I made quite a few changes to my setup including changes to my password. I used a # in it. The app on the phome supports that, but it broke the nefit-easy-http-server: It could no longer parse the json.
A minor problem once you realise what happened, but I originally suspected my nodejs setup...

New NAS DS220Plus : XMPP authentication failure

Hi, i installed Easy-server on a new nas DS220Plus (before it was working on a DS216J), but now i got XMPP authentication failure when starting the easy-server. what am I doing wrong?

xx@DS220Plus:/usr/local/bin$

npm -v
5.6.0
node -v
8.9.4
easy-server -v
5.0.3

sudo easy-server --serial=xx --access-key=xx --password=xx
Password: XX
XMPP authentication failure

XMPP authentication failure

Hi,

Since today I get XMPP authentication failures when starting the easy-server (3.1.2). I hav already upgraded node.js (v6.14.2) and npm (3.10.10), but keep getting these when staring the easy-server. The android app is just working fine and I have check the credentials and they look ok (never changed them)

What can I do to investigate this?

Regards, Harry

XMPP authentication failure - Bosch

Please advise, can I use this with Bosch EasyControl. I’ve installed befit-easy-http-server, but I see an error in the log:

XMPP authentication failure

Pressure value rounded to whole number

The pressure value is rounded to a whole number, e.g.:

{"pressure":1,"unit":"bar"}

while the actual pressure (seen with the Android App) is 1.4 in my current situation.
I had a peek at the source and noticed it uses 'UnitOfMeasurement':

module.exports = function pressure() {
  return this.get('/system/appliance/systemPressure').then((r) => {
    var minValue = r.minValue || 0;
    var maxValue = r.maxValue || 25;
    var pressure = r.value;

    // Invalid pressure?
    if (r.value < minValue || r.value > maxValue) {
      pressure = null;
    }

    return { pressure : r.value, unit : r.unitOfMeasure };
  });
};

I am not familiar with unitOfMeasure classes, so not sure how to 'fix'.

UPDATE: Just checked at the XMPP endpoint with:

$ curl http://127.0.0.1:4000/bridge/system/appliance/systemPressure
{"id":"/system/appliance/systemPressure","type":"floatValue","recordable":0,"writeable":0,"value":1,"unitOfMeasure":"bar","minValue":0,"maxValue":25}

It is giving a whole number at this interface as well (assuming this is the same parameter).

Error starting server

I get the following error when starting:

/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)

SyntaxError: Unexpected token h in JSON at position 0

Hi, I just installed the nefit-easy-server but getting error when trying to get status:

curl http://127.0.0.1:3000/api/status

SyntaxError: Unexpected token h in JSON at position 0
at Object.parse (native)
at pending.(anonymous function).send.then.e (/volume1/@appstore/Node.js_v6/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/nefit-easy-core/lib/index.js:236:30)
at process._tickCallback (internal/process/next_tick.js:109:7)

Any idea what I'm doing wrong?

The /bridge/ endpoints work but the /api/ ones do not

Just installed this package through a docker image. The package works well as long as I use the /bridge/ endpoints. However when I try the /api/ endpoints I get the following result on every call, whatever endpoint I choose:

curl http://myserver:3000/api/status
Cannot GET /api/status

The resulting HTTP status code appears to be a 404 if I'm correct. I set the environment variable DEBUG to nefit-easy-core but that doesn't appear to give me more information. Any idea what's going wrong or how I can further test it?

Invalid Response error when sending warm water on or off.

Hello,

I am having an issue with nefit easy http server. When I try to enable or disable warm water it won't change in the nefit easy app. Instead of changing it gives an error in the console of the raspberry:

Error: INVALID_RESPONSE
    at send.then (/home/pi/nefit-easy-http-server/node_modules/nefit-easy-core/lib/index.js:253:19)
    at tryCatcher (/home/pi/nefit-easy-http-server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/pi/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/home/pi/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/home/pi/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/home/pi/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:691:18)
    at Async._drainQueue (/home/pi/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:138:16)
    at Async._drainQueues (/home/pi/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:148:10)
    at Immediate.Async.drainQueues (/home/pi/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:785:20)
    at tryOnImmediate (timers.js:747:5)
    at processImmediate [as _immediateCallback] (timers.js:718:5)

Hope someone know a fix to solve this because warm water on using http server is someting i'd like to use.

Best regards Justinn

Command not found

Hi,

Ik gebruik een Raspberry Pi 3 met Homebridge om hier de gefit-easy-http-server op te laten draaien. Maar bij het laatste command dat de gegevens zoals serienummer, access-key en password door moet geven krijg ik telkens de fout van not found. Zie screenshot. Enig idee hoe ik dit kan oplossen?

Schermafbeelding 2019-05-27 om 19 09 49

Alvast bedankt!!

Kevin

Easy server blijft herstarten: missing password

Hi,

Ik heb een "verse" easy server installatie (laatste versie pm2, npm, node.js 10) op een Raspberry PI3 met Stretch. Ik maak gebruik van PM2. Ik lees de easy server uit met Domoticz (op een andere PI).

De easy server werkt prima en ik kan alle thermostaat waardes uitlezen ook met de easy server cli etc.

Edoch echter: de easy server wordt door PM2 continu herstart omdat (blijkbaar) de server ermee stopt. De easy server error.log zegt dan ook: "missing password". Wachtwoord is echter correct aanwezig en Domoticz krijgt ook de juiste data door van Easy Server. Overige easy server logs zijn leeg (0 bytes).

Wat gaat er mis?

Michel.

SSL fix now different?

For what it is worth:
I have followed the wiki page for domoticz to install the nefithttpserver on my pi.
I have updated all and everything and followed you tip rearding lowering the openssl setting to none and default.
But all my pm2 logs showed me that I had the authentiction error.
PM2 log: App [nefiteasyhttpserver:0] exited with code [1] via signal [SIGINT] , folled by a restart and again a exit
Getting tired of this I replaced the settings of the etc/ssl/openssl.cnf to
MinProtocol = TLSv1.2 CipherString = DEFAULT@SECLEVEL=2

And presto, after having PM2 do a restart of nefiteasyhttpserver, Easyserver is now running!
PM2 logs gives this:
PM2 | 2020-12-29T00:27:04: PM2 log: App [nefiteasyhttpserver:0] online PM2 | 2020-12-29T00:27:07: PM2 log: App [nefiteasyhttpserver:0] exited with code [1] via signal [SIGINT] PM2 | 2020-12-29T00:27:07: PM2 log: App [nefiteasyhttpserver:0] starting in -fork mode- PM2 | 2020-12-29T00:27:07: PM2 log: App [nefiteasyhttpserver:0] online PM2 | 2020-12-29T00:28:01: PM2 log: Stopping app:nefiteasyhttpserver id:0 PM2 | 2020-12-29T00:28:01: PM2 log: App [nefiteasyhttpserver:0] exited with code [0] via signal [SIGINT] PM2 | 2020-12-29T00:28:01: PM2 log: pid=4828 msg=process killed PM2 | 2020-12-29T00:28:01: PM2 log: App [nefiteasyhttpserver:0] starting in -fork mode- PM2 | 2020-12-29T00:28:01: PM2 log: App [nefiteasyhttpserver:0] online
BUT:
in domoticz the Netfit http plugin still shows in the logging:
2020-12-29 00:54:06.388 Error: NefitEasy: Error getting http data!
ERGO:
only half of my problem is fixed, Now I still need a solution for the domoticz part for the Nefit plugin.
Can you help?

Originally posted by @TheFons-01 in #35 (comment)

Installation nefit-easy-client -g and mp2 gives erros about node and npm version

If i try to install i get version errors that i to low versions, for example.:
pi@raspberrypi:~ $ sudo npm install robertklep/nefit-easy-client -g npm WARN deprecated [email protected]: this package is deprecated please use https://www.npmjs.com/package/@xmpp/client npm WARN deprecated [email protected]: this package is deprecated please use https://github.com/xmppjs/xmpp.js npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN engine [email protected]: wanted: {"node":">= 6"} (current: {"node":"4.4.5","npm":"2.15.5"}) npm WARN deprecated [email protected]: this package is deprecated please use https://github.com/xmppjs/xmpp.js npm WARN engine [email protected]: wanted: {"node":">=6"} (current: {"node":"4.4.5","npm":"2.15.5"}) npm WARN engine [email protected]: wanted: {"node":">=6"} (current: {"node":"4.4.5","npm":"2.15.5"}) npm WARN engine [email protected]: wanted: {"node":">=6"} (current: {"node":"4.4.5","npm":"2.15.5"})

But if i check both.:
pi@raspberrypi:~/nefit-easy-http-server $ node -v v13.9.0 pi@raspberrypi:~/nefit-easy-http-server $ ^C pi@raspberrypi:~/nefit-easy-http-server $ npm -v 6.13.7

Any help would be helpfully.

Nefit Enviline heatpump

Did anyone have any luck with connecting to a Nefit Enviline heatpump? It looks as if the procedure is very much the same like connecting to the Nefit Easy but I am stuck at XMPP aythentication failure. Have tried every single combination of keys (from the label), prefixes etc etc.

Error: Nefit Easy: Error getting http data!

Beste Robertklep,
Ik gebruik al een aantal jaren jou script om de Nefit via domoticz te bedienen. Dat werkte super, alleen heb ik mijn node.js een update gegeven omdat ik anders een aantal andere apps niet meer kon bedienen.. Alleen nu gooit die Nefit easy na een aantal uur er uit en werkt het niet meer. Het werkt pas weer wanneer ik pm2 start uitvoer.

Zou u met me mee kunnen denken.

Alvast super bedankt

Test on Node v6

#4 seems to suggest that Node v6 may have broken things regarding encryption.

Endpoint to set temperature?

Hi, I would like to set the temperature via the http server, similar to ’easy set temperature "20"' via the cli. Is that possible? I could not find an endpoint in the list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.