Node-Red Flow Samples/Sharing

Yes. node-red-contrib-ip

I also have a pushover notification coming out of the top switch, which I removed....it notifies me of the change in public IP address.

3 Likes

You could also look at the Hub Info device driver for Hubitat. It's got a new feature to get the external IP.

2 Likes

The speedtest node was (for me) completely useless... It reported like 20MBps when going to Speedtest.net would show 400 and would also be around 20 if my provider was having a problem and Speedtest.net showed 90. So I built one that uses Fast.com:

It's on the order of 50% of the speed I get from Speedtest.net and is the same as the result from Fast.com

5 Likes

Hello all, I'm learning about node-red and love the additional capabilities it adds to hubitat, especially the dashboards. I have a beginner question and did a lot of searching but couldn't find a clear answer anywhere.

I am experimenting to find if the node-red dashboard would make a nice wall-panel touch display. I have some temperature line charts which I love and now I am trying to control a dimmable light using the ui_switch and ui_slider. Like the standard hubitat dashboard, the switch and slider should both control the light, and the UI should respond to changes when the light is controlled from elsewhere (this is the part that overly complicates the flow).

I have cobbled something together that works, but would like to know if I am on the right track or if there is a better way. If this is a good enough way then I will try to figure out how to make it into a subflow so I can re-use it for many lights.

From left to right I have

  • Device - the dimmable light switch. Receives "level" (dim) and "switch" (on/off) events.
  • Function - route message to the proper UI element while also formatting message properly as needed for next node
  • UI dashboard elements - switch and slider.
    • From the input (left) side it receives events and updates the display. I turned off "pass through" so there will be no infinite loop
    • Output (right) side - If you click the switch or slide the slider, sends command to the device
  • Change nodes - format message as needed by command node
  • Command node - control the light

ui

This might be useful to anyone looking to replicate a "wait until" flow. The first inject node set the flow context to First and starts the timeout timer. The second inject node is passed through if sent before the timeout and resets the flow context to "none"

@Royski

As a way to streamline your dummy Alexa Routines that you have to do, my brother pointed this out for Alexa:

It seems that you could create a bunch of different phrases that you use and just tell Alexa to respond with "ok". I haven't played with it yet but I hope that it would eliminate a bunch of dummy routines that just wait. My brother got to 50 "questions" and it was still going strong.

I haven't had a chance to play with it but I think it would streamline both of our setups.

3 Likes

Oh man this is awesome!! Not only that, but I like that you can add more ways to say the same thing :smiley: A shame you cant respond with Brian's voice, I kind of like the "Jarvis" replies lol. Fantastic tip, many thanks for this!! :+1:

Evidently you are limited to 4 variations of saying one "question" but that still should work well.

1 Like

How many ways do you need to say "Turn the ■■■■■■■ lights on" hahahaha. :stuck_out_tongue:

I think I mentioned in my original post about this but I use at least 3.

  • Illuminate (from The Demolition Man)
  • Lumos Maxima (from Harry Potter)
  • Turn the Lights on
1 Like

I got tired of trying to figure out every permutation that someone might use and putting them into blueprints so I just stuck an extra Alexa speaks at the end with her saying "OK, got it boss". So she interrupts herself, which is pretty funny

Me: Alexa, turn on bathroom lights
Correct bathroom lights turn on
Alexa: A few things share the name bathroom li... OK, got it boss

2 Likes

can you post the code for this example? i’ve been using the join-wait node, which works pretty well.

thanks

Sure

