Closed olithissen closed 5 months ago
Seems reasonable @olithissen, care to make a PR and I'll take a look?
NodeJS is not my day to day ecosystem but I'll see what I can do 👍
As mentioned above, this is not my day to day ecosystem and I failed at step one.
I went the straight forward way, installed Node-RED locally and installed the cloned repo via npm install ~/dev/node-red-contrib-bluelinky
. All the nodes are available but after configuring and deploying in Node-RED I just get a BlueLinky is not a constructor error. This is even before I do any code changes.
Decades of Java did not prepare me for this. Any hints?
Hmm I thought it was fixed in https://github.com/SondreNjaastad/node-red-contrib-bluelinky/pull/87
Can you make sure you have the latest node red addon installed?
I think I'm missing something: Installing via Node-RED palette works as well as npm install node-red-contrib-bluelinky
from within my Node-RED directory. However doing the same with the locally cloned repo npm install ~/dev/node-red-contrib-bluelinky
installs only node-red-contrib-bluelinky but none of the ~135 required dependencies.
The process for testing it seemed wrong: I installed the packaged npm dependency, changed the code in there and copied the changes back to my cloned repo. This seems totally off.
It looks like Node-RED expects the dependencies in .node-red/node_modules/
and not in .node-red/node-red-contrib-bluelinky/node_modules/
@olithissen my knowledge of node-red is limited so if you figure it out please do share more.
First of all: Thank you for bridging Bluelinky to Node-RED!
Problem
Bluelinky nodes seem to create new messages on output instead of extending the original input data.
I just noticed this when I tried to forward output to PostgreSQL: My input-message provides an
msg.topic
property with the name of the used endpoint (likeDriveHistory
). The output message ofDriveHistory
only contains the payload object and a new_msgid
. So I have no way to pass additional information through the node.Possible fix
A fix might be quite easy: Not sending an anonymous object in
node.send()
but by manipulating and sending the originalmsg
instead. (This would need to be done for all nodes and goes for the error responses as well)Let me know what you think!
All the best! Oli