Two light sensors in one flow

Hi all Homey gurus!

I have had a flow that turns on some lighting using a light sensor depending on the outdoor light conditions. Simply put: “When light sensor reports below value 20—>turn on indoor lights”. I have this value set after my perception of when the light condition indoors would prompt me to start to turn lights on manually if I had a “dumb” home.

This works really well most of the time, but during a period in spring and fall (when the sun is shining) there is a weird “anomaly” in the outdoor light conditions that triggers the flow when there is plenty of light indoors. Probably this has to do with the angle of the sun and placement of the sensor. I might find a way around this by moving the sensor around using trial and error, however that would be tedious and might take years since there are several conditions that have to be met for the anomaly to occur…and of course it’s more fun to do more digital stuff rather than doing analog things like moving sensors. :sunglasses:

So my thought was to get a second light sensor and place it on the opposite side of the house (the side that the sun is shining on) and do an advanced flow that stipulates that both sensor values need to be met for the lights to turn on.

It’s obvious that I’m not that good at programming flows. I thought that this would be easy peasy…but no…it did not work. Here is my non functioning flow:

To brake it down: Ljussensor Entré is the “old” sensor and when it’s value goes below 20 is when I want the lights to turn on under normal conditions. Ljussensor Altan is the new sensor that I want to counteract that anomaly that makes Ljussensor Entré show under 20 when it’s still really bright indoors. Here you can see the problem:

At about 16:17 there is a sharp drop in the top line (Ljussensor Entré) below 20. The bottom line (Ljussensor Altan) is still above 10. At about 16:39 the top line goes above 20 again showing that the outdoor light still is bright enough for the indoor lights to stay off. This has nothing to do with clouds…it has been clear skies all day here.

At 16:42 is the first time both sensors are below the values I have chosen and that’s when I felt that the lights should turn on.

Does anyone see anything obvious wrong with the flow?

Sorry for this long post…I’m trying hard to explain things short, but I feel that I’m not that good at that either. :pensive:

You can use the “group” app to group the two sensors.
The app allows you to use the max, min. Or average value of the grouped sensors (can be more then 2)

I think that simoifies your flows a lot

In my opinion this is not correct. As it looks, the light blue curve represents sensor Ljussensor altan, and the dark blue curve represents sensor Ljussensor Entré. And the value of the Ljussensor altan sensor remains above 14-15 lux all the time. According your flow the value has to be under 10 lux (in combination with < 20 lux of the Ljussensor Entré sensor) to trigger the flow.

I do have the “Group” app but I’m not sure an average is what I want…I’ll have to test that during different light conditions. :+1:

I think you are correct sir! :smiley: I might have mixed things up when monitoring the values in preparation for the flow. It’s a pity that Homey chooses such similar colors for the graphs.

I’ll monitor the values more carefully today…the light conditions will be the same today as yesterday and it will result in the “anomaly”.

There is a possibility that this is impossible to achieve, at least with the sensors outdoors. The problem is that the bright sunlight at a low angle bounces of nearby buildings in some strange way, tricking the main light sensor that it’s darker than it is. I might try to place the “new” sensor indoors, since this flow is to turn on indoor lights when the feeling is that its needed. The challenge there is to find a place for the sensor where it’s not influenced by the indoor lights but still can monitor the ambient light.

OK, new test and there is definitely something wrong with the flow.

I moved the new sensor indoors just to do some testing. I changed it’s trigger value to 20 and waited for the light to go below that. Nothing.

Here is the updated flow:

And here is the Insight:

As you can see the “Ljussensor Entré” is at 15.2 and the “Ljussensor altan” is at 19.2. Yet nothing happened.

As far as I understand the flow is that the Better logic “When” card: “A variable changed Ljussesor Entré” is like a spy checking for the value of the sensor Ljussensor Entré to change. When it detects a change it sends a signal to the two “And” cards. If the condition of the set value of both sensors are met, the signal goes through to the “All” block and onwards to the “Then” cards.

If either of the values of the “And” cards is false nothing happens. The “When” card keep checking the value of Ljussensor Entré, even if the value is below the set number in the “And” card, correct?

I created 2 groups with the same sensors:
1 “its light”, that uses the minimum of the 3 light sensors (one sensor catches the light of one of the flodd light and used to trigger the “its light”
2 “its dark”, that uses the maximum of the 3 light sensors

Your “light sensor” measures temperature?? mine does Lux :thinking:. How do you light sensor output look like?

Interesting solution! I’ll have to test that. :+1:

The sensors are modified temperature sensors, that’s why the unit is C°. For this purpose the unit is irrelevant since it’s the threshold value that is important. You can see the output in the pictures of the Insight graphs I posted earlier in this thread.

The sensors I use are cheap 433 MHz temperature sensors. They have amazing battery life (AA-batteries), are accurate and have a high reporting frequency which is paramount for monitoring light conditions. The only drawback with the sensors is that they have max/min values, so when it’s completely dark they report a fixed value which makes Homey report the sensors as non responsive (IMHO this is a bug in Homey.) This doesn’t affect the use of the sensor though.

I don’t use the Better Logic app. Could you please share the flows where the temperature (lux) changes of the devices is set into the Better Logic variables Ljussesor Entré and Ljussensor altan?

Did you try this flow already with the device cards instead of the Better Logic cards?

This depends on how the 2 variables are updated. The If-card “A variable changed Ljussesor Entré” is triggered every time the variable has changed.

So if the corresponding flow is set up as follows, then the flow will be triggered only 1x, and that is when the temperature/lux drops from >= 20 below 20. Then your assumption is correct.

If…
– Temperature (lux) becomes less than 20
Then…
– BL Set number variable Ljussesor Entré on value

But if the corresponding flow is set up as follows, then the flow will be triggered at any temperature/lux change:

If…
– Temperature (lux) has changed
Then…
– BL Set number variable Ljussesor Entré on value

So, this is the reason why I asked for the corresponding flows how they are set up.