Node-RED nodes for hubitat

I have a usb powered MS6 I am using outside in a clear weatherproof outlet box. I use that for turning exterior lights on and off. Be sure to leave a gap between lux on/off thresholds and also maybe a timeout before turning off otherwise on partly sunny days you can get some unnecessary on/off cycling..

1 Like

I like to do rolling averages/filters for outlier rejection. Can easily do that with a function node or the "smooth" node (using a low pass filter or mean). The "smooth" node is super handy for a number of things, actually.

2 Likes

I do exactly this for the interior lights during the day and have a gap of 10 lux that seems to work well for my use case.

You find 10 lux is enough? 10 lux is almost nothing... I would have thought that would have been too small, and lead to a lot of false positive/negative.

I just looked at my house data, and in my house the brightness fluctuates a lot more than 10 lux about 100x a day (window blinds are always open during day).

This is interesting. Can you share a flow please? I have 2 minute timeouts for my outside lux, and it does flick on and off too much.

I think it's the way my sensors are reporting or it could be that my sensors are indoors. I have my range for indoor lamps set to "on" if lux<20 and "off" if >30 and that seems to work. I have 2 sensors (Aeotec MS6 and a Xiaomi) and both work fine within that range. Light readings are one of the attributes that I am not logging, so I can't say for certain what the reporting range is, but when I was setting up the initial logic, I rarely saw reading > 100

1 Like

Must be, either that or they don't really report "lux" as 30 lux is super dark (~3 candles)... :slight_smile: A "normal" room in my house is almost 1000 - that was an exaggeration 650 lux, but I do like my rooms bright.

I haven't used an aeotec ms6 for lux in a long time (the ones I have are in my drawer of devices I hate). To be fair, they work fine for a lot of things, just not what I need - battery life sux, motion is too slow, etc.

In the end though if it works - it works. My biggest challenge with using interior lux is always placement of the sensor so it doesn't get blocked/covered at some point (cleaning people, holiday decorations, can't be in a shadow, etc).

1 Like

Sent you a PM.

I was curious, so I tried a lux meter that I have on my phone and the readings are close. It must be the way the light is coming in (it's not direct sun). When I pointed my phone app directly at the sun, the readings shot up to 11K.

Direct sun is ~130K lux though. A lot of sensors made for interior use top out at 10-15K, so it may be a sensor limitation.

People don't know/appreciate how BAD many lux sensors really are...

2 Likes

I guess in some ways it doesn't really matter as long as there is some sort of scale you can work with..High accuracy for my simple purposes (external/internal lights) is not super important. I guess if you were matching light levels and bulb/dimmer levels maybe.

1 Like

True! Whether the units are green to red, or 0-10, or other it doesn't really matter as long as it reports in enough granularity and accuracy to be useful for the purpose.

I've made a number of light level sensors, and making interior ones is easy (even if placement is not). Making full range to direct sun is a bit more challenging as you usually need to use a neutral filter of some kind to keep the sensor from saturating at full sunlight. But then you have to back correlate (and lose some accuracy on) all the lower lux values. Oh, and often in outdoor applications you also have to adjust for sensor temperature as they get hot sitting in the sun. Kind of a pain.

Side -note - the GE Motion switch/dimmers actually have a light sensor inside of them, they just don't expose it externally. I only pray that if they ever make a 700 series motion switch/dimmer that they expose the lux reading externally. I would be in HEAVEN.

EDIT: Now who is OT in this thread??? Sorry.

2 Likes

This is one of the few places I’ve allowed myself to use contrib-nodes in my node-red. I don’t like bigtimer, primarily because it feels like a “how many features can I cram in one node” so I found a package called sun-position which provides a handful of nodes.

I use sun-position to generate events into a link in and link out node pair which I consider my “canonical sun events”. I’ve adjusted them by 30/40 minutes to get my porch lights to switch at the right times and that’s been sufficient for everything else to be on schedule with too. I do this because I don’t want to have 64 places to change when I change my mind about what time sunset is going to be in our house. In practice, it’s been running for a year and I haven’t touched it so maybe it wasn’t worth the fuss.

It also provides a reference for me to calculate the circadian rhythm of the house lights as well. In our house, we don’t get much sunlight. So having the bulbs turn off during the day wasn’t quite right. What I want is for the bulbs to be the right color during the day and then the light they put out isn’t obtrusive, and still contributes to the lightness of the room. Of course now we just have a bunch of lights which are on all day long... thankful for LEDs!

2 Likes

Yep I use Sun Position too! Very nice - I store results with my global Mode object so I can query it for things. I wouldn't be too concerned about contrib nodes - like HE the platform is designed around this in order to enhance functionality beyond what the core developers can do. The timer-varidelay, do-red, HE, Homebridge-automation and a few others.. I have had great experiences so far.

edit: that is not to say one should load up on contribs with no forethought.. don't want to be left hanging after a system update of course...

What is a contrib node? How does it differ from a non-contrib node? This is new to me.

I'm guessing something that isn't a built-in node. Some contrib nodes are better than others.

contrib is short for contributor I believe, so similar to a community app...

1 Like

But it's not standardised? "Do Red" for example, seems to not be a built in node, and it doesnt have contrib in the name.

1 Like

It isn't standardized.

Not only that, but there's examples of forked code showing up as a separate set of nodes. I know of one case where the fork has zero modifications relative to the original .....

2 Likes

Yeah, my main concern is that these things get abandoned. We all have pet projects, and I don’t want my project to be too dependent on others. I’m getting pretty good with node red, but at first it was counterintuitive and my temptation was to force my procedural logic into node red by sourcing either community nodes which did what I wanted, or write my own. In particular I was afraid to use too many nodes in a flow.

At this point I can see that most of what I want to do is achievable without these complexities, and the built in nodes are performing well enough that it doesn’t matter how many are chained up in a series.

1 Like