Is there a way to show the higher of two sensors via virtual one?

We have two outdoor temp sensors in our garden and would like a way to show the higher reading of the two on a dashboard, is this possible?

As the sun moves around our garden during the day I would like to know the "real" outdoor temperature so we know what to dress our little one in if we are off out in the sun...

I might be way off, since I’ve never even seen your garden :slightly_smiling_face:. But I’m not sure it makes the most sense to consider the sensor that’s currently in a sunny area to be the “real” outdoor temperature, for the purposes of planning how warmly to dress.

Have you considered weather forecast attributes such as “feels like” or “heat index?”

Its more so we know how hot it really is in the sun. Obviously temp readings are in the shade and doing some tests the feels like it way lower than the reading the sensors give.
It's not just for knowing how to dress, more for my curiousity of how hot it is in the sun. Its a stupid request I know but something I'd like to do if possible

I think what I mean is, the temp sensor and a human will probably experience the “heat” in the sun differently, although yes the sensor will read higher and a human will feel hotter than in the shade.

But regardless, yes I think what you’d want to do is create a rule in rule machine that triggers with temp changes on either sensor, store the higher temp in a variable, and display that variable value on a dashboard.

That’s a 10,000 foot view of it at least, I’m certainly not the best at describing RM rule creation in great detail, but it should definitely be possible.

I understand your point, and I know this as it won't factor in wind or other external factors.

Like I say it's more for my curiosity than anything else.

I hadn't considered variable so thanks for the suggestion

1 Like

What I don’t know in detail is how to get rule machine to compare two sensor values and store the higher one as a variable.

Smarter folks than me probably do though :slightly_smiling_face:.

1 Like

Not smarter, just more experienced with Rule Machine.

Edit: it helps if you test these things first.
Edit2: optimization: variable can be Local Variable because temp has to be exported through Virtual Temperature Sensor in order to display on Dashboard.

Here you go.

Create a Virtual Temperature Sensor device.

Then make this Rule, with a Local Variable, maxTemp, type Decimal, in order to do assignments.

Put Max Temp in a Tile on your Dashboard.

2 Likes

Perfect! I'll have a play this evening

1 Like

Is the final action in your rule a custom action?

What parameter do you use, or am I looking at the wrong thing?

Does that make it clear? Yes, the last Action in the rule is the key to getting the result onto the Dashboard.

1 Like

All working now, thank you for your help

1 Like

Obviously, because you now see how to pull the sensors into a Rule and assign their values to a Variable for manipulation, and then how to export the result to your Dashboard, you could modify the rule to, for example, average the values, etc.

Good luck. Glad it worked.

Already thinking along these lines for rooms with multiple sensors in. Glad I asked for help now as I've learned something new

1 Like

You might be interested in this thread with code from Bruce Ravenel on averaging temperature sensors.

There's also an app that gives the min and max sensor reading.

1 Like

Download the Hubitat app