Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Really nice software ! #47

Open
MatsA opened this issue Mar 28, 2024 · 11 comments
Open

Really nice software ! #47

MatsA opened this issue Mar 28, 2024 · 11 comments

Comments

@MatsA
Copy link

MatsA commented Mar 28, 2024

Hi !

Nice application but have problem with PUT.
I'm running a Raspberry. RPi OS, with Node.js 18.

Getting problem as below.

Any ideas ?

Thanks, Mats

GET the room set point is ok

bosch-xmpp --serial=xxxxxxx --access-key=yyyyyyy --password=zzzzzz ivt get /heatingCircuits/hc1/manualRoomSetpoint
{"id":"/heatingCircuits/hc1/manualRoomSetpoint","type":"floatValue","writeable":1,"recordable":0,"value":18.5,"unitOfMeasure":"C","minValue":5,"maxValue":30,"state":[{"off":0}]}

PUT a new room set point doesn't work

bosch-xmpp --serial=xxxxxxx --access-key=yyyyyyy --password=zzzzzz ivt put /heatingCircuits/hc1/manualRoomSetpoint '{"value":18.4}'
Error: INVALID_RESPONSE
at /usr/lib/node_modules/bosch-xmpp/lib/base-client.js:257:23
at tryCatcher (/usr/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/usr/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/usr/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/usr/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/usr/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/usr/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/usr/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/usr/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/async.js:102:5)
at Async.drainQueues [as _onImmediate] (/usr/lib/node_modules/bosch-xmpp/node_modules/bluebird/js/release/async.js:15:14)
at process.processImmediate (node:internal/timers:476:21) {
response: {
protocolVersion: 'HTTP/1.0',
statusCode: '404',
statusMessage: 'Not Found',
headers: {},
body: ''
}
}

@robertklep
Copy link
Owner

Very strange, I would also expect this to work (but I never had IVT devices myself so perhaps they work differently than others).

Try enabling the debug log to see if there's anything obviously wrong:

env DEBUG=* bosch-xmpp --serial=xxxxxxx --access-key=yyyyyyy --password=zzzzzz ivt put /heatingCircuits/hc1/manualRoomSetpoint '{"value":18.4}'

@MatsA
Copy link
Author

MatsA commented Mar 28, 2024

Thanks for quick response and the DEBUG tips.

Seems to bee a timeout at the server ? Strange since the GET is so fast ....

Debug_log_IVT.txt

@robertklep
Copy link
Owner

Perhaps a 404 Not Found response takes longer, and the client doesn't wait long enough for it to be returned and keeps on sending new requests.

The main issue is the 404, apparently it's not possible to set the setpoint, but I have no idea why.

@MatsA
Copy link
Author

MatsA commented Mar 28, 2024

OK. If I'm understanding the log ....it seems that the client waits at max < 130 ms. Is there a way to extend this period, say up to 3 seconds ?

@robertklep
Copy link
Owner

No, it waits 5 seconds before it retries, and retries 15 times. The timeout can be set with --timeout, number of retries can't.

@MatsA
Copy link
Author

MatsA commented Mar 28, 2024

Aha, sorry, missed that option.

There are some deprecated packages, are you planning to update ?

Thanks for the help, Mats

npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated node-xmpp-tls-connect@1.0.1: this package is deprecated please use https://github.com/xmppjs/xmpp.js
npm WARN deprecated node-xmpp-core@5.0.9: this package is deprecated please use https://github.com/xmppjs/xmpp.js
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142
npm WARN deprecated node-xmpp-client@3.2.0: this package is deprecated please use https://www.npmjs.com/package/@xmpp/client

@robertklep
Copy link
Owner

Some day perhaps, but most are related to node-xmpp-core being deprecated, and xmpp.js isn't a drop-in replacement (plus I've had issues with that package in the past).

@MatsA
Copy link
Author

MatsA commented Mar 29, 2024

Ok.

Thanks for the help and have a nice Easter. 🐣

@MatsA
Copy link
Author

MatsA commented Apr 1, 2024

@robertklep
Copy link
Owner

Cool 😎

I'm not sure about the IVT devices, but some other Bosch devices have "built-in" endpoint discovery, where you can retrieve the / "endpoint" and it will you a list of endpoints that it supports. Those can then be retrieved in the same way, recursively.

For instance, this is what my EasyControl shows:

$ ./bin/bosch-xmpp easycontrol get /
{"id":"/","type":"refEnum","references":[{"id":"/devices"},{"id":"/dhwCircuits"},{"id":"/energy"},{"id":"/events"},{"id":"/gateway"},{"id":"/heatSources"},{"id":"/heatingCircuits"},{"id":"/heatpumps"},{"id":"/notifications"},{"id":"/programs"},{"id":"/solarCircuits"},{"id":"/system"},{"id":"/zones"}]}

So the endpoint it supports are:

/devices
/dhwCircuits
/energy
/events
/gateway
/heatSources
/heatingCircuits
/heatpumps
/notifications
/programs
/solarCircuits
/system
/zones

You can then retrieve those one by one to see which endpoints they have:

$ ./bin/bosch-xmpp easycontrol get /devices
{"id":"/devices","type":"refEnum","references":[{"id":"/devices/dev1"},{"id":"/devices/dev2"},{"id":"/devices/dev3"},{"id":"/devices/device1"},{"id":"/devices/device2"},{"id":"/devices/device3"},{"id":"/devices/list"},{"id":"/devices/productLookup"}]}

Etc.

@MatsA
Copy link
Author

MatsA commented Apr 2, 2024

OK, thanks for the tips. This was tested in an early stage, but unfortunately it isn't supported. Will just get an error, not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants