Giter VIP home page Giter VIP logo

node-red-contrib-mytimeout's Introduction

node-red-contrib-mytimeout Readme

Node-red-contrib-mytimeout is a countdown timer that can be trigged by sending it input. It will run until the timer runs out where it will turn off. It can be turned off, stopped or cancelled with the correct input. It can be 'tickled' (restarted) with an on message or any other command not listed below. Meaning, if you send it junk, you have tickled the timer to continue to run. You can dynamically change the timeout and warning values by sending the appropriate Javacript object to the input.

Node-red-contrib-mytimeout can send and receive to the same MQTT topic. If the input matches the previously sent output, the message is ignored to avoid an endless loop.

Moved the default master repos to main repos

myTimeout

MyTimeout started as hacked timer code I stole from Pete Scargill. Pete's code would start a timer running if you sent it any trigger (tickle the timer). It would continue to run if further triggers were sent before the timeout occurred. A trigger was anything sent to the input of the timer.

My code goes a few steps further. It allows you to tickle the timer, turn off, stop or cancel the timer. It also allows you to send a Javascript object (see below) to override the timer's default values. Allowing you to turn off, to cancel or stop the timer. It still retains some of Pete's behaviors. You can still send almost anything to tickle the timer with the exception of the Javascript objects below which will cause the timer to do specific things.

You can configure the timeout module with the settings for the Safe and Unsafe messages. Safe is sent on the start of the timer, the unsafe message sent when the timeout occurs.

  • Name
  • Output topic (optional)
  • On state payload
  • Warning state payload (optional)
  • Off state payload
  • Countdown (seconds, integer)
  • Warning (seconds, integer)

Please note: The countdown and warning values must be whole, integer numbers. Using floating point numbers can cause the timer to not send the appropriate off state payload.

All of this is very useful for things like lights that are motion activated. If motion is detected, the Safe payload is sent (default is "on"). The timer can be started when motion is detected and as long as the motion continues there will be no timeout (if motion occurs more often than the default timeout). When the timeout occurs the Unsafe payload is sent (default is "off"). When the timeout warning time (n seconds before the timeout) occurs the warning message is sent on output 1.

If you set the warning seconds to 0 or leave the warning payload empty then the timer will skip sending a warning message and simply do a countdown. Setting the warning time in the Javascript object input to 0 will do the same.

MyTimeout inputs Preferred method

Like any Node-Red node, MyTimeout accepts the normal Javascript object. The payload attribute and value are expected and two additional attributes are optional. The payload value can be:

  • "on" or 1 - which turns on the timer and uses the default settings in the node (and issues an "on" on the output)
  • "off" or 0 - which turns off the timer (and issues an "off" on the output)
  • "stop" - which stops the timer (and issues a "stop" on the output)
  • "cancel" - which cancels the timer (and does not send any output)
  • Anything not listed above will be considered an on condition (a kicker if you will)

A minimal Javascript object looks like this:

{ "payload": "on" }

With this message the timer and will run with the default settings in the timer node (timeout is defaulted to 30 seconds and warning is defaulted to 10 seconds).

You can override the timeout and warning times with:

{ "payload": "on", "timeout": 3600, "warning": 300 }

This will restart the time, setting it to timeout in 3600 seconds and issue a warning 300 seconds before the timer turns off.

{
    "payload": "on",
    "warning": 0
}

Here the timer is turned on, using the default timeout. With the warning set to 0 seconds, the warning message will no longer be sent.

Please note: The timeout and warning values must be whole, integer numbers. Using floating point numbers can cause the timer to not send the appropriate off state payload. Both attributes are optional and either can be used to override the default settings.

Other triggers (inputs) are:

{
    "payload": "off"
}

{
    "payload": "stop"
}

{
    "payload": "cancel"
}

These will stop the timer. See above for the output description.

If the node property 'Warning state payload' is not set in the edit node dialog or the property 'Warning (sec)' is set to 0, then no warning message will be sent.

If the timer is not currently running and a stop or cancel is sent to the timer, no output will be sent. An on will trigger the timer to begin running. If an off is sent while the timer is not running, an off message will be sent.

