I need to modify a line of code of the node “modbus-serial” and include it on my home assistant installation.
I tested the modification on a PC where Node-Red runs locally, so it is easy to modify.
However, in Hassio, I don’t know where the source code files are stored.
How can I create a new custom component for Node-red? I downloaded the full original code and then I modified. I placed into the folder config/Node-red/nodes/ but doesn’t work.
Thanks! I already have the node created (because is a modification of an existing one). What I need is to replace/install it in the node-red installation of hassio.
And, where do I have to place the folder with the code? config/Node-red/nodes/?
And, additionally, I guess I have to tell somewhere to Node-red to use my code instead of the original.
If you do it properly, and create a custom node, it will be named differently, and node red will just pick it up. A friend of mine made a custom node for me from another node, I npm installed it from github, and it shows up as a different node.
I can do that you refers in a local installation. It is more or less easy. But, how can I do in Hassio if I cannot exec npm? Or at least I don’t know how to do it
I entered using SSH Web terminal add-on and I see all the files of Hassio but I cannot find the node-red add-on files. Are they in another container?
In Portainer there is an image of Node-red add-on, is it possible to modify it? How?
Thanks
I have been trying with Portainer but unfortunately I cannot find the container of node-red. I tried other options in node-red add-on: npm packages options, command options, etc. but doesn’t work as I need.
I just need to modify a line of the code of one node-red module. That’s all.
Great!! I found that at Settings. Just click on “remove” the addon filter and all the containers appeared.
Now I have access to the files, what is good for me. But, now the problem is that after modifying, if the system reboots, the modification does not remain because the system loads the image again. So, the solution should pass by modifying the image.
But modifying the running image is what you are already doing. NPM install inside the correct path and it will stay forever, but you need your custom node hosted somewhere.
Yes, but I just wanted to modify one line of a module. I need to “npm stop” and “npm start” to make the changes available but those commands are not allowed.
Well… I will continue trying.