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

community_app
community_driver

#1

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.

Ok here are the parent/child apps:

And here is the driver:

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 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


Cobra Apps & Drivers - All Updated
[Updated] - Cobra Apps Container
Trying to copy illuminance level into a virtual lux device
#2

Could you explain the "trend" function?


#3

@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


#4

@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


#5

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.


#6

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


#7

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

I understand the trend now, thanks again.


#8

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


#9

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.


#10

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.


#11

Interface looks good and easy to understand,.


#12

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


#13

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


#14

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


#15

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


#16

@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

#17

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.


#18

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.


#19

If you click calculate trend button what happens?


#20

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