Special handling

MQTT

mosquitto_pub -t home/automation/timer1 -m '{"payload": "on", "timeout": 600, "warning": 120 }"
{
    "topic":"home/automation/timer1",
    "payload":"{\"payload\": "\on\", \"timeout\": 600, \"warning\": 120}",
    "qos":0,
    "retain":false,
    "_msgid":"92d84595.fee6f8"
}
{
    "topic":"home/automation/timer1",
    "payload":"on",
    "timeout":600,
    "warning":120,
    "qos":0,
    "retain":false,
    "_msgid":"92d84595.fee6f8"
}

Warning disabled

{
    "topic":"home/automation/timer1",
    "payload":"on",
    "timeout":600,
    "warning":0,
    "qos":0,
    "retain":false,
    "_msgid":"92d84595.fee6f8"
}

Safe message disabled

{
    "topic":"home/automation/timer1",
    "payload":"",
    "warning":0,
    "qos":0,
    "retain":false,
    "_msgid":"92d84595.fee6f8"
}

The first output

The first (primary) output sends msg.payload of on, off, warning or stop. An input of cancel, does not send any output.

{
    "_msgid":"eed69e39.50a2a",
    "topic":"",
    "payload":"off"
}

Here is an off example.

The second output

This is a new feature in v2.0.0 of node-red-contrib-mytimeout. It is the countdown information.

Example output:

{"payload":30,"state":1,"flag":"ticks > 0"}
{"payload":5,"state":2,"flag":"warn >= ticks"}
{"payload": -1, "state": 0, "flag": "stop"}
{"payload": 0, "state": 0, "flag": "off"}
{"payload": -1, "state": 0, "flag": "cancel"}
{"payload": -1, "state": 0, "flag": "unknown"}

The "payload" is the number of seconds left on the timer, if 0 that means it is off, -1 means it was stopped, cancelled or the unknown has occurred.

Also I've added a second output which sends out the time left on the timer.

{"payload":30,"state":1,"flag":"ticks > 0"}
or
{"payload":10,"state":2,"flag":"warn >= ticks"}
or
{"payload":0,"state":0,"flag":"off"}
or
{"payload":-1,"state":0,"flag":"stop"}
or
{"payload":-1,"state":0,"flag":"cancel"}
or
{"payload": -1, "state": 0, "flag": "unknown"}

Then the off is sent or timeout occurs, the output 2 message is the same. The unknown should never occur but is left in in case something breaks.

The states are:

  • 0 = off, stopped or cancel (timer not running)
  • 1 = on (timer is running)
  • 2 = warning (timer is running and in the warning period)

If you find any other state, open an issue. node-red-contrib-mytimeout Issues

Actual output:

{
    "payload":4,
    "state":2,
    "flag":"warn >= ticks",
    "_msgid":"17b809b8.85c0d6"
}

Payload

  • on - turns on the timer. The addition fields timeout and warning are optional and allow the user to change the defaults. Both field values are integers and are in seconds. This payload will cause the timer to send a Timer on payload message in the msg.payload output
  • off - turns off the timer. This payload will cause the timer to send a Timer off payload in the msg.payload output
  • stop - stops the timer. This payload will cause the timer to send stop in the msg.payload output
  • cancel - cancels the timer. This payload will cause the timer to cancel but send no msg output
  • If something other that the above (including no payload) it will be treated as a default on message. This allows messages to tickle the timer.

Sample flow

I put together a sample flow that should help with using the node.

Notes on usage

One user setup 12 timers in one flow and began having issues (currently being investigated) with timers being left in the on state but not running. He moved each timer to it's own flow and gave each timer a unique name. I'm not sure if this is a usable work around but hope to test this soon.

Credits

  • Pete Scargill (the original timeout node and Big Timer)
  • Colin Law (for pointing out and correcting my terminology in this Readme)

Todo

  • Force accepted values to integer
  • Add input checking on the config page

node-red-contrib-mytimeout's People

Contributors

