Giter Site home page Giter Site logo

Comments (3)

alex6o avatar alex6o commented on June 2, 2024

Hi! you can checkout the following sample flow https://github.com/alex6o/node-red-contrib-dynamic-dimmer/blob/master/samples/basics/dynamic_dimmer_basics.json which is quite similar!

from node-red-contrib-dynamic-dimmer.

noumenon272 avatar noumenon272 commented on June 2, 2024

thanks, I understand better now.

this node does a lot of what I want it to, but there are a couple of additional features that would make it more useful. I'd like to be able to specify both the start and end points of the dim. Currently it stores the last final value as its starting point. I want to be able to specify for example: "dim from 20 to 0". If I do that twice now, only the first time will do anything.

also, it would be nice if those commands/values were stored in properties (like msg.payload.value, msg.payload.set, etc). this would make it easier to modify those values with other nodes. (nevermind, I figured this out).

ultimately I want to be able to store the current state of a dimmer in a value and then dim up and down from that value. If the value changes outside of node red (by pressing a physical dimmer switch for instance), then I want to be able to start the dim from that point.

maybe thats outside the purview of what you're trying to do, or maybe I'm missing something. dimming seems to be the main place that node red falls flat as a home automation tool.

thanks

from node-red-contrib-dynamic-dimmer.

alex6o avatar alex6o commented on June 2, 2024

One of the main concepts of this node is that it is actually stateful. It is intended to behave similar to a physical dimmer which is directly connected to e.g. a bulb. If you want to change the min and max at "runtime" you can simply send it along with the payload:

{
    "msg": {
        "payload":{
            "target": 0.5,
            "command": "DIM",
            "config": {
                "eventInterval": 600,
                "steps": 10,
                "minValue": 0,
                "maxValue": 75
            }
        }
    }
}

Due to the stateful characteristic of the node it is at the moment not possible to "dim from 20 to 0" twice. In that case you need to send the the SET command before starting another dim operation.

@store the current state: exposing the internal state should not be necessary, because with the physical dimmer you just need to provide the target value (between 0 and 1) and the node will take care of the rest :)

from node-red-contrib-dynamic-dimmer.

Related Issues (11)

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.