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

@Royski I requested access but have not yet received a reply.

Hi James

Pretty sure I approved your request myself.
Can you please try this.

Thx.

Guys
our email system was having a few problems
It may be that reset emails etc were not being sent
Testing the fix now

Andy

1 Like

Thanks, @Cobra - as far as I can tell I never received notification/confirmation of my create account request.

Your account has been created
Please see my PM

Andy

1 Like

@Royski That did it. Thanks!

1 Like

Here's a wee bit of code for calculating dew points. Based on this driver.

Absolute humidity calculation not finished yet.

definition(
	name: "Calculate dew point",
	namespace: "hubitat",
	author: "Bruce Ravenel",
	description: "Calculate dew point",
	category: "Convenience",
	iconUrl: "",
	iconX2Url: "")



preferences {
	page(name: "mainPage")
}

def mainPage() {
	dynamicPage(name: "mainPage", title: " ", install: true, uninstall: true) {
		section {
			
			input "thisName", "text", title: "Name this dew point calculator", submitOnChange: true
			
			if(thisName) app.updateLabel("$thisName")
			
			input "tempSensors", "capability.temperatureMeasurement", title: "Temperature Sensor", submitOnChange: true, required: true, multiple: false
			input "humidSensors", "capability.relativeHumidityMeasurement", title: "Humidity Sensor", submitOnChange: true, required: true, multiple: false
			input "pressureSensors", "capability.pressureMeasurement", title: "Outside Pressure Sensor", submitOnChange: true, required: true, multiple: false
						
		}
	}
}

def installed() {
	initialize()
}

def updated() {
	unsubscribe()
	initialize()
}

def initialize() {
	
	 Map map = [: ]
	
	def averageDev = getChildDevice("DewPointCalc_${app.id}")
	
	if(!averageDev) 
		averageDev = addChildDevice("hubitat", "Virtual Temperature Sensor", "DewPointCalc_${app.id}", map, [label: thisName, name: thisName])
		
	subscribe(tempSensors, "temperature", handler)
	subscribe(humidSensors, "thumidity", handler)
	subscribe(pressureSensors, "pressure", handler)

}

