user5805: 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?

user43: It is very clear to me that Maras, Devas and other supernatural beings are real phenomena that you can observe directly, if you know where to look. When ancients spoke of souls, spirits, demons etc. they were not crazy. They just did not mean it in the naive sense we think they meant it.

user5779: According to the Suttas, the Buddha frequently interacted with Devā and Māra. In the Saṃyutta Nikāya, Chapter 1 is "Discourses with  Devatās", Chapter 2 is "Discourses with Young Devas" and Chapter 4 is "Discourses with Māra".
In general, the Devā and Māra would come and visit the Buddha and the monastics; the Devā to ask the Buddha questions, Māra to try and disrupt spiritual progress (especially when appearing to monks / nuns). On rare occasions, the Buddha would use his psychic power to visit the Deva realms. The implications from the Suttas is that the Buddha was able to view all the planes of existence, either by reviewing his past existences or using his psychic powers.
The "31 planes of existence" is a later Theravāda summary of the realms. Other traditions have different numbers of realms. Nowhere in the Suttas does it explicitly state 31 realms, though most of the realms are mentioned in various Suttas.
Here is an interesting quote from the Conclusion (page 70) of "The Ethico-psychological Basis of the Concept of Gods in Early Buddhist Literature" by Ven. Dr. Hindagala Gnanadhara Thera:

In ancient India, people were inclined to seek refuge in divine beings as they were frightened by the forces of nature. This had become the nature of the majority of the people. In view of this fact, some suggest that it is psychological, but there is no basis for that presumption. They are naturally subjected to diverse rites and rituals, because they are haunted by natural disasters such as epidemics and other inauspicious forces. They beseech gods for help. Such rites and rituals are observed, not only by the illiterate people, but also the educated ones. It is quite clear from the above examples that man is degraded mentally. The weak people seek refuge in the mighty ones. Such things cannot be averted as long as this process of thinking is not reversed.
Although Buddhism is a non-theistic religion, it does not deny the existence of gods, as non-human beings who are subject to all weaknesses as other human beings are. At the same time, it does not believe in a creator god. Nevertheless, it accepts the existence of various invisible powers such as yakkha, pisāca, etc. These invisible powers are not capable of helping men to get to the highest bliss Nibbāna, or salvation. It cannot be denied that these invisible forces for mankind for a short while as they are transient. A person who is cultured and ethically elevated does not need such help or assistance from any divine forces, visible or invisible.

In other words, belief in supernatural beings is not required to be a Buddhist; they play no role in the Theravāda doctrine.
My personal opinion is that Buddhism “imported” gods from the popular Vedic culture (and sometimes changed their personalities). I see the Devā and Māra as a literary device, like the Jātakas, not to be taken literally. Great for story-telling, but not at all central to Buddhist beliefs (Jātakas have talking animals... they are the ancient Indian equivalent to cartoons and Sesame Street).

user5777: First, it might help to probe the meaning of "supernatural" 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 "supernatural" 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 "31 planes of existence" 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.

user2265: 
Did the Buddha have any personal experience with maras and devas and
  supernatural beings in general?

Yes, throughout the suttas and many of the Mahayana sutras, like the Lotus Sutra, it is mentioned the various respledent powers that Gautama Buddha shows but also noteworthy is Buddha's personal attendant Ananda who is able to memorize everything the Buddha says but isn't able to get into the assembly of monks meeting after Buddha's death because he does not have samadhi.
Only when Ananda is able to attain samadhi (an actual achievement rather than just memorization) is he able to use super powers and join the assembly in discussion of Buddhism's fate.

And, if I'm not mistaken, the 31 planes of existence is something he
  taught. So, how did he come to know of them?

He viewed them directly when he entered samadhi, visiting each realm in turn.
This is a scientific experiment because it is something that we ourselves can do, as well, after we achieve state of concentration (samadhi). Little is left to blind belief in Buddhism.
The state of samadhi is also useful in investigating the other dharmas in Buddhism, such as the various mind objects and maras.

5805: <p>Did the Buddha have any personal experience with maras and devas and supernatural beings in general? </p>

<p>And, if I'm not mistaken, the <a href="http://www.accesstoinsight.org/ptf/dhamma/sagga/loka.html">31 planes of existence</a> is something he taught. So, how did he come to know of them?</p>
 43: <p>It is very clear to me that Maras, Devas and other supernatural beings are real phenomena that you can observe directly, if you know where to look. When ancients spoke of souls, spirits, demons etc. they were not crazy. They just did not mean it in the naive sense we think they meant it.</p>
 5779: <p>According to the Suttas, the Buddha frequently interacted with Devā and Māra. In the Saṃyutta Nikāya, Chapter 1 is &quot;Discourses with  Devatās&quot;, Chapter 2 is &quot;Discourses with Young Devas&quot; and Chapter 4 is &quot;Discourses with Māra&quot;.</p>