brammh avatar linuxha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-red-contrib-mytimeout's Issues

Output Topic - not coming out

Hi ,
I'm using your timer for many flows. I had not used the "Output topic" before but in my current flow it does not come to the output and I have to set the "topic" manually. A debug-node was showing empty Topic content.
I'm using your latest version and the node node-red-contrib-simple-gate

image

[{"id":"49c07f1b.63b48","type":"gate","z":"ebaeea0a.a6df68","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","x":650,"y":240,"wires":[["3bccad86.0811b2","9d9fed9b.0875f"]]},{"id":"9d9fed9b.0875f","type":"mytimeout","z":"ebaeea0a.a6df68","name":"outage","outtopic":"control","outsafe":"close","outwarning":"","outunsafe":"Open","warning":"5","timer":"3600","debug":false,"ndebug":false,"ignoreCase":false,"repeat":false,"again":false,"x":630,"y":180,"wires":[["2864c9f4.bd6b66"],[]]},{"id":"2864c9f4.bd6b66","type":"change","z":"ebaeea0a.a6df68","name":"ctrl","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":180,"wires":[["49c07f1b.63b48"]]},{"id":"3bccad86.0811b2","type":"function","z":"ebaeea0a.a6df68","name":"Set temp","func":"var temp1 = parseInt(msg.payload.tempc);\nvar speed = parseInt((msg.payload.windspeed)*3.6);\nmsg.payload.tempc = temp1;\nmsg.payload.windspeed = speed;\nreturn (msg);","outputs":1,"noerr":0,"x":810,"y":240,"wires":[["791b24dd.eb735c"]]}]

Inject json to override default values. Odd behavior.

Hi. I'm not sure if I'm doing something wrong but I can't seem to pass the msg directly out of the function node from your example, into the mytimeout timer and have it read the override values correctly. It keeps using the default values.

However if I pass the output of the function through a JSON node and then into mytimeout node, it works.

I couldn't figure this out for a while as your example looks like its passing the function output directly to the mytimeout node.

Is this expected?

Thank you!

This is not working:
https://hastebin.com/nibefacore.json
I pass directly out of function to mytimeout

This is working:
https://hastebin.com/geciwoduka.json
I pass through json node and then to mytimeout

ps: There is a small typo on the info page inside NR.

screen shot 2018-08-20 at 11 11 58 am

unwanted starting of countdown

Everytime I restart the node red server the countdown of mytimeout starts and puts a "1" on the output. I'm working with ubuntu 20.04.2 LTS, Node-RED 1.2.3 and mytimeout 3.2.0. Any help on this is appreciated. Thanks

How to set timeout value dynamically ?

Hi Neil,

In order to optimize and simplify my workflow drastically, I would like to put in the timeout value as part of the payload. I have tried multiple combinations, but I always get a NaN when I start the timer.

I fear the mytimer is unable to accept its timeoute/timeout/timer value from the incoming payload.

Given following example workflow, can you change the switch so the timer can be set to either input value ?

Thanks,
Tran

