Giter Site home page Giter Site logo

node-red-contrib-timerswitch's Introduction

node-red-contrib-timerswitch

This node was developed as a scheduler for time-sensitive projects like aquariums and terrariums but can be used for almost any project requiring a timer.

Features

  • A very easy and intuitive configuration interface. There are no bells and whistles that may confuse you
  • Allows for precise timing, turning something on/off at an exact time and for any number of seconds, minutes or hours
  • Gives you the ability to turn something on/off many times a day from a single node
  • Can be controlled by sending messages to this node

Configuration

This node has a very easy to understand interface. Just set the ON/OFF times in hours/minutes/seconds and you're good to go. More information about the configuration can be found in the info tab of the node.

Example: turns on at 8am and off at 9am.

Timer

The timer was designed to be accurate. It will come on/off at the exact time specified while other timers can be off by as much as a minute. It also allows you to set a schedule in seconds, something other times generally don't support or only as a work-around. This makes this timer especially suited for time-sensitive projects.

Example: turns on at 8:15 exactly, and turns off 15 seconds later.

Multiple schedules

This timer has the ability to turn something on/off multiple times a day. Examples could be an automated feeder, terrarium misting systems, garden watering systems and other devices that may need to be turned on/off more than once. Simply click the "add" button to add multiple schedules.

Example: turns on 3 times a day for 15 minutes:

FAQ

  • Why not simply use multiple nodes to control one device? Most of the time you can turn something on/off using multiple nodes, but this can cause problems in certain cases. Imagine you have multiple nodes, and you restart Node-Red. While starting up each node will send a message to say they are either on or off. Which one is correct? Is the device on or off? Sometimes there are ways around that, but this node does not have this problem. It will always know if a device needs to be on or off, and more so, it makes sure you don't mistakenly create overlapping or otherwise inaccurate schedules.

  • What do you mean with accurate? This timer was designed to turn on/off at exact times. Other timers often work using intervals where they check your schedule only once a minute or even less. This means when you want something to come on at 08:00am, it may actually not come on until 30 seconds later. This node does not have this problem, it will come on at exactly 08:00:00am. This may or may not be important to you.

  • Can you add feature X? You can always request additional features, but this node was not designed to have a lot of bells and whistles. It does a simple job and does it well without complicating things. If you need dawn/dusk schedules or other features like that other timers can provide this.

Installation


This node can be installed through the Node-Red palette or manually using npm in your node-red folder.

$ npm install node-red-contrib-timerswitch --save

node-red-contrib-timerswitch's People

Contributors

milahti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-red-contrib-timerswitch's Issues

Sending "false" on startup

Hi, and thanks for the great work. I appreciate the valuable functionality!

I'm using the node for lawn and plant watering. I have just one issue: When modifying the node and deploying it, it sends a "false" on output. For some applications, this leads to unwanted behavior.

Would it be possible to send the "false" still but with a specific topic (e.g., "initialize"), so we can distinguish it from other messages?

Thanks!

Ability to be disable on or off schedule

When creating a schedule, we need to specify both an on and off time. It'd be great to be able to specify only one.

In my specific use case, I automatically turn on all my exterior lights at sundown, then I want to turn off only a few lights at exactly midnight.

Show timer GUI in dashboard

@corbosman
Hi, thanks for the great node!
It would be great to be able to configure the timer on/off times in dashboard.
Please add Group/Size properties to show the configuration GUI in dashboard.

Looking good but description is misleading

Hi

Your timer node description states that multiple on-off times in a day is unique to your node. Not true, node-red-contrib-bigtimer can handle 2 on-off times a day and if there was a demand could handle more - so the description in that respect is wrong hence the "issue". It is however nice to see a simple timer out there with multiple times per day.

Regards

Pete

Issue at the daylight savings time change.

I use the timer to get a pulse every hour: i.e.
ON: 00:58:00
OFF: 00:59:00
ON: 01:58:00
OFF: 01:59:00 and so on.