<p>In general, the Devā and Māra would come and visit the Buddha and the monastics; the Devā to ask the Buddha questions, Māra to try and disrupt spiritual progress (especially when appearing to monks / nuns). On rare occasions, the Buddha would use his psychic power to visit the Deva realms. The implications from the Suttas is that the Buddha was able to view all the planes of existence, either by reviewing his past existences or using his psychic powers.</p>
<p>The &quot;31 planes of existence&quot; is a later Theravāda summary of the realms. Other traditions have different numbers of realms. Nowhere in the Suttas does it explicitly state 31 realms, though most of the realms are mentioned in various Suttas.</p>
<p>Here is an interesting quote from the Conclusion (page 70) of &quot;The Ethico-psychological Basis of the Concept of Gods in Early Buddhist Literature&quot; by Ven. Dr. Hindagala Gnanadhara Thera:</p>
<blockquote>
<p>In ancient India, people were inclined to seek refuge in divine beings as they were frightened by the forces of nature. This had become the nature of the majority of the people. In view of this fact, some suggest that it is psychological, but there is no basis for that presumption. They are naturally subjected to diverse rites and rituals, because they are haunted by natural disasters such as epidemics and other inauspicious forces. They beseech gods for help. Such rites and rituals are observed, not only by the illiterate people, but also the educated ones. It is quite clear from the above examples that man is degraded mentally. The weak people seek refuge in the mighty ones. Such things cannot be averted as long as this process of thinking is not reversed.</p>
<p>Although Buddhism is a non-theistic religion, it does not deny the existence of gods, as non-human beings who are subject to all weaknesses as other human beings are. At the same time, it does not believe in a creator god. Nevertheless, it accepts the existence of various invisible powers such as yakkha, pisāca, etc. These invisible powers are not capable of helping men to get to the highest bliss Nibbāna, or salvation. It cannot be denied that these invisible forces for mankind for a short while as they are transient. A person who is cultured and ethically elevated does not need such help or assistance from any divine forces, visible or invisible.</p>
</blockquote>
<p>In other words, belief in supernatural beings is not required to be a Buddhist; they play no role in the Theravāda doctrine.</p>
<p>My personal opinion is that Buddhism “imported” gods from the popular Vedic culture (and sometimes changed their personalities). I see the Devā and Māra as a literary device, like the Jātakas, not to be taken literally. Great for story-telling, but not at all central to Buddhist beliefs (Jātakas have talking animals... they are the ancient Indian equivalent to cartoons and Sesame Street).</p>
 5777: <p>First, it might help to probe the meaning of &quot;supernatural&quot; in the Buddhist context.  I think this <a href="https://sujato.wordpress.com/2010/03/11/buddhism-the-supernatural/" rel="nofollow noreferrer">blog post</a> covers it pretty well. In particular:</p>
<blockquote>
<p>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.</p>
<p>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.</p>
<p>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.</p>
</blockquote>
<p>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 <a href="http://www.berzinarchives.com/web/en/archives/sutra/level2_lamrim/initial_scope/safe_direction/qualities_buddha_omniscient_deep_aw.html" rel="nofollow noreferrer">here</a>, that knowledge includes:</p>
<blockquote>
<p>(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.</p>
<p>(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.</p>
<p>(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.</p>
</blockquote>
<p>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.</p>
 2265: <blockquote>
  <p>Did the Buddha have any personal experience with maras and devas and
  supernatural beings in general?</p>
</blockquote>

<p>Yes, throughout the suttas and many of the Mahayana sutras, like the Lotus Sutra, it is mentioned the various respledent powers that Gautama Buddha shows but also noteworthy is Buddha's personal attendant Ananda who is able to memorize everything the Buddha says but isn't able to get into the assembly of monks meeting after Buddha's death because he does not have samadhi.</p>

<p>Only when Ananda is able to attain samadhi (an actual achievement rather than just memorization) is he able to use super powers and join the assembly in discussion of Buddhism's fate.</p>

<blockquote>
  <p>And, if I'm not mistaken, the 31 planes of existence is something he
  taught. So, how did he come to know of them?</p>
</blockquote>

<p>He viewed them directly when he entered samadhi, visiting each realm in turn.
This is a scientific experiment because it is something that we ourselves can do, as well, after we achieve state of concentration (samadhi). Little is left to blind belief in Buddhism.
The state of samadhi is also useful in investigating the other dharmas in Buddhism, such as the various mind objects and maras.</p>
