you can do this with generators and without the namespace btw
{% set start = (now().replace(hour=0,minute=0,second=0).timestamp() * 1000) | int %}
{% set end = start + 86400000 %}
{{ state_attr('weather.openweathermap', 'forecast') | selectattr('datetime', '>', start) | selectattr('datetime','<=', end) | map(attribute='temperature') | list | max }}
not as easy to read but for learning purposes. Personally, I find generators easy to work with once you get the hang of them.