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

Just installed, will let you know if all is well. Thanks for adding the option for 0 interval too.

On a side note, this might be outside of the scope of the app, but I'm wondering if something like this could be used for control of a bathroom exhaust fan?

I'm currently controlling it with 3 RM rules that monitors the RH of the room compared to the RH of the room next to it (as a baseline) and then activates/deactivates a switch that controls my fan.

The only thing that would make it "better" IMHO would be to be able to monitor the RH and then activate the switch (fan) when it's trending upward rapidly and then deactivate the switch when it returns to normal.

My rules work fine, just a thought.

You could use it with Weather Switch for levels
E.g if humidity went above a certain level turn on a switch
Once it’s below that level you can auto turn it off

Andy

1 Like

looks like the apps are updating as scheduled now, thanks!

1 Like

None of this is really feasible with this app
It’s was just designed to answer my need to average out a bunch of sensors - that’s all.
Most of the apps/drivers I release start when I have a requirement that is not met by something already created.

Looking at your requirement...
In an app, the comparison to another sensor shouldn’t be too difficult.
The trending rise could be adapted to enter a threshold rather than just rising or falling..
Quick or slow rising/falling might be a bit more difficult though...

Andy

The primary reason I'm comparing RH of the bathroom to the RH of the adjoining master bedroom is to account for a seasonal differences in humidity making an arbitrary value to base turning the fan on and off impractical. By using a comparison with the master bedrooms RH I can account for what the "non-shower time" humidity is.

Does this make sense?

Ok..
Why not join me here:

And we can chat about it.

Andy

Hi Andy. Thought I'd have a little play with this and I'm seeing some anomalies with the illuminance driver.
I've defined 2 illumination sensors. Turned on a light (both were showing zero), illuminance on one goes up to 24. Virtual device shows 12. Great. Turned off and level remains at 12. Turned back on again and now virtual device shows 24. Dimmed the light and lux reading goes down but virtual device increases again. Turn light off nothing changes even though illuminance is now 0 on the sensor.
Turned light on again and virtual device is now showing 31.
It looks like it is not average current values, but an average of all level reports it has received.
EDIT: Manually set virtual device lux value to 0. Illuminance sensors are reading 0.
Turn light on and one sensor is showing 24. the other 0. Virtual lux device changes from 0 to 31.7. Very peculiar.

I found an issue with not setting a variable to 0 (I changed the name and forgot to carry it over)

This should work ok now.

New version of the child app uploaded to GitHub

I have also 'tweaked' the drivers so there are now new versions of these too :slight_smile:

Andy

1 Like

Looks like my average app stopped reporting again. Unfortunately I didn't have the logs open or configured to report all as I was having no problems for the last couple of days. The sensors being averaged were reporting properly but the virtual devices was showing a value completely out of range and did not update regardless of what I did.

Not sure how I can help debug this if it's so random😕

Mark
Do you have all the latest versions?

Andy

Yes, I used the versions updated a couple days ago.

Yes most recent

Not sure if it helps, but both times it stopped reporting it was midday and I was tracking average lux of two sensors facing outdoors. Lux reading got stuck at a higher number over 9000 lux. As I mentioned the sensors themselves kept reporting, but the average lux stopped.

Mark
I've been testing this for a couple of days with adding some really big lux numbers
Everything has worked perfectly

Is there something else on your hub that happens at midday?

Can you try and leave your logging open just before midday to see what is happening (if anything)?

Andy

Will do, and will report back

What settings for update interval both on lux and trend are you using?

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 ?