Creating a node with a drop down menu

Would anyone have any advice for how to start researching on how to create a Node that someone could install and pull out of the pallet?

I understand the basics at a high level of installing a package locally with an npm install with a package.json file. But that's about it, like I think there is an html file that needs to be included too?

Is there any boiler plate stuff someone could use for this process? What I am envisioning hopefully this doesn't sound silly but like a Node or widget I could pull out of the pallet that has a drop down menu with selectable features.

To make a long story short to get data from BACnet building automation systems, the Python BACnet stacks are real good/supported/mature so I created a web app that can run along side of Node Red.

Now I am experimenting with just using python-shell where I can pretty much do the same thing without having to use an entire web app & rest API.

The learning curve for learning node is steep, but hoping to learn how to make a Node or some sort of widget that can be eventually published to npm with a drop down menu the community can use for BACnet where under the hood Python BACnet stacks are being used.

Developing a node for install via NPM is not terribly difficult and there are lots of them on github to look at and follow.

Personally, I use VSCode for my development environment and the best place to start is the docs: Creating your first node : Node-RED

When you have something working, you would publish your node to npm using npm publish then lastly you would submit it for inclusion on the flows site

Cool thanks, how does one define a node that has a drop down menu for a range of selectable features? Is this defined in the HTML file? Would you know of an example to look at?

For what I am envisioning at least for BACnet 3 choices:

  • A dropdown for a BACnet read or write or release

  • An input box for a BACnet device address

  • A dropdown menu for an object type analogInput or analogValue or binaryOutput or binaryValue

  • An input box for point address

This is the basics of what is filtered down into the Python BACnet stack to perform a request on the BACnet network.

These are all very basic HTML type things (drop down / input / etc) - read up on HTML and follow the guide i linked to.

The best advice I can give you is look at other nodes and when you find something similar then go to its source code.

This source node-red-contrib-omron-fins has may of these features e.g...
image

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.