[{"id":"183764d3.7dc30b","type":"mytimeout","z":"fd7a7f8d.a9edc","name":"","outtopic":"","outsafe":"ON","outwarning":"OFF","outunsafe":"OFF","warning":"1","timer":"","limit":"","repeat":false,"again":false,"x":530,"y":200,"wires":[["a8a646f4.6becc8"]]},{"id":"f0ec29f6.98bf78","type":"inject","z":"fd7a7f8d.a9edc","name":"","topic":"","payload":"30","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":180,"wires":[["cbdc8a80.4524d8"]]},{"id":"8c7644a0.242c38","type":"inject","z":"fd7a7f8d.a9edc","name":"","topic":"","payload":"60","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":220,"wires":[["cbdc8a80.4524d8"]]},{"id":"cbdc8a80.4524d8","type":"change","z":"fd7a7f8d.a9edc","name":"","rules":[{"t":"set","p":"timeoute","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":200,"wires":[["183764d3.7dc30b","a532595b.a40a88"]]},{"id":"a8a646f4.6becc8","type":"debug","z":"fd7a7f8d.a9edc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":730,"y":200,"wires":[]},{"id":"a532595b.a40a88","type":"debug","z":"fd7a7f8d.a9edc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":530,"y":260,"wires":[]}]

Pause?

What's your recommended method of pausing? The 'restarting' obviously can (essentially) become a new timer with the value of the timer when it stopped, but 'stop' setting payload to 0 seems a little counterintuitive to me.

Would you consider 'Stop' retain the payload for restarting, feeding that payload value back in to the node again upon a trigger? Alternatively, would you consider a "pause" action? Would be nicer than needing to maintain my own state of the timer external to the timeout node.

Otherwise Stop and Cancel are essentially the same, just one notifies you about it (on the first output), and the other doesn't.

Run different instances of timer based on msg.topic

I would like to have a functionality which the original delay node in node-red has, variable delay per message topic which allows us to run multiple instances of the timer based on the msg.topic value passed to the node. I tried doing the same with the mytimeout and new invocations always reset the timer. Would be really nice to keep multiple timers running.

Sample Flow:

[
    {
        "id": "e9c0e6e2.b401f8",
        "type": "mytimeout",
        "z": "d24adb51.bd89f8",
        "name": "",
        "outtopic": "",
        "outsafe": "on",
        "outwarning": "",
        "outunsafe": "off",
        "warning": "5",
        "timer": "30",
        "debug": false,
        "ndebug": false,
        "ignoreCase": false,
        "repeat": false,
        "again": false,
        "x": 1330,
        "y": 220,
        "wires": [
            [
                "28a04c14.1e2fa4"
            ],
            []
        ]
    },
    {
        "id": "37366a80.05b1a6",
        "type": "inject",
        "z": "d24adb51.bd89f8",
        "name": "",
        "topic": "",
        "payload": "{\"payload\":\"on\",\"timeout\":50,\"warning\":30,\"topic\":\"foo\"}",
        "payloadType": "json",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 950,
        "y": 200,
        "wires": [
            [
                "69883483.758bdc"
            ]
        ]
    },
    {
        "id": "28a04c14.1e2fa4",
        "type": "debug",
        "z": "d24adb51.bd89f8",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "x": 1540,
        "y": 220,
        "wires": []
    },
    {
        "id": "69f9a286.29315c",
        "type": "inject",
        "z": "d24adb51.bd89f8",
        "name": "",
        "topic": "",
        "payload": "stop",
        "payloadType": "str",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 1050,
        "y": 320,
        "wires": [
            [
                "e9c0e6e2.b401f8"
            ]
        ]
    },
    {
        "id": "2685c496.bfdf3c",
        "type": "inject",
        "z": "d24adb51.bd89f8",
        "name": "",
        "topic": "",
        "payload": "pause",
        "payloadType": "str",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 1050,
        "y": 400,
        "wires": [
            [
                "e9c0e6e2.b401f8"
            ]
        ]
    },
    {
        "id": "c665e6ad.370bb8",
        "type": "inject",
        "z": "d24adb51.bd89f8",
        "name": "",
        "topic": "",
        "payload": "{\"payload\":\"on\",\"timeout\":20,\"warning\":10,\"topic\":\"bar\"}",
        "payloadType": "json",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 930,
        "y": 260,
        "wires": [
            [
                "69883483.758bdc"
            ]
        ]
    },
    {
        "id": "69883483.758bdc",
        "type": "change",
        "z": "d24adb51.bd89f8",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "payload.topic",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1120,
        "y": 200,
        "wires": [
            [
                "e9c0e6e2.b401f8"
            ]
        ]
    }
]

strange behaviour, does not turn off , or even turns on instead

I have this system with automatic lights, based on PIR with RF and wall switches with RF .
Timers reset while PIR activity , and when time runs almost out, a warning light starts blinking. Then the lights go off.
That should be the case.
However, the timers do not always send the OFF command.
Sometimes they even send the ON command and not start the timer... so the lights stay on all night.
I am switching to wall light switches with Tasmota and RF soon because of this unreliability.
timersflowexample.json.txt

... edit: I discovered a typo in one of the PIR-RF received data-switches.

Timer does not stop for FLOAT timeout values

Hi, I was experimenting a bit further with your timeout.

I have a calculated timeout which is a float value. When passing the float ast msg.timeout into your

  • The timer is accepting the float
  • The timer is counting down
    ->> The counter never stops as it does not reach 0

[{"id":"7dd3409d.0daae","type":"mytimeout","z":"b1d09add.6b04a8","name":"timer","outtopic":"","outsafe":"on","outwarning":"Warning","outunsafe":"off","warning":"5","timer":"20.001","debug":"0","repeat":false,"again":false,"x":510,"y":380,"wires":[["559dcc7d.65e6f4"],["559dcc7d.65e6f4"]]},{"id":"745c54b6.b9a71c","type":"inject","z":"b1d09add.6b04a8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":380,"wires":[["cd407dbc.6a09"]]},{"id":"cd407dbc.6a09","type":"change","z":"b1d09add.6b04a8","name":"timeout","rules":[{"t":"set","p":"timeout","pt":"msg","to":"6.1234567","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":380,"wires":[["7dd3409d.0daae"]]},{"id":"559dcc7d.65e6f4","type":"debug","z":"b1d09add.6b04a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":710,"y":380,"wires":[]}]

image

The workspace contains some nodes that are not properly configured ...

I've noticed another minor issue with an error message that pops up on deploy of the new timers.

"The workspace contains some nodes that are not properly configured: ... are you sure you want to deploy."

You can deploy it's harmless and I have a manual fix but I need to figure out how to word it.

This has to do with my change from a text box to a checkbox. I'm trying to work on a solution so we don't need the manual steps.

Timer stop counting down occasionally

Hi I have changed all my timers to your mytimeout timer, and it usually works perfectly.

Frequently , the countdown stops counting down (still showing Running: 45). I had established debug pointers before and after the timer but there was no event/trigger to halt the countdown... it just stopped

Below is a code component I use to trigger my lights and keep them running for period of time.

[{"id":"72b956bb.e1eac8","type":"link in","z":"e9a592e9.83a77","name":"Light GW","links":["d7f70ea2.d4ba7","8ae0c979.c11a78"],"x":75,"y":760,"wires":[["b519e69a.1ea468"]]},{"id":"b519e69a.1ea468","type":"change","z":"e9a592e9.83a77","name":"GW light","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"data\":{\"entity_id\":\"light.gateway_light_f0b4299aaf29\"}}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":220,"y":760,"wires":[["cfec39ae.d15d08"]]},{"id":"cfec39ae.d15d08","type":"api-call-service","z":"e9a592e9.83a77","name":"Light ON","server":"8ad970d8.e2b73","service_domain":"light","service":"turn_on","data":"","mergecontext":"none","x":400,"y":760,"wires":[["a796d525.2bf298","4bd58b26.da5fa4"]],"icon":"node-red-contrib-home-assistant/arrow-right-bold-hexagon-outline.png"},{"id":"a796d525.2bf298","type":"change","z":"e9a592e9.83a77","name":"House Light timer","rules":[{"t":"set","p":"timeout","pt":"msg","to":"House_Light_timer","tot":"global"},{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":760,"wires":[["9b5bee98.fe7bb"]]},{"id":"4bd58b26.da5fa4","type":"api-current-state","z":"e9a592e9.83a77","name":"log?","server":"8ad970d8.e2b73","halt_if":"off","override_topic":true,"override_payload":true,"entity_id":"input_boolean.send_telgram_log","x":550,"y":720,"wires":[["683b250f.e1e11c"]]},{"id":"9b5bee98.fe7bb","type":"mytimeout","z":"e9a592e9.83a77","name":"timer","outtopic":"","outsafe":"on","outwarning":"Warning","outunsafe":"off","warning":"5","timer":"30","repeat":false,"again":false,"x":870,"y":760,"wires":[["4ed02376.34a5ec"],[]]},{"id":"77970856.b76e08","type":"link in","z":"e9a592e9.83a77","name":"Light GW off","links":[],"x":435,"y":720,"wires":[["a796d525.2bf298"]]},{"id":"683b250f.e1e11c","type":"change","z":"e9a592e9.83a77","name":"Telegram","rules":[{"t":"set","p":"myMessage","pt":"global","to":"Hallway light ==> ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":720,"wires":[["3d105a9e.82e406"]]},{"id":"4ed02376.34a5ec","type":"switch","z":"e9a592e9.83a77","name":"off ?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1010,"y":760,"wires":[["a952e4aa.bb1868"]]},{"id":"2e8c5de5.fa5362","type":"change","z":"e9a592e9.83a77","name":"off","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":720,"wires":[["9b5bee98.fe7bb"]]},{"id":"3d105a9e.82e406","type":"link out","z":"e9a592e9.83a77","name":"Send Msg","links":["ed951e00.620ec"],"x":735,"y":720,"wires":[]},{"id":"a952e4aa.bb1868","type":"change","z":"e9a592e9.83a77","name":"GW light","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"data\":{\"entity_id\":\"light.gateway_light_f0b4299aaf29\"}}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":760,"wires":[["2b627979.32cfa6"]]},{"id":"161ab6a3.aa1b59","type":"link in","z":"e9a592e9.83a77","name":"Light GW off - now","links":["ed2201a6.5ebd2"],"x":795,"y":720,"wires":[["2e8c5de5.fa5362"]]},{"id":"2b627979.32cfa6","type":"api-call-service","z":"e9a592e9.83a77","name":"Light OFF","server":"8ad970d8.e2b73","service_domain":"light","service":"turn_off","data":"","mergecontext":"none","x":1320,"y":760,"wires":[["2554f049.add85"]],"icon":"node-red-contrib-home-assistant/arrow-right-bold-hexagon-outline.png"},{"id":"2554f049.add85","type":"api-current-state","z":"e9a592e9.83a77","name":"log?","server":"8ad970d8.e2b73","halt_if":"off","override_topic":true,"override_payload":true,"entity_id":"input_boolean.send_telgram_log","x":1450,"y":760,"wires":[["707e1a8b.9a2e64"]]},{"id":"707e1a8b.9a2e64","type":"change","z":"e9a592e9.83a77","name":"Telegram","rules":[{"t":"set","p":"myMessage","pt":"global","to":"Hallway light ==> OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1580,"y":760,"wires":[["b2b43870.523a98"]]},{"id":"b2b43870.523a98","type":"link out","z":"e9a592e9.83a77","name":"Send Msg","links":["ed951e00.620ec"],"x":1675,"y":760,"wires":[]},{"id":"8ad970d8.e2b73","type":"server","z":"","name":"Home Assistant","url":"http://hassio/homeassistant","pass":"2bf95b829c8b4824987dcac37eed662a"}]

Tick interval

I think it would be great if we can setup tick interval value in node settings?

Topic Using Mustache

Is it possible to allow mustache format in the setup of the node, such as setting the topic to be {{msg.topic}} and it would take the input topic and set the outgoing msg topic? Ideally this would apply to all input variables.

stop or cancel not working

Version [email protected]
When I send the following payload when a timer is already started , the countdown freeze and does not send a cancel payload
{
"payload": "cancel"
}

Also your documentation is wrong its 'timer' instead of 'timeoute'

Thanks for your job

Should I pass in a JSON string or a javascript object?

The documentation says that we can pass in JSON containing attributes such as payload and timeout. Does this actually mean that I have to construct a JSON string containing the structure or should it be a javascript object containing the values?

First countdown msg is a string !

Hello,
I get a strange behavior, on second output for the countdown the first sent msg is a string then all next are number than expected. Below a debug log, for a timeout of 600s.
It’s not a big issue, just the first value are not displayed on the dashboard.
Thank you

18.07.2019 à 15:06:13node: MyTimeout
msg.payload : string[3]
"600"
18.07.2019 à 15:06:13node: MyTimeout
msg.payload : number
599
—-> all next output are number format

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.