What is the ruling on speaking with a devil, animal, stone, or a person who might be present? What I mean with the first is, if a man wants to pray and says loadly or silently in his heart, "I will pray and you (satan) will not prevent me from it." What I mean with the second is saying to an animal, "O such-and-such, you are so cute," or calling the animal with a name so that the animal comes close to you, while the animal is ignorant about this name. What I mean with the third is saying to a stone, "You make Tasbeeh (saying ‘Sobhaan Allaah’ [glory to Allaah]) and so do I." What I mean with the fourth is, for example, if I want to lock a room and I am not sure if someone is there, is it permitted to say, "Is someone there, I am going to lock the room," or to say, "If someone is there, he should say something because I am going to lock the room."
All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ‘alayhi wa sallam, is His slave and Messenger.
It is not forbidden to do what is mentioned in the question if it is done in an acceptable manner. Prophet Ibraaheem (Abraham), may Allah exalt his mention, addressed the false idols of his disbelieving people as related in the verses: {Then, he turned to their gods and said: Do you not eat? What is (wrong) with you that you do not speak?} [Quran 37: 91-92]
The Prophet, sallallahu ‘alayhi wa sallam, addressed Satan, saying, "I seek refuge with Allah from you; I curse you with the curse of Allah." [Al-Bukhari]
There is also no harm in addressing an animal in the way mentioned or a person who may be present in a place.
Allah knows best.
You can search for fatwa through many choices