Node-RED nodes for hubitat

The only thing you can do is to attach a debug node to the output of your node switch to see when the timer gets triggered. At least you know based on the time stamp and content on when it got restarted and what the message was

1 Like

I submitted an issue/request to the dev. We'll see if he is receptive to the change or not. Wouldn't be hard to fork it and add the capability if he isn't interested - just need the time.

EDIT 1: Could use this node instead. Seems to work the same/similarly, but show time remaining.
EDIT 2: Not the exact same as MyTimeout doesn't pass along the input message. It only sends on/off/warning payloads. So whether this would be useful or not depends on if you need to preserve the input msg or not.

2 Likes

What hardware should I run Node-RED on?

I'm currently using a single SBC (Odroid XU4) to run a whole bunch of stuff (OpenVPN, dnsmasq, sendmail, bunch of NodeJs servers, a DLNA server and Node-RED).

Would I benefit significantly from replacing the odroid with and Intel NUC.?

I've got a question. How would I send different payloads to different outputs using the same function node (with the same input). I've been learning heaps through this thread, and have been using the examples posted above to emulate...appreciate it muchly.

I copied this flow and made my own modified version with some of the nodes referenced above.

Problem is this: I have a 2 minute timer, and if I walk around my office for 2 minute without stopping, the 2 minutes of active motion sensor mean the lights go off.

The solution is to change the payload on the function node so that output 1 sends a STOP to the 2 minute timer. How do I send 2 different payloads (one out output 1, the other out output 2) in the same function node on the same IF statement.

Here is the function node details
image

I've tried lot of options, not sure how to accomplish it.

This was my last failed attempt:
image

1 Like

In the words of Steve Irwin, who had a birthday recently.....crickey!!!

I figured it out, by pure googling and chance, (and beer).

image

What is the benefit of webhooks now part of this? What changes?

image

1 Like

If you already have configured the webhook url in the Maker API, then nothing
It's a helper for those who forget to add the webhook part and it help to indicate what next step to do after configuration. It can also make a more robust validation (e.i. verify white space) (but not implemented)
To support many hub it will also help to configure different path for the webhook

1 Like

The issue I'm having in this flow is that after the Fireplace switch turns on (which turns the ceiling fan to High) the sensor with the arrow still sends it's updated readings to the "temp" switch thereby changing the fan speed, even though the flow should still be going through the "on" output of the first switch in the flow.

Is there a way to make the sensor with the arrow ONLY send to "temp" switch when the first switch is turned off?

Try to uncheck the “send Events” option in that device and see if that solves your problem. This disables sending unsolicited events for that device

2 Likes

@dan.t probably has your answer. Just wanted to mention that you can probably use "Boolean Logic Ultimate" to check the status of the switch before permitting the sequence to continue. I do that over here (the red node is Boolean Logic Ultimate) ....

In your sequence, if the Boolean AND is true, you can use that start your switches based on the temperature pulled from the sensor.

I'll give this a shot, it will be a bit before it runs again to see.

With this unchecked will this continue to update the "temp" switch while the first on/off is off. Meaning the first switch is off for a long period and the temp changes will the temp switch still function? Or will it only update the "temp" switch only when the first on/off "changes" from on to off?

That boolean and variable stuff confused me with rule machine, never seemed to figure it out so I'll probably avoid it "if" possible.

1 Like

With disabling it it will only update if the other switch turns on/off.
If you also want "interim" updates, than you can't disable that option...

So let me get it straight on what you want.

  1. You don't want temp updates if the Fireplace switch is on
  2. You do want temp updates if the Fireplace switch is off

Is that what you are looking for?

Yes exactly.

If the switch is on everything in the off path should stop.

If the switch is off then the sensor routinely sends updated temp readings to change the fan speed only when the switch is off.

I do not want the fan changing speed if the first switch is on.

I would rearrange the flow to do that, something like this:


The change node "Save currentValue in another variable: has the following settings:

This way I can use msg.temperature later on the switch for deciding what speed the fan should be.

I don't know what triggered your original sequence above, I see there is an incoming line but I am not sure what that is.

I would also disable "send Events" for the Fireplace device

The question is, what do you want to happen with the Fireplace switch turns off... Do you want to take any action then?

I would probably do it more that way too...

  1. Store currentMode in flow.currentMode, then you can use it wherever you want in the flow. Only useful if you have multiple applications/control schemes in one flow, though.
  2. Two Switches in-line = logical AND, so once the variables you want are stored somewhere you can just use a switch into another switch to do AND logic instead of using function nodes. Although function nodes work fine, too, obviously.

Something like event --> switch to check on/off --> Switch to check flow.current Mode = what you want --> rest of logic path. By definition that is "AND" logic.

There are tons of ways to do it, though. Part of the fun!!

What I'm looking for there is nothing immediately needs to happen, the next time the "average bedroom temp" reports a reading then is when something needs to happen by changing the speed via the "temp" switch parameter. (just didn't want this occurring when the switch was "on")

I have it set up to your example here and it looks like it should be running shortly so I'll report back.

No single answer to that, of course. Many, many people run Node-Red on a SBC - rpi or otherwise. I run mine in docker on my main server, which is overkill (but man is it FAST).

If your logic is completing in a timely fashion, and CPU usage is acceptable, leave it alone.

Now the fan speed doesn't adjust with the switch turning on, nor the temp changing when the switch is off?

Would this be because the fireplace "send events" being disabled?

EDIT: It appears the on/off switch works ONLY after a new temp is reported

Correct... So, to fix that, let's do three things:

  1. In the "Save currentValue to another variable", change it to:

    Make sure you select "flow" in the drop down
  2. In the "Temp switch", change the property to "flow.bedroom_temp"
  3. In the Fireplace node enable "send Events"

This way the temperature get's saved in flow wide variable that can be recalled at any time and you can react to the events caused by the fireplace switch.

For completeness sake here is a second approach:
Add another Fireplace device with "sendEvents" enabled in front of the "Average Bedroom Temp" and query the temperature, like this:


In this case, the first Fireplace device really just triggers the sequence, so will the "Bedroom Sensor" as both of them have sendEvents enabled. The second Fireplace device later doesn't have sendEvents enabled as you are just worried about querying the current status

There are so many ways to skin a cat in NR, I could probably come up with 5 more ways to solve it. Pick the way it makes sense to you.