[UPDATED] - Average All (Temperature, Humidity, Illuminance, Ambient Pressure & Motion)

Trend was set to default 30 mins and how often to send lux in the app was set to 0
I’ve set the trend to 0 now to test for a while

What do you have yours set as?

Andy

I believe mine were sent to:

Trend: 1
Update: 0

But I've changed them to:

Trend: 30 (Default)
Update: 5 (Don't really need updates more frequently than that)

UPDATE:

Been running it non-stop since our last contact 2 days ago. No issues with the settings:

Trend: 30
Update: 5

I've now set it to:

Trend: 0
Update: 5

Hopefully if there's an error somewhere it will show.

@Cobra Andy, I think I see what is happening. I have 0 errors showing in the logs with full logging activated. However, it appears that while the average lux is being calculated the app is stuck on waiting for time-out to occur before updating the virtual lux device.

Not a programmer by any means, but is it possible that the timer is being interrupted by another app causing the app to get stuck waiting for the time-out to allow it to update the virtual lux device?

The log excerpt below was taken with the app set to update every 5 minutes.

I've decided to eliminate the time-out on both driver and app to see if that prevents the return of the issue.

Thanks again,

app:36402018-09-05 21:57:45.803:infoYou are using the current version of this app

app:36402018-09-05 21:45:36.500:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Waiting for timer to expire

app:36402018-09-05 21:45:36.499:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Average Illuminance = 0.5

app:36402018-09-05 21:45:36.496:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Total Combined value = 1

app:36402018-09-05 21:45:36.492:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 2

app:36402018-09-05 21:45:36.487:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 1

app:36402018-09-05 21:45:36.485:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - received 1

app:36402018-09-05 21:45:36.483:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - running illuminance handler

app:36402018-09-05 21:36:05.843:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Waiting for timer to expire

app:36402018-09-05 21:36:05.842:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Average Illuminance = 0.0

app:36402018-09-05 21:36:05.840:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Total Combined value = 0

app:36402018-09-05 21:36:05.835:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 2

app:36402018-09-05 21:36:05.831:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 1

app:36402018-09-05 21:36:05.829:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - received 0

app:36402018-09-05 21:36:05.827:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - running illuminance handler

app:36402018-09-05 21:35:33.916:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Waiting for timer to expire

app:36402018-09-05 21:35:33.914:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Average Illuminance = 0.5

app:36402018-09-05 21:35:33.911:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Total Combined value = 1

app:36402018-09-05 21:35:33.905:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 2

app:36402018-09-05 21:35:33.900:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 1

app:36402018-09-05 21:35:33.897:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - received 0

app:36402018-09-05 21:35:33.894:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - running illuminance handler

app:36402018-09-05 21:31:06.090:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Waiting for timer to expire

app:36402018-09-05 21:31:06.088:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Average Illuminance = 1.0

app:36402018-09-05 21:31:06.085:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Total Combined value = 2

app:36402018-09-05 21:31:06.080:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 2

app:36402018-09-05 21:31:06.071:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 1

app:36402018-09-05 21:31:06.068:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - received 1

app:36402018-09-05 21:31:06.066:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - running illuminance handler

app:36402018-09-05 21:26:06.329:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Waiting for timer to expire

app:36402018-09-05 21:26:06.327:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Average Illuminance = 1.5

app:36402018-09-05 21:26:06.324:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Total Combined value = 3

app:36402018-09-05 21:26:06.319:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 2

app:36402018-09-05 21:26:06.313:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 1

app:36402018-09-05 21:26:06.310:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - received 2

app:36402018-09-05 21:26:06.308:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - running illuminance handler

app:36402018-09-05 21:25:31.511:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Waiting for timer to expire

app:36402018-09-05 21:25:31.509:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Average Illuminance = 2.5

app:36402018-09-05 21:25:31.506:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Total Combined value = 5

app:36402018-09-05 21:25:31.499:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 2

app:36402018-09-05 21:25:31.492:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 1

app:36402018-09-05 21:25:31.489:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - received 1

app:36402018-09-05 21:25:31.485:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - running illuminance handler

app:36402018-09-05 21:21:17.005:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Waiting for timer to expire

app:36402018-09-05 21:21:16.981:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Average Illuminance = 12.5

app:36402018-09-05 21:21:16.917:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Total Combined value = 25

app:36402018-09-05 21:21:16.878:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 2

app:36402018-09-05 21:21:16.708:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - Sensor data count = 1

app:36402018-09-05 21:21:16.672:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - received 4

app:36402018-09-05 21:21:16.656:debugAVERAGE_OUTDOOR_LUX (App Version: 1.0.1) - running illuminance handler

Hi Mark
That log was really useful - thank you

I think I may have found the issue.
As the lux is being reported so often, I don't think the timer has the chance to complete and reset.
So, I have coded it to not allow the timer to be overwritten until it expires.

I think this may fix the issue.

New child version 1.0.2 uploaded to GitHub

Andy

I assume the reason for the frequent updates is that the two sensors being averaged are updating at different intervals (due to their different locations) in some cases seconds apart ?

I would assume so.
Also it depends on how often the device is configured to report.
Some devices report even if nothing has changed, others report only on change.

Anyway, have a try and see if this solves your issue
If not then I'll look again

Andy

I'm using two fibaro motion sensors for the outdoor average. I have them set to send a report when there is a change of more than 1000 lux or every 5 minutes. I had hoped that would prevent excessive updating when minor changes occured.

I'll try the newest version with the app configured to average every 5 minute and see how it goes.

It took nearly 48 hours of logging to see what was happening in the excerpt, this is tricky to track down for sure.

1 Like

Do you think setting the time-out to zero if also an effective work-a-round to this since it prevents "complete and reset" issue from every occurring?

Mark
you are right, setting the value to zero would stop the issue (which is why I didn't spot it originally)

Andy

I'm not really using the "trending" feature, but I'm wondering if this is also an issue in the driver's timer function? When I set it to update trend 0 it works as expected, if I set a timer it seems to come up with some very strange results as if it is holding on to the previous "value" for a really long time instead of the most recent value reported. Might want to take a peek there too.

Mark
to be honest I will probably remove the 'trending' from the next version
I was really only using it as an exercise as I don't use it either (but have it set to 0)
It would probably need the same fix as the average to work correctly

Andy

The only real value I see for it is if it could be used as a "variable" in some other app or this app had the ability to control switches based on it's value. Otherwise your right, it's fun to look at, but not really useful in it's current state.

My original intention was to be able to use it with 'Weather Switch' as a trigger to control switches etc.

Now that could be really cool!

I thought so at first but I'm not sure where I would use it..

OK.. so I can switch on something if the lux was on the way down but.. I could just switch on when it got down to a specific level

I suppose humidity could work though..

Agreed, but I suppose having the option to use it wouldn't be a bad thing. People like options, especially "geeks".

Well for all the 'Geeks' out there I'm looking at some 'options' to combine the following into one 'Average' device driver:

Temp
Humidity
LUX
Pressure

And, almost anything else I can think of :slight_smile:

That way the device could be used for multiple apps that require the various outputs..
Obviously with WS it can be used to switch on/off almost anything too

Andy

1 Like

Well I hate to be the bearer of bad news, but the virtual lux device stopped updating again yesterday evening even with both time-out settings at 0. No errors in logging at all.

Mark
How long was it working ok for?
And has anything else on your hub stopped?

Andy

was working perfectly for almost 3 days, since our last contact. Nope, the HE is humming along without any problems anywhere else.