Hi and welcome to the forum.
What you are asking is not too difficult and can be fully automated. But let's not get too far ahead of ourselves.
I'm not fully understanding what you mean, but I'll try.
First you need to know what commands the fan accepts and what messages it sends back and how to read them.
Looking at your drawing, you send a
MQTT message and it replies via
Then you look at the reply and depending on that send a command to turn the fan on/off.
(Or something like that - yes?)
function node (
2) may not be needed. You may be able to construct the message in the
inject node. But not a problem.
3 you receive the
MQTT reply. You will need a
function node (or other) there to determine what to do next.
Then you construct a message to send via the
http out node to tell the fan to turn on/off.
Before we can go much further you are going to have to share what you see coming back in step
3, and list what determines the next action.
And lastly you need to know the command to send.
For now you could just establish that you can control the fan by turning it on/off by getting an
inject node and constructing a message in it and connecting it to a
http out node, configuring it as needed, and sending a message.
You can then put a second
inject node so one turns the fan on and the other turns it off.
That may be a better way of doing it then you have established a working platform into which you can then build backwards to be controlled by other things.
I'll leave it there for now.
Best of luck and hope to hear back soon with the things needed to be known that I mentioned.