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

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.