Map from Google - Perth

In Perth, city located in south-western Australia, the climate is mediterranean, with mild, rainy winters and warm, sunny summers. Being in the Southern Hemisphere, it has reversed seasons compared to Europe or North America.
Here are the average temperatures.
Average temperatures - Perth
PerthJanFebMarAprMayJunJulAugSepOctNovDec
PerthJFMAMJJASOND
Min (°C)16171512108778101214
Max (°C)313129252118171820222528
Min (°F)616359545046454546505457
Max (°F)888884777064636468727782

Rainfall amounts to about 880 millimetres (34.6 inches) per year, the bulk of which occurs from May to September. Here is the average precipitation.
Average precipitation - Perth
PerthJanFebMarAprMayJunJulAugSepOctNovDecYear
PerthJFMAMJJASONDY
Prec. (mm)810204513018017014585552013881
Prec. (in)0.30.40.81.85.17.16.75.73.32.20.80.534.7
Days2246101214141295393

Winter, from June to August, is very mild, given that the average of the coldest months, July and August, is about 12/12.5 °C (53.5/54.5 °F). The rains, however, are frequent and abundant, given that the flow of western disturbances in this season moves to the north and affects southern Australia. When warm winds blow from the north, the temperature can exceed 20 °C (68 °F) even in winter, while at other times a bit of cold air of Antarctic origin can arrive here and lower the night temperature almost to freezing (0 °C or 32 °F); outside the town, at some distance from the sea, even slight frosts may occur; during the day, however, the temperature remains fairly mild even in these cases.

Spring goes from September to November, and is usually mild and a bit unstable in September and October, with some chance of rain and wind, but over the weeks the rains gradually become more rare, so that November is already a pleasant month, and with little rain.

Summer, from December to March, is warm and sunny, with quite cool nights. The rains are rare, although occasionally some thunderstorms may occur, while there's no shortage of wind, which regularly blows from the ocean, as intense afternoon breeze, called "Fremantle Doctor". This wind drives away the heat and makes the temperature generally acceptable, therefore is welcomed despite its strength, in fact when it doesn't blow, it's replaced, fortunately for short periods, by the torrid wind from the north-east, which comes from the desert: in these cases the heat can become really intense, with highs above 40 °C (104 °F). This can sometimes happen also in November, while in October and April the temperature can touch 35/37 °C (95/99 °F).

In autumn, in April and May, the temperatures are pleasant. In May, however, the rains become quite abundant, and sometimes, especially in the second half of the month, it can get quite cold.

The amount of sunshine in Perth is very good in spring and summer, from October to May, when clear skies prevail, while in winter it is decent, since periods of bad weather alternate with sunny periods.

Perth

For swimming, the ocean temperature is never warm, even though it becomes acceptable from January to May, when it reaches 22/23 °C (72/73 °F). On sunny summer days, the afternoon breeze can be so intense as to make the sea rough, especially in December and January.
Here are the average sea temperatures.
Sea temperature - Perth
PerthJanFebMarAprMayJunJulAugSepOctNovDec
PerthJFMAMJJASOND
Sea (°C)222223232221201919192021
Sea (°F)727273737270686666666870

When to go

The best times to visit Perth are spring and autumn, and in particular in April-May and September-October, to avoid the winter rains and the scorching heat waves that can occur in summer. It must be said that even the intermediate seasons are quite rainy (although April is a bit less rainy, therefore it's preferable), and sometimes it can get cold at night. If it were not for the heat waves, which do not necessarily occur in a given period but are still a risk, you could very well enjoy the summer weather, which generally is warm but not too much, and sunny. In winter, August is already sunnier and a bit less rainy than June and July.