Mishkat al-Masabih 1036
وَعَنِ ابْنِ عَبَّاسٍ رَضِيَ اللَّهُ عَنْهُمَا قَالَ: جَاءَ رَجُلٌ إِلَى رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَقَالَ: يَا رَسُولَ اللَّهِ رَأَيْتُنِي اللَّيْلَةَ وَأَنَا نَائِمٌ كَأَنِّي أُصَلِّي خَلْفَ شَجَرَةٍ فَسَجَدْتُ فَسَجَدَتِ الشَّجَرَةُ لِسُجُودِي فَسَمِعْتُهَا تَقُولُ: اللَّهُمَّ اكْتُبْ لِي بِهَا عِنْدَكَ أَجْرًا وَضَعْ عَنِّي بِهَا وِزْرًا وَاجْعَلْهَا لِي عِنْدَكَ ذُخْرًا وَتَقَبَّلْهَا مِنِّي كَمَا تَقَبَّلْتَهَا مِنْ عَبْدِكَ دَاوُدَ. قَالَ ابْنُ عَبَّاسٍ: فَقَرَأَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ سَجْدَةً ثُمَّ سَجَدَ فَسَمِعْتُهُ وَهُوَ يَقُولُ مِثْلَ مَا أَخْبَرَهُ الرَّجُلُ عَنْ قَوْلِ الشَّجَرَةِ. رَوَاهُ التِّرْمِذِيُّ وَابْنُ مَاجَهْ إِلَّا أَنَّهُ لَمْ يَذْكُرْ وَتَقَبَّلْهَا مِنِّي كَمَا تَقَبَّلْتَهَا مِنْ عَبْدِكَ دَاوُدَ. وَقَالَ التِّرْمِذِيُّ: هَذَا حَدِيثٌ غَرِيبٌ
From Ibn ʿAbbas, may Allah be pleased with them both, who said: A man came to the Messenger of Allah ﷺ and said: "O Messenger of Allah, I saw myself last night while I was asleep, as if I were praying behind a tree. I prostrated, and the tree prostrated with my prostration, and I heard it say: 'O Allah, write for me a reward with You because of it, remove from me a burden because of it, make it a treasure for me with You, and accept it from me as You accepted it from Your servant Dawud.'" Ibn ʿAbbas said: Then the Prophet ﷺ recited [a verse of] prostration and prostrated, and I heard him saying the like of what the man had told him of the tree's words. Reported by at-Tirmidhi and Ibn Majah, except that he did not mention "and accept it from me as You accepted it from Your servant Dawud." At-Tirmidhi said: This is a gharib hadith.