def handler(evt) {
	
	def temp = 0
	def totalh = 0
	def totalp = 0
	def outsidetemp = 0
	def Rho = 0
	 
	tempSensors.each {
		/*def offset = settings["offset$it.id"] != null ? settings["offset$it.id"] : 0*/
		/*total += (it.currentTemperature + offset) * (settings["weight$it.id"] != null ? settings["weight$it.id"] : 1)*/
		temp += it.currentTemperature 

	}
		
	
	humidSensors.each {
		totalh += it.currentHumidity
	}
		
	
	pressureSensors.each {
		totalp += it.currentPressure
		outsidetemp += it.currentTemperature 
	}
		
	dewpoint = (temp - ((100 - totalh) / 5))
	

	def averageDev = getChildDevice("DewPointCalc_${app.id}")
	
	averageDev.setTemperature( dewpoint.toDouble().round(1))    
   
	
	/*
	You can show that this matches theory by re-arranging the ideal gas law: 
	PV = mRT for pressure P, volume V, mass of the gas m, 
	gas constant R (0.167226 J/kg K) 
	and temperature T to get 
	ρ = P/RT in which ρ is density in units of m/V mass/volume (kg/m3).
	
	Temperature (°C) = 13.55
	Air pressure (hPa) 1018
	Dew point (°C) =    -6.4
	rho (kg/m3) = 1.2352
	*/
	
	Rho = ((totalp.toDouble().round(1) * 10)  / (0.167226 * ( 273 + temp) )) / 16.8896534974
	
	//sendEvent(name: "Rho", value: "Rho $Rho kg/m3")
	
	
	ABShumid = Rho * totalp
	
	
	 //averageDev.setHumidity( ABShumid.toDouble().round(1))    

	log.info "Dew point temperature = ${dewpoint.toDouble().round(1)} °C" 
	log.info "Absolute Humidity = ${ABShumid.toDouble().round(1)} kg/m3" 
	log.info "Pressure  = ${ totalp.toDouble().round(1)} Kpa" 
	log.info "outsidetemp  = ${ outsidetemp.toDouble().round(1)} °C" 
	log.info "Rho  = ${ Rho.toDouble().round(4)} kg/m3" 
	
	state.OutsideTemp = "Outside temp ${ outsidetemp.toDouble().round(1)} °C "
	state.Rho = "Rho ${Rho.toDouble().round(4)} kg/m3"
	state.Baro = "Pressure ${totalp.toDouble().round(1)} Kpa"
	state.ABShumid = "ABS Humidity ${ABShumid.toDouble().round(1)} kg/m3"
	state.DewPoint = "Dew point temperature = ${dewpoint.toDouble().round(1)} °C"
	
	
	tile = "<div>"    
	tile += "<div>Dew point ${dewpoint.toDouble().round(1)} °C </div>" 
	tile += "<div style=\"font-size:0.8em;line-height:20px;\">Outside temp ${ outsidetemp.toDouble().round(1)} °C </div>"     
	tile += "<div style=\"font-size:0.8em;line-height:20px;\">Pressure ${totalp.toDouble().round(1)} Kpa </div>" 
	tile += "<div style=\"font-size:0.8em;line-height:20px;\">Rho ${Rho.toDouble().round(4)} kg/m3 </div>" 
	tile += "<div style=\"font-size:0.8em;line-height:20px;\">ABS Humidity ${ABShumid.toDouble().round(1)} kg/m3 </div>"     
	tile += "</div>"
	
	//sendEvent(getEventMap("DeviceTile", "$tile", false))
	sendEvent(name: "DeviceTile", value: "$tile");
	
	 def now = new Date()

	sendEvent(name: "lastCheckin", value: now.format("YYYY-MM-dd-HH:mm:ss"))
}


private parseTest(val) {

	return [
		name: 'illuminance',
		value: val,
		unit: '?',
		isStateChange: true,
		descriptionText: "Value is ${val} ?"
	]
}

1 Like

I'm getting this error and these warning any time I access a child of the Average All app. This particular group is for humidity, but I get the same thing with lux. I'm not sure what it means by "you are not using the correct virtual device." I'm using the virtual device that the app created and it has the device type "average all device."

Would it be possible to have the driver check for the last report from a device and give us the option to leave it out of the average? I keep running into hung devices, and dead batteries that throw the averages off big time. Causes major problems when I'm automating things like windows and air conditioners. Otherwise this is working great, thanks!

I am stuck with real life atm and don't have any spare time to develop so it might be a while before I get to this
In the meantime...
Why not try 'Device Guardian' as this will let you know when stuff doesn't report in for a while

Andy

1 Like

Yeah I do have some solutions in place for that, but until I manually modify the A.A. app/device to remove the affected sensor, it throws everything off.

This is a major problem for Aeon MultiSensor 6, since the batteries only last 2-4 months, (ugh.) Anyways, just food for thought. Thanks!

Seeing the same in my logs. Can't figure it out.

Hi, I am trying to install this App but I am having a hard time, where do I go to get the code? when I click on the like under updated 12/05/2020 I get the error message "This Site can't be reached" is there another site or can I search for it on Github?

You need to go to cobras website to get it and register. It free, it's just it's away of protecting his code.

Ok thanks :slight_smile: do you have the link to his website?

Its on his bio

https://cobra-apps.co.uk/

Although it seems to be down?

What are you trying to average, I have one for lux

I'm trying to average temperature. Basically I want to place several temp sensors in different parts of my house and when when the average temp is above a certain temp it lowers the AC and when it's below a certain temp it increases the heat

You could try

https://raw.githubusercontent.com/Gassgs/Hubitat-Apps-and-Drivers/master/Apps/Multi%20Sensor%20Plus/Multi%20Sensor%20Plus%20Parent%20app.groovy

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.