I added a new node(ralay id:50), again home assistant(HA) was not added. How can I send a new value from the Relay?
You need to send a message at least once for it to appear in Home Assistant. Use something like this:
bool initialMessageSent = false;
void loop() {
if (!initialMessageSent) {
send(msgRelay.set(currentRelayState));
initialMessageSent = true;
}
}
After you manually injected a message via MYSController, Home Assistant started to list the new entity in the UI. So yes, that's exactly what Home Assistant required. If you take care of that within the sketch as shown above, you don't need to do it manually.
But It seems to be disconnected from the network every time a command comes from HA.
do you think this is normal?
No, I wouldn't consider that normal. What do you mean by "disconnected"? Does the node stop working completely after receiving a message from HA? Doesn't it respond to consecutive commands?
Does the debug output (using #define MY_DEBUG in the relay node sketch) hint at something? Sharing your sketch may help us find the issue.