[{"id":"d08e5ad8.f69718","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"b853fcba.9df86","type":"inject","z":"d08e5ad8.f69718","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"First","payloadType":"str","x":230,"y":220,"wires":[["b9f3c3d.a2f894"]]},{"id":"bf9251ae.dff4c","type":"change","z":"d08e5ad8.f69718","name":"","rules":[{"t":"set","p":"First","pt":"flow","to":"First","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":160,"wires":[[]]},{"id":"d3c837a8.3f6aa8","type":"inject","z":"d08e5ad8.f69718","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Second","payloadType":"str","x":230,"y":300,"wires":[["c502e0c6.4876e"]]},{"id":"8c3bcbc1.36fbe8","type":"change","z":"d08e5ad8.f69718","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Done","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":340,"wires":[["78a77ab8.4013a4"]]},{"id":"2a3fc4ec.6deeec","type":"change","z":"d08e5ad8.f69718","name":"","rules":[{"t":"set","p":"First","pt":"flow","to":"none","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":240,"wires":[[]]},{"id":"c502e0c6.4876e","type":"switch","z":"d08e5ad8.f69718","name":"","property":"First","propertyType":"flow","rules":[{"t":"eq","v":"First","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":450,"y":300,"wires":[["a60279a1.ef4aa8","b3ca04ba.3ae468","8c3bcbc1.36fbe8"]]},{"id":"b3ca04ba.3ae468","type":"delay","z":"d08e5ad8.f69718","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":890,"y":280,"wires":[["2a3fc4ec.6deeec"]]},{"id":"a60279a1.ef4aa8","type":"trigger","z":"d08e5ad8.f69718","name":"","op1":"","op2":"1","op1type":"nul","op2type":"str","duration":"2","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":880,"y":220,"wires":[[],["2a3fc4ec.6deeec"]]},{"id":"b9f3c3d.a2f894","type":"switch","z":"d08e5ad8.f69718","name":"","property":"First","propertyType":"flow","rules":[{"t":"eq","v":"none","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":450,"y":220,"wires":[["53884dfc.d73504","a60279a1.ef4aa8"]]},{"id":"53884dfc.d73504","type":"delay","z":"d08e5ad8.f69718","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":730,"y":160,"wires":[["bf9251ae.dff4c"]]},{"id":"78a77ab8.4013a4","type":"debug","z":"d08e5ad8.f69718","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1140,"y":340,"wires":[]}]

PS you also need to initially set the flow context to "none" or else it won't work

1 Like

Yeah I'm getting this too, even with a response added. She is just giving me the error but still doing what I asked. :expressionless:

I played with the Alexa Blueprint last night and was able to eliminate about 15 routines. It also motivated me to implement voice commands to turn on different channels on my Roku w/ my voice since I no longer have to add a new dummy routine for each variation. So far, that works also. I went back and edited my original post describing this example and recommend Alexa Blueprints in case someone is reading from beginning.

1 Like

I think I may need to do some renaming of lights and lamps, and avoid the errors. This is very nice though :slight_smile:

I updated my button tap subflow, now it traps doubletap and held events - you can define how many "taps" a held event is.. Previously I was using this for a pico in quick mode but now can be used for buttons like smartthings button or others maybe. Also taps exceeding the 4 by default will get sent through the 4th output - you would need to check the "msg.count" property.

Updated code now on this post:

Here was the original post:

3 Likes

Looking for advice from anyone using lux readings to automate lights. I'm trying to decide what approach would be reasonable or most effective using the "Calculate" node (or any other node that does average, max, min over a period of time). Do you use average readings or max or min? Over what period (minute or more)?

Currently, my automations work well unless there is moving cloud cover causing the lights to cycle on/off. Appreciate any guidance you can provide.

No right answer on this one - it depends on personal tastes, and how fast your lux sensor updates.

I like the smooth node (node-red-node-smooth) for smoothing signals, but there are a number of other nodes that can do it.

Here are some examples of response on my outdoor lux reading that updates 1x/minute (weatherflow weather station).

The trick is how fast you want the automation to react. I don't like the lights shifting frequently/fast, so I use a fairly high filter. Mean 3 or Mean 5 works well for that, with values at the 1x/min frequency. If you want it faster, or your lux readings come in faster/slower you would have to adjust that.

As you would guess, the dips are clouds that went by.

Raw vs Low pass filters:

Raw vs Means:

1 Like

Yeah - This one is an Aeotec MS6 using @csteele’s driver. I have it set to report on a 2 Lux change (works for me since it’s indoors). Since I’m logging all changes, I think I can go back and look how quickly it’s reporting but I’m going to have to find a day that matches cloudy conditions!

I think I may start with a “max” value and 1 minute and see how that goes. Thoughts?