robertklep / nefit-easy-http-server

HTTP server to access Nefit/Bosch XMPP backend over HTTP
MIT License
38 stars 15 forks source link

Invalid Response error when sending warm water on or off. #11

Closed ggamehdtv closed 6 years ago

ggamehdtv commented 6 years ago

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

robertklep commented 6 years ago

Which endpoint are you using?

ggamehdtv commented 6 years ago

The bridge endpoint

robertklep commented 6 years ago

What's the full URL that you are trying to retrieve? :)

ggamehdtv commented 6 years ago

Curl -XPOST http://127.0.0.1:3001/bridge/dhwCircuits/dhwA/hotWaterSystem -d ‘{“value”:”on”}’

robertklep commented 6 years ago

When I perform a GET (to retrieve the current value), I get this for my Nefit:

$ curl http://127.0.0.1:3000/bridge/dhwCircuits/dhwA/hotWaterSystem
{
  "id":"/dhwCircuits/dhwA/hotWaterSystem",
  "type":"floatValue",
  "recordable":0,
  "writeable":0,
  "value":1,
  "unitOfMeasure":"",
  "minValue":0,
  "maxValue":4
}

Which suggests that you can't write a new value to it (because writable is 0).

Even if it were writable, it expects a numerical value, so the request would have to be something like this:

curl -XPOST http://127.0.0.1:3001/bridge/dhwCircuits/dhwA/hotWaterSystem -d '{"value":3}'

(I have no idea what those values mean)

EDIT

I just realized that the easy command line tool has an option to switch on/off the hot water supply by writing {"value":"on"} (or off) to these endpoints:

/dhwCircuits/dhwA/dhwOperationClockMode
/dhwCircuits/dhwA/dhwOperationManualMode

Try those.