I've released it over a week ago and it seems to get quite some downloads (also getting lots of positive feedback on how people were missing this functionality).
There are two use cases for this node: the slider mode and the preset mode. In the slider mode you configure the min, max, step, and default, and whether the node should inject on change.
In the preset mode you can define button labels + values. If you define the content as jsonata it allows you to use the label for reference.
While the node works really nice and easy, it does deliberately break the "editor is not a dashboard" rule mentioned here: Node appearance : Node-RED. Though countering that is that this is an inject node, which is mentioned to be excluded from that rule.
Collapsing is a great suggestion. I can even see that working for both nodes.
I did notice that creating a group with the node in does make it go over the borders of the group. But doubt that the node can do much about that (apart from collapsing).
In preset node, if one of the presets hasn't been triggered, there is a lot of empty space below the presets - I think it would be better to have the output as a node status which already has space carved out for it in flows and is a standard function as in this example:
And yes, I know that turning off the label for this node probably doesn't make a lot of sense - but it is good to be consistent.
The other thing that I think would be a good addition if you ever get time would be to add another config input that allows setting the output msg property rather than only forcing msg.payload.
In fact, ideally you might also consider having an extra, optional "full msg" option (probably only makes sense for preset mode) where the output has to be either JSON or JSONata, that would give a lot more flexibility.
I think this is very useful though and I will certainly be using it at least on my dev instance where I have loads of test inputs:
Would it be possible to add in ability to define what msg.xxx is output as per standard inject e.g for an http node the inject text needs to be sent in as msg.url
Could the default label be the contents/name of 2nd field
Thanks both @cymplecy and @TotallyInformation for the improvement suggestions.
I am quite confident that I'll be able to add most of them without too much effort.
I've noticed that if I set it to 'slider' mode, the moment I click on the slider circle, it jumps up to 100 and I can't change it. I then opened it in Firefox and Brave and it works fine...sigh
That is a weird one. At least I am able to reproduce that on Safari. You'd be hoping that all the browser incompatibilities would have been a thing of the past by now. Going to try to fix that for Safari.
Just pushed v1.1.1, trying to address most of the suggestions and feedback from this thread. The headline fix is the Safari slider bug (the thumb was jumping to max on first touch), but there is quite a bit more:
Configurable output property: write the injected value to any msg property, not just msg.payload
Node status: the last injected value is shown below the node after each
injection
Auto-label presets: if you leave a preset label blank, it defaults to the value string
Full message output: tick "full msg" on a JSON or JSONata preset to send the evaluated result as the entire message object instead of a single property
Auto-collapse: optional setting that collapses the widget to normal node height after 3 s of inactivity and re-expands on hover
JSONata label variable: in a JSONata preset value, label refers to the button's own label, so you can encode a parameter directly in the button name
And some other minor things. Thanks everyone for the engagement and suggestions. I really appreciate that.
Also, I think standard NodeRED behaviour is to not fill in fields left empty.
I think the default of the name field should be empty (not auto) and then if you change the contents of the 2nd field, the node will auto-update the label but not fill in the 1st field
It took a while before I figured out what you meant here. But yes, i can adjust that. Some nodes may have had the name already saved in the config, which is a minor migration quirk I'll happily live with.
The other point I am tempted to leave as is. Having the grey "auto" there is a Node-RED standard, or at least used by some nodes. The mqtt node for example shows "Leave blank for auto generated"