Search code examples
mqttnode-red

Disable an mqtt inject node using an UI switch NODE RED


Sorry for my english and my maybe bad question but i'm new to this. For a project I'm trying to disable a mqtt inject by using a switch in my node-red dashboard.

The problem i'm getting is if i try to filter the data out with a function the data from the mqtt in does not come through anymore.

This is what i used to work with and this worked.

I want this switch to disable the motion sensor

It does not really matter how it is disabled but i need to be able to do it from the UI. Can anyone help me it would be greatly appreciated.


Solution

  • I got it working using a context variable on the UI switch node and then using a switch that filters on the context variable. working flow