Giter Club home page Giter Club logo

Comments (6)

flyte avatar flyte commented on May 27, 2024

Just so I'm clear, do you mean to turn the output on for x milliseconds and then return to its previous state? If so, I think the implementation might be best done with a publish to .../set_ms or similar, instead of .../set. Would that suit you?

from mqtt-io.

meifi avatar meifi commented on May 27, 2024

hi flyte,

yes it woud be perfect if we can publish to /set to set the output ON oder OFF until the next publish and when publish to /toggle the output set for x MS to ON and reset to the previous state . so we can set the MS for the toggle in the config file. It is also posible to publish the MS value to /toggle_ms as payload.

what do you think is easier to implementate?

from mqtt-io.

flyte avatar flyte commented on May 27, 2024

I think perhaps /set_on_ms and /set_off_ms might be simpler for digital outputs. This way there's only a single value required in the payload.

What do you think about which value they should end up as? If the output is ON already, then we /set_on_ms with 1000 as the payload, should the output turn OFF after 1 second, or stay ON, as it was already?

from mqtt-io.

meifi avatar meifi commented on May 27, 2024

I think it must be the last value. the reason is, that some modules has a invertet logic.

If the output is ON already, then we /set_on_ms with 1000 as payload, the output change for 1000ms to OFF and return to the last value - ON.

Or we set a default / fallback value for the output in the config file ...

from mqtt-io.

flyte avatar flyte commented on May 27, 2024

Reopening as a reminder to update the readme with instructions on using the new feature.

from mqtt-io.

flyte avatar flyte commented on May 27, 2024

@meifi I've added an inverted config value for digital outputs which avoids the problem with explicit 'on' and 'off' topic suffixes (See #18) and changed the behaviour of the /set_on_ms and /set_off_ms topics to always end up in the opposite state.

So for example, a light is ON, you publish to /set_on_ms and after the timeout, the light turns OFF.

If the light is OFF to begin with, the light will turn ON immediately, then turn OFF after the timeout.

Make sense? Please comment/reopen the ticket if not.

from mqtt-io.

Related Issues (20)

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.