Pulling Maximum Value

I am having the same issue and want to try the automation route. I am still a little new to Home Assistant Can you provide some guidance on how to go about this?