GithubHelp home page GithubHelp logo

Comments (4)

drmibell avatar drmibell commented on June 19, 2024

at the moment we can only use msg.topic

I assume you mean that only msg.topic can be used to control the open or closed state of the gate. That is true, but I do not see it as a problem, since control messages (msg.topic = Control Topic) do not pass through the gate in any case, and this would be true even if topic were replaced by some other message property. Your flow will always have to generate control messages separately from the main stream of messages being controlled.

If I have missed your point, and you can post a flow that would benefit from using a different property for gate control, I will be happy to take a look.

from node-red-contrib-simple-gate.

GravityRZ avatar GravityRZ commented on June 19, 2024

ah clear. in my case i use msg.topic to hold the id's of lights which are used to control lights with google. i could replace my complete flow to use something else like msg.id but it still has to pass the gate and i believe you stated that this is not the case.

for now i solved the issue by the use of a flow variable which i use as a variable to block/pass things.

it would be nice if the gate could use a user defined msg but still the complete msg needs to pass the gate and not only the payload

from node-red-contrib-simple-gate.

drmibell avatar drmibell commented on June 19, 2024

i use msg.topic to hold the id's of lights

That's fine. The gate node will pass those messages when it is open and block them when it is closed. No problem there and no need to change topic to some other property.

i solved the issue by the use of a flow variable which i use as a variable to block/pass things

Lots of people used this method before I wrote the gate node, and some still do. The only issue is that if you need many independent gates, then each needs its own flow variable. You have to do the bookkeeping and remember where the variable is set for each gate.

the complete msg needs to pass the gate and not only the payload

When the gate is open it passes the complete message object with all its properties entirely unchanged. The only exception is when msg.topic = Control Topic. Then it tries to interpret msg.payload as a command that it can execute, and it sends no output. I'm not sure how you got the idea that only the payload is passed.

It might help if you could post a simple flow that does not behave the way that you would like and describe what you would like it to do.

from node-red-contrib-simple-gate.

GravityRZ avatar GravityRZ commented on June 19, 2024

ok . i thought you mentioned that nothing passed so if everything passes when the gate is open it is ok.

at the moment i changed my complete flow and do not need the gate anymore

from node-red-contrib-simple-gate.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.