Variable Math question

I'm trying to average the sensor values in an RM4 action. Lacking an average function, I thought I would simply add the three values and divide by 3. But it looks to me that this is pretty complicated. Is this the most efficient way: ?

Set varA to Sensor1
Set varB to Sensor2
Set varC to Sensor3
Set varA to varA + varB
Set varA to varA + varC
Set varA to varA / 3

Yes. It is primitive. It's not a programming language.

1 Like

I thought BTWorld or Cobra had an averaging application. You might look.

1 Like

Has there been any thought of bringing more complicated math operations to Rule 4? Especially with the upcoming improvement to GV's (on dashboard)?


Cool, this is the first I had heard of the Cobra site, here is his averaging app:

It is great Cobra provides some utils I can immediately use. I am a bit unclear if Cobra is affiliated with Hubitat due to the domain name choice of and the use of apparently identical css.

If Cobra is part of Hubitat, these design choices may be wonderful. If Cobra is not part of Hubitat, these choices may be a bit of a raw nerve for the Hubitat crew who may be reluctant to say anything because having an active contributor is a great thing. But trademark infringement sort of sucks when it is your trademarks that are getting diluted. So as a newbie with no history here, I'll risk bringing it up because I don't know any better.

I am no longer connected to Hubitat and the website is not affiliated to Hubitat at all (as a large disclaimer on the first page of the website states)
I will say, that before creating and during the creation process of my website I obtained permission to use the existing style etc directly from Bruce and the guys.
They were both aware of, and agreed to, the design before it went live.

The website was created and is maintained by Roy (@Royski) and I am always very greatful for all the work he has put into it.

Should Bruce (@bravenel) ever ask me to desist and change the website design then I would do so without question or argument. I’m sure that he is aware of this.

The domain name is registered to me personally, but I have others I could easily use should this be a problem for Hubitat.

I’m also aware that the website really needs a few updates @Royski :slight_smile: :crazy_face:



Oh the joy !! :wink:

1 Like

I'd also like a Variable Average function.