Node-RED nodes for hubitat

Now I’m scared to attempt hac. This took a WHOLE day

Ask for help on the hubitat thread in the HA forum if you get stuck.
Quick note: The Samba addon is your best friend. :wink:

2 Likes

Yes. I will agree.

2 Likes

Out of curiosity, is it legal to sell open source software?

Like could hubitat sell a beefier hub with node red already on it instead of rm. not saying they should, but COULD they?

Most opensource licenses I know of do not place restrictions on selling only requiring things like code sharing etc.

1 Like

In fact doesn’t Hubitat do that already? The platform runs in a JavaVM on Linux .....

1 Like

Don’t take this as legal advice but generally speaking your are allowed to use open source software (depending on the license that this software uses) in your product as long as you acknowledge such usage and that your are actually selling your own product that uses open source software and you don’t just sell the open source software itself.

But, there are difference in all of the open source license (MIT, apache, GNU, etc.) so it would be wise to review each license before you try to sell it your product.

@aaiyar be careful these days with JavaVM. Oracle keeps changing the license and it is not as open anymore as it once was. There is still the OpenJDK but that is different than what you get when you download it from Oracle

2 Likes

I would also add (this is NOT legal advice) that you should be careful when including logos etc from such software.. as those might be subject to less open copyrights etc.

Research and legal counsel seems like the way to go before pursuing any such endeavor.

1 Like

With lots of help from @stephack I finally got the hubitat nodes functioning in NR running on home assistant!

I want to use the command node to issue a setDefaultLEDColor command to 20some Inovelli switches when my ring alarm arms. Is there any way to issue the command to multiple devices in a single node or do I need to lay out 20+ nodes?

You can possibly create a sub-flow and reuse it multiple times ....

1 Like

Damn. It's the only thing I've got on this flow anyways so creating a subflow would really only shift the visibility to another flow. I guess I got spoiled with the HA nodes and being able to just comma separate multiple devices within a single node. Ah well, I'm just happy I've got it working, it fills in the gap I was missing with the HE integration on HA.

1 Like

I'm using subflows for some informal grouping of devices. It's nice because I can tweak the behavior. For zigbee devices though the ZB group messaging in HE is the best way to go I think.

I wonder if the command node could be adjusted to accept multiple devices... or at least accept an environment variable or topic (or device id) .. mmm. (talking about device here not the command itself)

edit: actually the more I think about it environment variable not necessary. same as just using command node. Otherwise I suspect selecting a device dynamically might be too much processing during runtime - maybe a different node like a group node?

1 Like

This is an example of one of my HA nodes (controlling baseboard thermostats on HE). This turns off 15 thermostats when the outside temperature get's above a certain temp. I use the turn_off command and just put in the 15 entities and it's done. To accomplish this with the HE command node I would need to create a subflow or add 15 command nodes.

Accomplishing this may be more difficult with the command node because it pulls the available commands associated with the specific device, which is a great feature. But selecting multiple devices could cause issues with that if for example I selected an Inovelli switch and a GE switch together because they each have different commands.

I think an easier way to accomplish it would be to have more of an "all purpose" node where you can use a function node to inject the data. So in your function node you would define msg.device, msg.command and msg.arguments and then this new node would simply execute.

I went ahead and did a feature request on github for multiple device selection enhancement to the command node or a separate group command node. It may not be feasible, practical or in the design philosophy of the HE Nodes but figured I'd give it a shot anyway.

2 Likes

That's awesome! Cross our fingers and hope it gets implemented.

A similar example of what I'm thinking for a group command node would be the Pushover node. You setup all your inputs with a function node to form the message, and then the actual pushover node sends it.

I think something similar would be easier to do than re-making the command node to accept multiple devices.

I find myself duplicating nodes, one for on another for off. It would help avoiding mistakes ie copy/paste, if command node would use message for the device cmd.
Thx

I might be misunderstanding something. You can do this already by setting the "command" (and attributes) property or do you mean "device" selection?

I think multiple device selection in a single node is a bad idea, counter to basic node-red design philosophy, and adds a lot of back end code complexity that is unneeded. Just use multiple nodes.

That said, Francois is the one to convince, not me.

For different commands on the same device, as @erktrek pointed out, that is already possible today with the command node.

Although you need to use a change or function node to do it, so I'm not convinced that is much better than just having 2 command nodes. But each to their own.

No command.
image
Each node needs to set command to either on or off. Could avoid duplication, if cmd was set by input message.
Thanks

You can already do that in a single command node. It is in the help - specify msg.command and msg.arguments (if applicable) in the incoming msg.

Cardinal rule for node-red - read the online help for a node. Authors are supposed to (and almost always do) include a listing of all incoming and outgoing msg parameters in the online help/info pane.

Again, you would need 2x change nodes + 1 command node (3 nodes total unless you get creative in the change node and use an expression. EDIT: see example of that below) in your example, so I don't really think that is any better than 2x command nodes. But that's your choice to make, not mine.

1 Like