Have a look at node-red-contrib-bool-gate. There you can configure the AND gate of all three inputs. Make sure the three inputs have different topics so they can be identified in the gate. That will give you a true or false output which may be able to feed direct to the lights, or you may have to convert the true/false to on/off or whatever which you can do in a Change node.
Thanks. It seems that this node is what i need.
But i still have a problem to make it work.
This simple example of "ANDing" twice a value that is TRUE at this moment, should return TRUE and shoud turn the ligt on. But it is not.
What am I doing wrong?
What isn't working? Is it the value coming out of the AND node or the value is correct but it doesn't turn the light on?
If it is the value that is coming out of the node that is wrong then add a debug node showing the two messages that are going into the AND node and show us what you see. Did you see my previous comment: Make sure the three inputs have different topics so they can be identified in the gate?
What do you mean it shows null? Do you mean it sends a message containing a payload of null?
Show us what you see in the debug nodes for the data going in and the data coming out.
You haven't shown the debug for the failing state with one true and one false. I want to see it in the debug output. You don't need to show the flow again, just the debug outputs.
Well if you aren't getting a false output from the Sleeping and At Home nodes then obviously the gate won't know what to do. I don't know those blue nodes at all, are they supposed to send out true and false? Perhaps false comes on the other output. Have a look at the docs for that node.