robertklep / bosch-xmpp

Protocol implementation for Bosch XMPP protocols
MIT License
47 stars 8 forks source link

Setting values for via IVT times out #31

Open axel-loewe opened 2 years ago

axel-loewe commented 2 years ago

Hi,

I manage to query information from our Bosch Compress 7400 heat pump via get requests. This list was extremely helpful.

bosch-xmpp ivt get /dhwCircuits/dhw1/operationMode --serial=xxxxxxxxx --access-key=xxxx-xxxx-xxxx-xxxx --password=xxxxxxxx             
{"id":"/dhwCircuits/dhw1/operationMode","type":"stringValue","writeable":1,"recordable":0,"value":"low","allowedValues":["Off","low","high","ownprogram","eco"]}

However, setting values via put requests does not work even if the endpoint says it's "writeable" as above. After several attempts, the request times out and returns "404" (debug log see below). Same issue with other writable endpoints. Increasing the timeout limit to 60s doesn't help.

Did anyone experience a similar issue? Am I missing something? Is setting values not supported?


env "DEBUG=*" bosch-xmpp ivt put /dhwCircuits/dhw1/operationMode '{"value":"eco"}' --serial=xxxxxxxxx --access-key=xxxx-xxxx-xxxx-xxxx --password=xxxxxxxx             
  xmpp:client:session start socket connection +0ms
  xmpp:connection setup socket +0ms
  xmpp:connection use lazy socket +0ms
  xmpp:connection setup stream +0ms
  xmpp:connection send: <stream:stream xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0" to="wa2-mz36-qrmzh6.bosch.de"> +30ms
  xmpp:connection receive: <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="wa2-mz36-qrmzh6.bosch.de" id="4xzxpn8f5" xml:lang="en" version="1.0"> +27ms
  xmpp:connection receive: <stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"></starttls><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><ver xmlns="urn:xmpp:features:rosterver"/></stream:features> +24ms
  xmpp:connection send: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/> +0ms
  xmpp:connection receive: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/> +25ms
  xmpp:connection use standard socket +12ms
  xmpp:connection setup stream +0ms
  xmpp:connection send: <stream:stream xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0" to="wa2-mz36-qrmzh6.bosch.de"> +89ms
  xmpp:connection receive: <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="wa2-mz36-qrmzh6.bosch.de" id="4xzxpn8f5" xml:lang="en" version="1.0"><stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><ver xmlns="urn:xmpp:features:rosterver"/></stream:features> +33ms
  xmpp:connection send: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="SCRAM-SHA-1">biwsbj1jb250YWN0XzA0MDQyMTQwOCxyPTAwYTEyMWQwMzRmYWNiNWQ2YWVmOGJiMjAwNGNjYjYw</auth> +4ms
  xmpp:connection receive: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cj0wMGExMjFkMDM0ZmFjYjVkNmFlZjhiYjIwMDRjY2I2MDM5NmUzMjgwLWFhZDktNDI2YS05NTA0LWI0OTJjZWI2MjBhZSxzPTN3OGEzdStTZER1ZVlFeHgyd0pLQzJqZE8va1U4WkZXLGk9NDA5Ng==</challenge> +51ms
  xmpp:connection send: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">Yz1iaXdzLHI9MDBhMTIxZDAzNGZhY2I1ZDZhZWY4YmIyMDA0Y2NiNjAzOTZlMzI4MC1hYWQ5LTQyNmEtOTUwNC1iNDkyY2ViNjIwYWUscD1wZEZJZEM2SGQxZE9NRGpENllaWnlsNGdubkE9</response> +95ms
  xmpp:connection receive: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dj1ETFBXdkJ0YlhSaHBKR0wxclAza3psWTBieVU9</success> +33ms
  xmpp:connection send: <stream:stream xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0" to="wa2-mz36-qrmzh6.bosch.de"> +0ms
  xmpp:connection receive: <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="wa2-mz36-qrmzh6.bosch.de" id="4xzxpn8f5" xml:lang="en" version="1.0"><stream:features><ver xmlns="urn:xmpp:features:rosterver"/><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"><optional/></session></stream:features> +26ms
  xmpp:connection send: <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/> +0ms
  xmpp:connection receive: <iq type="result" id="bind" to="wa2-mz36-qrmzh6.bosch.de/4xzxpn8f5"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>contact_040421408@wa2-mz36-qrmzh6.bosch.de/4xzxpn8f5</jid></bind></iq> +42ms
  xmpp:connection send: <session xmlns="urn:ietf:params:xml:ns:xmpp-session"/> +1ms
  xmpp:connection receive: <iq type="result" id="sess" from="wa2-mz36-qrmzh6.bosch.de" to="contact_040421408@wa2-mz36-qrmzh6.bosch.de/4xzxpn8f5"/> +29ms
  bosch-easyremote online, jid = contact_040421408@wa2-mz36-qrmzh6.bosch.de/4xzxpn8f5 +0ms
  xmpp:connection send: <presence/> +1ms
  bosch-easyremote queuing request (retries = 0) +2ms
  bosch-easyremote sending message +0ms
  bosch-easyremote:raw <message to="gateway_040421408@wa2-mz36-qrmzh6.bosch.de" type="chat"><body>PUT /dhwCircuits/dhw1/operationMode HTTP/1.1
  bosch-easyremote:raw User-Agent: TeleHeater
  bosch-easyremote:raw Content-Type: application/json
  bosch-easyremote:raw Content-Length: 24
  bosch-easyremote:raw Seq-No: 1
  bosch-easyremote:raw 
  bosch-easyremote:raw A6gSIAYm3pzuWF1XD7VB3g==</body></message> +0ms
  xmpp:connection send: <message to="gateway_040421408@wa2-mz36-qrmzh6.bosch.de" type="chat"><body>PUT /dhwCircuits/dhw1/operationMode HTTP/1.1
  xmpp:connection User-Agent: TeleHeater
  xmpp:connection Content-Type: application/json
  xmpp:connection Content-Length: 24
  xmpp:connection Seq-No: 1
  xmpp:connection 
  xmpp:connection A6gSIAYm3pzuWF1XD7VB3g==</body></message> +2ms
  bosch-easyremote message timed out, retrying... +5s
  [some more retries]
  Error: INVALID_RESPONSE
    at /opt/homebrew/lib/node_modules/bosch-xmpp/lib/base-client.js:257:23
    at tryCatcher (/opt/homebrew/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/opt/homebrew/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/opt/homebrew/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/opt/homebrew/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/opt/homebrew/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/opt/homebrew/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/opt/homebrew/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/opt/homebrew/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/opt/homebrew/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (node:internal/timers:466:21) {
  response: {
    protocolVersion: 'HTTP/1.0',
    statusCode: '404',
    statusMessage: 'Not Found',
    headers: {},
    body: ''
  }
}
robertklep commented 2 years ago

The 404 is returned by the device, so I have to assume that the operation isn't supported. Perhaps it's missing some additional parameters, but I'd have to dig deep into the official app to see how exactly it sets this value (I assume it works with that app).

per-lind commented 2 years ago

Seeing the same thing when trying to "put" to an bosch compress 7001i, works to adjust the temp from the easycontroll app but when using the CLI it returns 404.

Tried put on /heatingCircuits/hc1/manualRoomSetpoint '{"value":20.0}'/heatingCircuits/hc1/temperatureRoomSetpoint '{"value":20.0}' /heatingCircuits/hc1/temperatureLevels/comfort2 '{"value":20.0}'

all gives response: { protocolVersion: 'HTTP/1.0', statusCode: '404', statusMessage: 'Not Found', headers: {}, body: '' }

same endpoints work with get and showes up as writable. Any ideas?

brunofranco commented 1 year ago

This is also the case for Bosch Compress 3000 EW + IP module. Works fine with both EasyRemote and HomeCom Easy apps. Just to add some logs:

  xmpp:connection send: <message to="gateway_238310407@wa2-mz36-qrmzh6.bosch.de" type="chat"><body>PUT /heatingCircuits/hc1/switchPrograms/A HTTP/1.1
  xmpp:connection User-Agent: TeleHeater
  xmpp:connection Content-Type: application/json
  xmpp:connection Content-Length: 1240
  xmpp:connection Seq-No: 1
  xmpp:connection 
  xmpp:connection Zirq...tTg==</body></message> +34ms
  xmpp:connection receive: <presence from="contact_238310407@wa2-mz36-qrmzh6.bosch.de/ael8fnyl2j" to="contact_238310407@wa2-mz36-qrmzh6.bosch.de/ael8fnyl2j"/> +151ms
  bosch-easyremote received stanza of type "presence" +152ms
  bosch-easyremote:raw <presence from="contact_238310407@wa2-mz36-qrmzh6.bosch.de/ael8fnyl2j" to="contact_238310407@wa2-mz36-qrmzh6.bosch.de/ael8fnyl2j" xmlns:stream="http://etherx.jabber.org/streams"/> +152ms
  bosch-easyremote message timed out, retrying... +5s
  bosch-easyremote queuing request (retries = 13) +0ms
  bosch-easyremote sending message +0ms
  bosch-easyremote:raw <message to="gateway_238310407@wa2-mz36-qrmzh6.bosch.de" type="chat"><body>PUT /heatingCircuits/hc1/switchPrograms/A HTTP/1.1
  bosch-easyremote:raw User-Agent: TeleHeater
  bosch-easyremote:raw Content-Type: application/json
  bosch-easyremote:raw Content-Length: 1240
  bosch-easyremote:raw Seq-No: 1
  bosch-easyremote:raw 
  bosch-easyremote:raw Zirq...tTg==</body></message> +5s
  xmpp:connection send: <message to="gateway_238310407@wa2-mz36-qrmzh6.bosch.de" type="chat"><body>PUT /heatingCircuits/hc1/switchPrograms/A HTTP/1.1
  xmpp:connection User-Agent: TeleHeater
  xmpp:connection Content-Type: application/json
  xmpp:connection Content-Length: 1240
  xmpp:connection Seq-No: 1
  xmpp:connection 
  xmpp:connection Zirq...tTg==</body></message> +5s
  xmpp:connection receive: <message from="gateway_238310407@wa2-mz36-qrmzh6.bosch.de/iCom-RestApi" to="contact_238310407@wa2-mz36-qrmzh6.bosch.de/ael8fnyl2j">
  xmpp:connection <body>HTTP/1.0 404 Not Found
  xmpp:connection </body>
  xmpp:connection </message> +386ms
  bosch-easyremote received stanza of type "message" +387ms
  bosch-easyremote:raw <message from="gateway_238310407@wa2-mz36-qrmzh6.bosch.de/iCom-RestApi" to="contact_238310407@wa2-mz36-qrmzh6.bosch.de/ael8fnyl2j" xmlns:stream="http://etherx.jabber.org/streams">
  bosch-easyremote:raw <body>HTTP/1.0 404 Not Found
  bosch-easyremote:raw </body>
  bosch-easyremote:raw </message> +388ms
Error: INVALID_RESPONSE
    at /usr/local/lib/node_modules/bosch-xmpp/lib/base-client.js:257:23
    at tryCatcher (/usr/local/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/usr/local/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/usr/local/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/usr/local/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/usr/local/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/usr/local/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/usr/local/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (node:internal/timers:464:21) {
  response: {
    protocolVersion: 'HTTP/1.0',
    statusCode: '404',
    statusMessage: 'Not Found',
    headers: {},
    body: ''
  }
}