Msg.topic previously set still appearing

The msg.topic seems to be stored in the node but what of you don't want this? But only pushing the topic received by a earlier node in the flow?

When using for example a switch with topic = msg.topic, the topic set before, is still present. If started with the switch, no topic should be mentionned.

Is there a way, besides using for example a newTopic in the payload?

Many thanks

Why are you worried about what the topic is? If you are using the topic then you need to set it to whatever it needs to be, if you are not using it then usually it will not matter.

If you really need to remove it then the Change node has a Delete option (click the Set dropdown).

Topic is crucial for the behaviour of some home automation. For example when the topic is 'all_lights_out' then for example the fan speed should not be changed. But if topic is for example "shower" then fan speed etc should be high. Reset can not be done otherwise I do not know the trigger. Thus an old msg.topic should not be passed if no nodes are setting that topic.
Change or delete is not a solution.

Try setting your switches like this if you want a different/no topic when switch is pressed


when the switch is set by incoming it passes the topic old and when you set the switch from the dashboard it passes new

Good idea, but because the value isn't passed anymore the output of the switch isn't triggered anymore. and when enabling the flag pass msg, we are getting an endless loop.

Ok if you link indeed the output of the msg.topic node, but the switch node doesn't show the correct status

When pressing the True inject, the switch stays OFF. I has to be ON.

Not if set up as in my example, again i ask for you to show a example of your flow that is not working.

Yes you' re right it works in your example, I've done something wrong when implementing this in my flow. Many thanks for the solution

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.