And logic is not working

Hi I'm using blynk write node where when i press button it changes from 0 to 1 vice versa

and also the other inject node which is in 1 but the and logic is not giving me true value when both are 1.

blynk property is :-

and inject node property is :-

and and logic is :-

What module is the and gate node from? How is it configured?

You can see it here

It is generally better to provide the full name of any non default nodes you are asking for help with.

How have you configured the node?

1 Like

I forgot to add the and logic picture here it is,

I note you have left the input topic blank in the first rule. I've not used the And Gate node before, but would be something I'd double check. If the message from the blynk node doesn't have a topic property, then add a Change node to set one.

yes , I know that the blynk node doesn't give the topic name so that I'm confused what to put on change node?

Use a change node to set msg.topic to whatever-you-want so that when the message arrives at the And node it will have the property set. You can then complete the configuration of the And node.

1 Like

Thanks you so much !! Done!

hey after some time it has hack it is not working as AND gate should.

here it is shows false in status but the msg.payload gives : 1 and it is switching the output

I only gave one input and it turn on the output.

Put a debug on the output of the And gate. What does it show in the situation you describe?
When you say 'you only gave one input' do you mean you did a node-red restart and then provided only one input?

Yes I also put the debug after AND gate and it also shows "1" but the gate status is FALSE.

which is conflicting.

anyways I change the node to `


and it is working.

anyways we can solve this issue if i am wrong .

I see that you have checked the box that tells it only to send a message when the output is true, so it should never send 0. Is it possible you are seeing in the debug node the output from from the last message. Perhaps you did not mean to check that box.

I have not updated the image that send above after trail and error i unchecked it. also for the debug its screenshot i have not put here.
but the thing is that only giving one true didn't meant that AND gate should turn true.

Which i think is bug, i also check my second input debug it shows "0"

and certainly as we see that the AND gate status which shows FALSE but gives True.

Connect a debug node showing the input to the And gate and another showing the output. Then get it to go wrong and post the debug output here and a screenshot showing the AND gate with the wrong status. Give the debug nodes names so it is easier to interpret.

Also when you say "only giving one true didn't meant that AND gate should turn true" did you restart node-red before doing that? Otherwise it will still remember the last value of the other input, even if it is from two hours ago.