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

I found a need for an app & driver to 'average out' temperature, illumination & humidity.

So here is a little app and a couple of device drivers to do just that.

This is a parent/child app so you need to install both parts before 'loading' the parent .

This also comes with three virtual device drivers so you can create virtual temperature, illumination & humidity devices for use in other apps.

After installing the parent you can create as many of the child apps as you wish (You need to create one for each virtual device used)

As usual any bug reports or suggestions always welcome


Updated 23/05/2020
This app/driver now also 'groups' switches & contacts
All my apps are now available with free membership to HE owners:


Updated 01/10/2018

Parent: V1.0.2
Child: V1.5.2
Revised auto update checking and added a manual update check button


Updated 26/09/2018

ChildApp V1.5.0

Bugfix on timers getting stuck and Illuminance failing after a couple of days


Updated 18/09/2018

Driver: V1.2.0
ChildApp V1.4.0

This now contains all previous fixes

Also:
Added average 'Motion'
Obviously this does not average out motion events (Motion is either active or inactive) :slight_smile:
What it does do is group motion sensors together so any motion on any sensor sets the virtual device as 'active'.
Is has a configurable delay so that when ALL motion sensors become inactive a timer starts.
When the timer runs out, the virtual device becomes 'inactive'


Update: 11/09/2018

Parent Version: 1.0.1
Child Version: 1.2.0
Driver Version: 1.0.0 (New all inclusive driver)

This has now been revamped:
The drivers are now consolidated into one 'AverageAll' driver
This has Temperature, Illumination, Humidity & Ambient Pressure

Andy

7 Likes

Could you explain the "trend" function?

@Cobra

Just got this error on one of my virtual luminance child apps

[dev:2356]logs#dev2356)2018-08-28 07:47:58.473:errorgroovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.Integer#multiply. Cannot resolve which method to invoke for [null] due to overlapping prototypes between: [class java.lang.Character] [class java.lang.Number] on line 80 (setLux)

[dev:2356]logs#dev2356)2018-08-28 07:47:58.433:debugSetting illuminance for vL

@halfrican.ak
Mark
this looks like you have not set the "How often to check for trend (Minutes after illuminance change)" setting - You MUST set a setting here (I use 5 for illumination but you can use any number)
This is the number of minutes before checking to see if the lux is going up or down

This relates to your previous question.

The 'trend' is to show if the illuminance is going up or down since the last reading

So if the last lux was 100 but the one before that was 90 then the lux trend is rising. (i.e going up or becoming brighter)

If you are not that bothered about the lux trend then just set it to 60 or something

Andy

Looks like the preference for how often to check trend is mandatory, perhaps a default should be set? I had it set one of my virtual devices, but missed it on the one that was throwing the errors.

1 Like

Default is already set to 30 so I''m not sure how it got removed.

you must have hit reply at virtually the same time as I did, haha, thanks.

I understand the trend now, thanks again.

1 Like

Great
Hopefully this will work ok for you.
Please let me know how you get on.

How do you like the interface? is it obvious to use?

Andy

I didn't delete it, not sure either, it wasn't showing a default on the other virtual device I created either, but I set a value on that one.

Hmm...
the code should set the default as 30
I'll add some extra code for next time to set a more forceable default just to make sure.

1 Like

Interface looks good and easy to understand,.

1 Like

Great!
The only thing I am worried about is if someone tries to set up illumination then saves it.. then reopens it and changes it to temperature (or humidity) and then fills in the page again.
I'm not sure what this would do

But hey! I can't provide for every eventuality

Andy

I'll let you try that first, I don't want to be blamed for triggering the next ice age!

1 Like

LOL
Ok.. I see a typo in the device driver relating to the default value

I have fixed it now and will upload it once I have checked the others

Andy

1 Like

OK.
the typo was in all three drivers.
Thanks for finding that
I have uploaded the fixed drivers to gihub

It should now just put a default 30 mins in.

Andy

1 Like

@Cobra

Not sure if it matters to the functionality of the apps, but in driver versions 1.3.1 I noticed that the state variables no longer appear to be updating in the device status page of the virtual devices.

From the logs: It looks as though the fix you made to the default for check trend may have broken the feature itself. I don't see it reporting trend changes based on the interval set.

State Variables

  • Copyright : Ⓒ 2018 Cobra
  • Status : Current
  • current : 1.5
  • previous : 12.0
  • Version : 1.3.1
  • trend : Falling
  • author : Cobra
  • calc : 1.5
  • InternalName : AverageIllum
  • UpdateInfo : N/A

Current States

  • DriverAuthor : Cobra
  • DriverStatus : Current
  • DriverUpdate : N/A
  • DriverVersion : 1.3.1
  • illuminance : 3.5
  • trend : Rising

What happens if you refresh the page?

Also.
The trend will only update after the driver receives a value from the app

E.g. if you set the trend time as 2 minutes, this is 2mins after the next update from the app.

Commands

Calculate Trend Now

calculateTrendNow

Set Lux

setLux

decimal:

Current States

  • DriverAuthor : Cobra
  • DriverStatus : Current
  • DriverUpdate : N/A
  • DriverVersion : 1.3.1
  • illuminance : 10.0
  • trend : Falling

State Variables

  • Copyright : Ⓒ 2018 Cobra
  • Status : Current
  • current : 10.0
  • previous : 3.5
  • Version : 1.3.1
  • trend : Falling
  • author : Cobra
  • calc : 10.0
  • InternalName : AverageIllum
  • UpdateInfo : N/A

It appears to update the current value, but as you can see it doesn't appear that the previous value is correct and the resulting "trend" state is wrong.

If you click calculate trend button what happens?

Current States

  • DriverAuthor : Cobra
  • DriverStatus : Current
  • DriverUpdate : N/A
  • DriverVersion : 1.3.1
  • illuminance : 10.0
  • trend : Static

State Variables

  • Copyright : Ⓒ 2018 Cobra
  • Status : Current
  • current : 10.0
  • previous : 3.5
  • Version : 1.3.1
  • trend : Falling
  • author : Cobra
  • calc : 10.0
  • InternalName : AverageIllum
  • UpdateInfo : N/A