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

Sorry Andy but this has stopped working for me today too.
I have 2 lux sensors reporting to a virtual Lux Sensor.
Spotted this earlier today.
image
As you can see, everything was going along nicely until it just stopped.
Logs weren't live so cannot supply more info I'm afraid.
image

BTW your original app is humming along nicely but I only have one lux sensor configured for it.

Ok guys thanks for the info.
I’ll try and have a look at this and I’ll add some extral logging to see if we can find where it falls over.
I have a couple of temperature devices that have been running for ages without and problems so it may be related to the driver (as each part of the app is really only a duplication of the formula for average calculation)
I’ll also go back to the original app and compare methods & processes.

@bobbles which driver are you using for the old app?

Andy

1 Like

Your original one.
Average Virtual Illuminance Device.
V1.2.0 - Added 'Units' to events & Cleaned out old ST code

This app.
https://github.com/CobraVmax/Hubitat/tree/master/Apps/Average%20Illumination
This driver
https://github.com/CobraVmax/Hubitat/tree/master/Drivers/Average%20Illumination

@bobbles @halfrican.ak

Guys,
bear with me, I think I have found the issue but I intend to release a new driver and app very soon with the fix included.
It should be done very soon.

Andy

1 Like

Guys
I have released new versions of:

Parent: V1.0.1
Child: V1.2.0

And I have consolidated the drivers into one device.

I have also removed the 'trend' from the drivers (which, I believe was part of the problem)

Also added to the driver code is a new attribute 'LastReportingDevice'
This will show you which of your physical sensors last reported to the app/driver

Both the driver and the app now covers 'ambient pressure' (from a weather device?)

As always, have a play and let me know if there are any problems

Andy

1 Like

Well I've made it pass the 72 hour point without a failure, so things are looking much improved. Both my outside average lux and my Garage average temp have been working flawlessly using a 0 time-out in app.

Thanks for all your work on this Andy!

1 Like

Brilliant!
Thanks Mark

Andy

Ugh, failed to update again today. Wasn't running the log since everything was working so well.

Mark
Was it the illumination or temperature that failed or both?

Can you also please check the lastreporting device and make a note of which device reported last?

Andy

Mark
Up to now I’ve only really used temperature (which has been working ok for me without problems)
I’ll dig out an old aeon multisensor that I have somewhere and set that up with my weewx setup so I can get some averages.
I’ll run it for a few days to see if I have the same issue.
I’ll add some additional logging to see if I can find anything
I leave my logs open all the time so if anything shows up I’ll know.

Andy

Without touching anything else, is it possible to reboot your hub?
I want to see if that clears anything and it starts working again.

Andy

Hi Andy.
Mine stopped working yesterday morning aswell. Both the old and the new version reporting lux to different virtual lux devices failed at around the same time.
I did a reboot and this did nothing. Opened both of the apps, made a change and saved. Changed back and saved. Lux started reporting again.
Sorry but I didn't have logs running.
Looking at the device logs, the lux sensors kept reporting but the virtual lux sensor just stopped reporting. Nothing in the logs.

1 Like

Just lux failed, last device was living sensor.

1 Like

@halfrican.ak @bobbles

New version of child and driver uploaded now :slight_smile:

Child V1.3.0
Driver V1.1.0

There were a couple of variables not defined correctly (I think) which may have contributed to the issue.
I’ve sorted that now and added a bit more logging to confirm.

Andy

1 Like

If this works ok then ‘average motion’ will be next. :slight_smile:

Andy

@bobbles @halfrican.ak

Guys, a quick question.
How often do your illumination sensors report to the app?

Andy

Every 5 minutes or if lux changes by more than 1000

Ok.
So it’s not flooding the app with data then.
I thought that might have something to do with it, but obviously not

Andy

I would assume not, but keep in mind since the two sensors I'm using aren't perfectly synced the reports don't come in at exactly 5 min intervals. Usually I see one update a few seconds before the other.

I suppose a level change of 1000 lux would be fairly common during daylight hours so that might be fairly frequent. I will remove that setting so that it only reports every 5 mins regardless of level change and see if that helps any.

1 Like

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'

As always.. have a play and let me know if you find any bugs

Andy