Supernatural beings and the 31 planes of existence Did the Buddha have any personal experience with maras and devas and supernatural beings in general? 

And, if I'm not mistaken, the 31 planes of existence is something he taught. So, how did he come to know of them?
First, it might help to probe the meaning of &quot;supernatural&quot; in the Buddhist context.  I think this blog post covers it pretty well. In particular:

The very notion of ‘Supernatural’ is one that, it seems to me, arises from Western philosophical assumptions. the basic idea is that there is ‘this world’, which is rational and subject to explanation according to the laws of physics, and the ‘other world’, which operates according to a quite different set of principles, and where the laws of physics no longer apply.
In Buddhism, however, the essential description of the world is not provided by the laws of physics, or other material phenomena. The most important ‘laws’ are the three characteristics – impermanence, suffering, not-self. And these describe any other state of being just as well as they describe ours. For theistic religions, ‘heaven’ is eternal – that is, not subject to conditions, and independent from Time. But for Buddhists, heaven is just as temporary as anything else.
The Sri Lankan philosopher David Kalupahana has developed this idea in detail. he argues that Buddhism is empirical through and through; that even those aspects of Buddhist belief that seem to invoke the ‘supernatural’ in fact merely involve a refining and extension of ordinary sensory capacities.

Starting from that perspective, I would say: yes, in every tradition of Buddhism I'm aware of it is agreed that Buddha knew the beings we refer to as &quot;supernatural&quot; in our culture - which, from a Buddhist perspective, are  just other varieties of sentient beings. Because Buddha is omniscient, he has the same comprehensive knowledge of these beings as of any other sentient being. As summarized here, that knowledge includes:

(3) The force of being omnisciently aware of the various spiritual aspirations (mos-pa) of all limited beings (sentient beings): the inferior ones for this life, the middling ones for liberation, the superior ones for enlightenment, and those that are concealed (unconscious or expressed unclearly). In this way, he can guide each being accordingly.
(4) The force of being omnisciently aware of the source of everyone’s cognitions, as well as the source of their enlightenment (khams, their Buddha family-traits, Buddha-natures). He knows where all their thoughts, ideas, and misunderstandings have come from and also those factors in each of them that will lead to their realization of their fullest potential. In this way, he can correct all others when they have gone astray and draw out their strongest points.
(5) The force of being omnisciently aware of the superior and less-than-superior levels of everyone’s powers (dbang-po). Thus, he always teaches others in accordance with their intelligence and abilities so that they never become discouraged.

Sorry, but I am not familiar with the &quot;31 planes of existence&quot; so hopefully someone else can speak to that specifically. But the bottom line to me is that if Buddha knows all beings, he knows their various abodes as well however they are categorized.