# Big Timer how to change payload from 1 to 0 and 0 to 1

**URL:** <https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243>\
**Category:** General\
**Created:** [21 February 2019 20:12 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243 "2019-02-21T20:12:07Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://discourse.nodered.org/u/Vince)\
**Post date:** [21 February 2019 20:12 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/1 "2019-02-21T20:12:07Z")

</div>

This my second day learning node-red and I have no coding experience other than Basic (25 years ago).  
Here is the question:  
Is there a better way to change default payload output of Big Timer than adding 2 “change” nodes in parallel?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c697bd9bbfe833f9adf7c7635bc65cb7c2d098ad.png)

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://discourse.nodered.org/u/Vince)\
**Post date:** [21 February 2019 20:14 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/2 "2019-02-21T20:14:06Z")

</div>

Here is snap shot of change node

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/85200aca456ca7b5150f4e3f4ca2517f189472ac.png)

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [21 February 2019 20:40 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/3 "2019-02-21T20:40:22Z")

</div>

A solution using only one `change` node:

![not](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0309c18f5e70952862c882c6f73c5b5347833ecf.png)

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://discourse.nodered.org/u/Vince)\
**Post date:** [21 February 2019 20:52 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/4 "2019-02-21T20:52:39Z")

</div>

Thanks, Definetly better than 2 nodes.  
Is there a tutorial on preinstalled nodes covering all possible options?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 February 2019 20:58 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/5 "2019-02-21T20:58:57Z")

</div>

You could use output 1 of the bigtimer node and get it to send the values you want. No change node needed at all.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [21 February 2019 21:07 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/6 "2019-02-21T21:07:57Z")

</div>

> [@Vince](#):
>
> Is there a tutorial on preinstalled nodes covering all possible options?

Can't see any possible chance to even create such "There is all covered" tutorials. It's like everybody should have it's own printed version of Google. But here you can safely rely on power of Node-RED community 🙂 Always up to date.

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://discourse.nodered.org/u/Vince)\
**Post date:** [21 February 2019 21:26 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/7 "2019-02-21T21:26:18Z")

</div>

> [@Colin](#):
>
> You could use output 1 of the bigtimer node and get it to send the values you want. No change node needed at all.

I’ve tried that and couldn’t get it to work  
Node-red v0.19.5  
Bigtimer v2.1.8  
How do I set output 1 of big timer to output numbers instead of strings?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1df3c90a296f59f02a493cc72f1b6d03d3f53476.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 February 2019 21:30 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/8 "2019-02-21T21:30:33Z")

</div>

> [@Vince](#):
>
> How do I set output 1 of big timer to output numbers instead of strings?

If you absolutely need numbers then you are right. What are you doing that needs them to be numbers?

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://discourse.nodered.org/u/Vince)\
**Post date:** [21 February 2019 21:35 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/9 "2019-02-21T21:35:50Z")

</div>

Controlling gpio pins on rpi to activate relays.  
Since initial state of gpio pin is high(1) I couldn’t use default output2 ( 1 for on, 0 for off) of big timer to control it

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 February 2019 21:39 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/10 "2019-02-21T21:39:45Z")

</div>

I don't know, but have you checked whether GPIO Out works with strings "0" and "1"?

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://discourse.nodered.org/u/Vince)\
**Post date:** [21 February 2019 21:59 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/11 "2019-02-21T21:59:17Z")

</div>

Not 100% sure but I think it’s only 0,1  
I could have a change node in front of each pin and have different types of payloads to work with, but at this moment I don’t see any reasons why would I want to use something besides 0 and 1. It is a relay and it’s ether on or off.  
Also, ones I’m done with this project I would like it to be as simple as possible and easy to troubleshoot.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/3506c68e4aea3f76f22d0eb62690942ca83007ce.jpeg)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 February 2019 22:03 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/12 "2019-02-21T22:03:30Z")

</div>

I meant that the GPIO node might be perfectly happy with strings instead of numbers so you would simplify the flow by just feeding output 1 of the bigtimer direct to the GPIO node. On the other hand it might be better to say you will always make sure it is numeric 0 and 1, in which case you are stuck with the change nodes.

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://discourse.nodered.org/u/Vince)\
**Post date:** [21 February 2019 22:57 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/13 "2019-02-21T22:57:11Z")

</div>

Just tried. Gpio doesn’t respond  
I don’t mind using multiple nodes if I have to.  
Big timer is a little too complex for my purposes and It would be the first node to look at if something start malfunctioning. But as of right now it seems to be working properly.  
Can’t wait to gut my good old fashioned mechanical timer which currently controls all outdoor lights and replace it with 8 channel relay board.

Thanks for your help everyone

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [22 February 2019 08:00 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/14 "2019-02-22T08:00:07Z")

</div>

The gpio node should accept both 1/0 (number) and “1”/“0” (string) and true/false (Boolean) so there should be no need to convert. If not then I’d like to understand

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://discourse.nodered.org/u/Vince)\
**Post date:** [22 February 2019 15:09 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/15 "2019-02-22T15:09:46Z")

</div>

In Gpio node properties it says “Tip: For digital output - input must be 0 or 1”  
Maybe it will accept other inputs, but it didn’t in my flow.  
Maybe there are other gpio nodes out there that will accept various inputs.  
I can’t help you to understand, no clue myself how node-red works I’m dragging, dropping, connecting, debugging and see what comes out

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [22 February 2019 17:47 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/16 "2019-02-22T17:47:05Z")

</div>

Well spotted - it does indeed say that ... though it doesn't actually specify string or number - the implication is that it's a number.

I have just tested and it does work with both strings and numbers (and booleans as well) ... so yes I'll clarify the docs.

You may want to retry in your flow - or share a small part of your flow here so we can try to see why it didn't work for you.

Thanks

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://discourse.nodered.org/u/Vince)\
**Post date:** [23 February 2019 02:30 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/17 "2019-02-23T02:30:03Z")

</div>

Yes, indeed it does work now.  
It didn’t at first because when flow was created I started with gpio node, dashboard switch node, and later added big timer.  
Dashboard switch was set to output numbers 0,1 pass through enabled.  
When string from big timer inputs the switch (set for numbers) the output will always be 1.  
When switch is set to output strings, everything works as it should.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/9bb3bd53236fc8a5d228916de8980b80cfff9aa2.png)

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [23 February 2019 12:40 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/18 "2019-02-23T12:40:50Z")

</div>

> [@Vince](#):
>
> Big timer is a little too complex for my purposes ...

Maybe `node-red-contrib-schedex` is the right node for your purpose?

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://discourse.nodered.org/u/Vince)\
**Post date:** [27 February 2019 18:33 UTC](https://discourse.nodered.org/t/big-timer-how-to-change-payload-from-1-to-0-and-0-to-1/8243/19 "2019-02-27T18:33:52Z")

</div>

Actually Bigtimer might become more useful. In last 4 days I’ve got myself ESP8266 board to replace RPi as controller of 8ch relay board.  
To make it work I’ll have to start using MQTT protocol