The issue is at the moment of the daylight savings time change: the timer hangup.
( last Sunday of March).: 27 marzo 2022, 2.00.00 clocks were turned forward 1 hour to domenica 27 marzo 2022, 3.00.00 local
Maybe becouse missed a value? (i.e. 02:58:00) ?

Best regards.
m.s.

Feature request

Hi, I know you don't want to add this "a lot of bells and whistles" to this node but here I am requesting a new feature.

I'm looking forward the possibility to add an optional value to each schedule. In my use cases I'm planning to use this optional value as a temperature for a thermostat (I'd like to have at least three different ones) or the percentage to dimmer a light and not just switch them on and off.

Do you think it's a reasonable request? I'm even willing to write a PR for this feature otherwise I'm gonna fork your wonderful work to adapt it to my needs ;)

Let me know what do you think

FR: Full-format output selectors

Hello!
I just discovered your timer module which looks like it'll do the trick nicely, but I've found that the output options don't allow me to set a JSON payload nor a string topic. This is what I need:

image

Another approach would be to have separate outputs for high and low, then I could route them to the separate on and off trigger nodes. I suppose there could be an option inside your module and when 'dual output' is disabled, high and low would both come out of the first output.

Is this something you might be able to implement?

All the best,
Dax.

[Feature Request] Datatype of output message

Hi,
it would be great if you can add a Dropdown to define type of output message. Aktually the output message is always a string. So most of time I have to add a change node for further operations.
For example "on" or "off" would be perfect to have boolean type true or false...

Regrads

Input command to re-evaluate timer

Hi,
i'm using the timer to control some radiators. Currently I'm adding some sliders in homeassistant to set the temperatures for the day and night.
What I would like to accomplish is to let the timer re-evaluate the set time-ranges and output "off" or "on" again (which would set the radiator to the newly set temperature).

I tried to pause & resume it, but the timer does not output anything (probably because it only fires on initialization and on the set times). Am I missing something?

Timer doesn't update if the system time is changed

Hi, thanks for this very useful node!
I faced a bug today: I rebooted my Rpi (that does not have a HW RTC), and the output state was wrong.
By investigating a bit, I found that NodeRed had started before the system time was set by NTP.
I quickly checked the code, and if I understood correctly, the delay until the next event are calculated once. So if the system clock changes, the timer does not get updated.
I plan to workaround this by adding a hardware RTC to face any loss-of-internet situations, but other users may want to have this limitation of the node documented.

[Feature Request] Individual Outputs for Each Time Range

Love the simplicity of this node - but would be more useful (to me at least) if, for each time range set, a new output would be created, similar to the standard switch node. With this configuration, a single Timerswitch node can act as a filter/gate to multiple subsequent actions. In my case, it would mean a single node to set the state/brightness of a bunch of different lights in my main living area based on time of day. I currently use a spaghetti string mess of cascading timerange switches and it's just overly complicated.

Allow boolean output

Timerswitch is limited to string output. Some nodes (e.g. switch) need boolean input.
Please allow boolean true/false for on/off payload.

Feature request: forward input to output

This node does almost exactly what I wanted. I have data which occasionally comes from a domoticz/out node to check if a device is on or not. I use this to remind myself before a certain device is still on so I can switch it off before I go to sleep or leave my house.

As far as I can see, the input of the timerswitch node is only used for sending commands to the node. It would be great if it could also forward the input msg.payload (if it's not a command) to the output during the scheduled period. Currently I solve this problem by dumping the filtered output from the domoticz/out node I would like to forward into a variable, and then use a trigger node connected to the output of the timerswitch node to resend this variable every five minutes. At the other end of the trigger node is a switch node which only allows an "ON" msg.payload to pass, thus if I am notified that the device is on and I then switch it off I won't receive anymore notifications, otherwise I will be reminded every 5 minutes that the device is still on.

As you can see there is a workaround, but it would so much simpler if there is just one node which forwards an input if it arrives within the scheduled time period.

Thanks in advance for considering this idea.

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.