Node-RED nodes for hubitat

Fantastic, many thanks, I'll give this a go!

Cheers
Roy

2 Likes

if that doesn't work, set the dropdown that has "Speak" in it and change it to "Custom"

Then check out the info tab on that node to see how to format it properly (with a change or function node), it works great

1 Like

Hi all,

Haven't been around much lately but it warms my heart to see this Node-RED thread.

Not sure if this is the right place but wanted to mention a node that ive found useful since I first got hubitat.

It allows you to create devices to voice control with alexa in node red which then can be linked to anything you want in hubitat.

For me it is most useful for thermostat control. Takes a little setting up, but judging from this thread there are many up to the task.

https://alexa-node-red.bm.hardill.me.uk/

2 Likes

I noticed this earlier but am a little wary of registering anything through a 3rd party site... other than Amazon of course.

1 Like

Me too. I do use NORA though (a similar setup, but for Google Home devices)... So I guess I'm already playing with fire.

I use node-red-contrib-amazon-echo to create Alexa controllable items. No cloud all local.

1 Like

My only issue with those node(s) is I currently run NR on a different subnet so no devices get discovered. May have to change things up a bit..

I understand the wariness of registering at third party site. I can say I have been using it for a couple years without issue.

The local node is limited in device type i believe, but works really nice.

I was thinking, dangerous, I know, but that I could use the Node Red pushover and a node red ping or something to detect if my Hubitat is offline, and vice versa if my pi was offline. Anyone done this sort of thing so I can cheat?

I did that previously but not anymore. I only sent a notification if I got 3 consecutive failed responses though, not for just 1st one. If 1st failed, it pinged again 10 seconds later then another 10 seconds after that if 2nd ping failed. If 3rd failed, then it sent a notification. It could warn you that your HE is offline and send a pushover message. If your RPi is offline, it can't ping anything nor send the pushover message.

Currently, I ping all of my RPis other than one running Node Red, HE, & ST and then send to a graph in NR Dashboard.

I ping tons of things and send pushover notifications if they are dead. It could probably use a counter or something like @stephen_nutt mentioned. I didn't bother since I only check every 5 minutes.

function node added just so I can see ping status visually:

RBE set to ignore initial value so that I don't get alerts every time node-red reboots.

1 Like

Just want to point out that pinging Hubitat may incorrectly indicate that all is well. I have had the platform crash, but the underlying Linux OS was fine and returned pings on time.

At the time I was trying to monitor hub slow downs using ping (from a shell script). It may be better to use an http node and make sure the front page is returned.

3 Likes

Looking for a bit of help as I'm a bit stumped.

I have a virtual switch controlled by node red. When turned on I want there to be a minimum delay (for example 5 seconds) before an off command will take effect. So if I switch the device off after a second the actual off command isn't sent until 4 seconds later. I switch it off after 6 seconds the off command is sent immediately.

Is there an easy way to do this at all?

You could use a Delay Node, set it to rate limit and NOT check the Drop Intermediate Messages checkbox.

But, it would queue extra commands. So, if you were to send On/Off/On/Off within the 5 seconds, you would end up turning the switch on, then wait 5 seconds, then turn it off....and so on.

EDIT: I'm sure it can be done, but it isn't straight forward.

EDIT 2: Gimme a sec

EDIT 3: OK, this works in all scenarios... Not sure it is worth doing due to the complexity though.

The change node does this:

The "switch" node does this:

1 Like

Maybe something like this?

I haven't tested so ymmv..

edit: maybe stick a flow.allowoff initialization node before on/off if the flow var does not exist..

@erktrek this seems to work ok!

@JasonJoel Wow thanks for taking the time to put this together. I'm slowly coming to grips with it :grinning: and wanted to ask what's the purpose of the set msg.reset change node and the associated 1s delay?

1 Like

I love the fact that in NR there can be many different possibilities for the same solution.

I've learned a lot by seeing other peoples logic / approaches. It's also been incredibly easy (and fun) to refactor & incorporate things as I learn more.

Certainly a "guilty pleasure" in all this stay at home mess. This community is great. :confetti_ball:

3 Likes

Because if you hit ON again I assumed you wanted to restart the 5s timer. Only way to do that is to reset the delay block.

But you can't set and reset the delay block at the same time so you have to reset, and in a separate delayed message, set the delay block.

This would really be much easier in a function node with some code. I was just curious if I could do it in standard nodes - and I did.

In practice I would use a function node and write code for this though. :slight_smile:

Ignoring an off command altogether for 5s is easy. What makes this hard is queueing the off message and sending it later.

2 Likes

Switching my sequence to using only core nodes (HE Nodes excepted!) my trick to would be to do something like this:

The msg.reset wipes out the delay & msg each time and in effect acts like the stoptimer node.

2 Likes