# Vacation timer: Problems throwing boolean On/Off payloads

**URL:** https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328
**Category:** General
**Created:** [25 September 2020 07:13 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328 "2020-09-25T07:13:39Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![KasimirGuenter1259](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kasimirguenter1259/32/29063_2.png) [@KasimirGuenter1259](https://discourse.nodered.org/u/KasimirGuenter1259)
#### Post date: [25 September 2020 07:13 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/1 "2020-09-25T07:13:39Z")

</div>

I want to use the vacation timer. Using the default options:  
**ON command: payload is string "On", OFF command: payload is string "Off"**  
everything is working well. Payload is "On" or "Off", depending on vacation timer status.

Due to my devices I want to throw boolean values:  
**ON command: payload should be true, OFF command should be false**  
But in this case the node _ **always** _ throws a payload with boolean value _ **true** _ in payload.

If i want to throw strings:  
**ON Command: payload should be string "true", OFF command payload should be string "false"**  
i can observe the same wrong behaviour. The node always throws boolen value _ **true** _ in payload.

What's wrong? Does anybody have a tip for me?

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [25 September 2020 07:18 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/2 "2020-09-25T07:18:45Z")

</div>

Hi and welcome to Node-Red.

You may need to given the entire name of the node you are using.

_Vacation timer_ is a bit vague.

---

<div class="post-metadata">

### Author: ![KasimirGuenter1259](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kasimirguenter1259/32/29063_2.png) [@KasimirGuenter1259](https://discourse.nodered.org/u/KasimirGuenter1259)
#### Post date: [25 September 2020 07:41 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/3 "2020-09-25T07:41:53Z")

</div>

Oh sorry: Reh entire Name is  
node-red-contrib-vacation-timer

---

<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: [25 September 2020 08:56 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/4 "2020-09-25T08:56:46Z")

</div>

Can you mark the node and Export it and paste it here so we can see how you have configured it please. Use the `</>` button above the text window here when pasting it in.

I notice that it has not been updated in three years and has not got a github repository so it is not possible to submit an issue. Personally I would only use such a node if there were no alternative. Searching for vacation on the flows site I see that there is another node that purports to do a similar thing that was updated only a month ago so you could maybe try that one. Alternatively if it does work ok if you set it to output strings you could use a Change node to set it to boolean values.

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [25 September 2020 09:09 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/5 "2020-09-25T09:09:41Z")

</div>

I'm sure there would be a similar node.

I guess the problem is knowing the name.

[Try this one.](https://flows.nodered.org/node/node-red-contrib-presence-faker)

---

<div class="post-metadata">

### Author: ![KasimirGuenter1259](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kasimirguenter1259/32/29063_2.png) [@KasimirGuenter1259](https://discourse.nodered.org/u/KasimirGuenter1259)
#### Post date: [25 September 2020 10:35 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/6 "2020-09-25T10:35:37Z")

</div>

Here's a little flow, which is working well:

```auto
[{"id":"397073b5.6ca7f4","type":"change","z":"ee54d64.6575c28","name":"payload = true / Start vacation timer","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":4545,"wires":[["cdd8820e.765be"]]},{"id":"d0c6239a.4f8f08","type":"change","z":"ee54d64.6575c28","name":"payload = false / Stop vacation timer","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":4620,"wires":[["cdd8820e.765be"]]},{"id":"6047809c.73b5e","type":"inject","z":"ee54d64.6575c28","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":4545,"wires":[["397073b5.6ca7f4"]]},{"id":"417a0a11.c11524","type":"inject","z":"ee54d64.6575c28","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":4620,"wires":[["d0c6239a.4f8f08"]]},{"id":"cdd8820e.765be","type":"vacation-timer","z":"ee54d64.6575c28","name":"EG Wohnzimmer Stehleuchte","lat":"48.7","lon":"12.0","turnOffOnDaysOff":true,"midnightSchedule":true,"onTime":"11:45","randMinutes":"10","offTime":"14:00","randOffMinutes":"0","minOnHours":"0","minOnMinutes":"10","maxOnHours":"0","maxOnMinutes":"15","stopTab":"tab-1","onPayloadType":"str","onPayloadVal":"on","onTopicVal":"Ein EG Wohnzimmer Stehleuchte","offPayloadType":"str","offPayloadVal":"off","offTopicVal":"Aus EG Wohnzimmer Stehleuchte","suspended":true,"disableMax":false,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"x":760,"y":4575,"wires":[["e6d55e95.c75e9"]]},{"id":"e6d55e95.c75e9","type":"debug","z":"ee54d64.6575c28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1040,"y":4575,"wires":[]}]

```

Here's the same flow (only boolean output for payload is changed), which does NOT work:

```auto
[{"id":"57ea47b5.0df848","type":"change","z":"ee54d64.6575c28","name":"payload = true / Start vacation timer","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":375,"y":4710,"wires":[["ad4b83d4.9efcd8"]]},{"id":"3a4f1a2a.abc14e","type":"change","z":"ee54d64.6575c28","name":"payload = false / Stop vacation timer","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":375,"y":4785,"wires":[["ad4b83d4.9efcd8"]]},{"id":"830a0012.069ab","type":"inject","z":"ee54d64.6575c28","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":135,"y":4710,"wires":[["57ea47b5.0df848"]]},{"id":"33888719.356e2","type":"inject","z":"ee54d64.6575c28","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":135,"y":4785,"wires":[["3a4f1a2a.abc14e"]]},{"id":"ad4b83d4.9efcd8","type":"vacation-timer","z":"ee54d64.6575c28","name":"EG Wohnzimmer Stehleuchte","lat":"48.7","lon":"12.0","turnOffOnDaysOff":true,"midnightSchedule":true,"onTime":"11:45","randMinutes":"10","offTime":"14:00","randOffMinutes":"0","minOnHours":"0","minOnMinutes":"10","maxOnHours":"0","maxOnMinutes":"15","stopTab":"tab-1","onPayloadType":"bool","onPayloadVal":"true","onTopicVal":"Ein EG Wohnzimmer Stehleuchte","offPayloadType":"bool","offPayloadVal":"false","offTopicVal":"Aus EG Wohnzimmer Stehleuchte","suspended":true,"disableMax":false,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"x":745,"y":4740,"wires":[["5be419a.08294e8"]]},{"id":"5be419a.08294e8","type":"debug","z":"ee54d64.6575c28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1025,"y":4740,"wires":[]}]

```

---

<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: [25 September 2020 10:59 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/7 "2020-09-25T10:59:54Z")

</div>

I see you also have different topics for on/off, is the topic coming correctly but not the payload?

---

<div class="post-metadata">

### Author: ![KasimirGuenter1259](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kasimirguenter1259/32/29063_2.png) [@KasimirGuenter1259](https://discourse.nodered.org/u/KasimirGuenter1259)
#### Post date: [25 September 2020 11:09 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/8 "2020-09-25T11:09:08Z")

</div>

Yes, the topic is comming correctly!

---

<div class="post-metadata">

### Author: ![KasimirGuenter1259](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kasimirguenter1259/32/29063_2.png) [@KasimirGuenter1259](https://discourse.nodered.org/u/KasimirGuenter1259)
#### Post date: [25 September 2020 11:11 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/9 "2020-09-25T11:11:56Z")

</div>

This one is: node-red-contrib-presence-faker

This node does his work with payload (string/boolean) and with topic correctly.  
But unfortenately this node only works with absolute times. No dusk/dawn etc. is possible.

For me this is a No Go!

---

<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: [25 September 2020 11:19 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/10 "2020-09-25T11:19:50Z")

</div>

In that case you can use a Change node configured like this to do the conversion from on/off to true/false  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3b4d828da6418b20913d318eb7ba2c2ceb9caaec.png)

Or even just like this  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/4/b4c4489640330170b9ac2e9a7957eac10919c159.png)

---

<div class="post-metadata">

### Author: ![KasimirGuenter1259](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kasimirguenter1259/32/29063_2.png) [@KasimirGuenter1259](https://discourse.nodered.org/u/KasimirGuenter1259)
#### Post date: [25 September 2020 13:10 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/11 "2020-09-25T13:10:42Z")

</div>

@Colin  
Yes, I'll do this way.  
Thanks very much.

---

<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: [25 September 2020 13:13 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/12 "2020-09-25T13:13:57Z")

</div>

I wouldn't treat this as a long term solution. With a node that has not been updated in three years and has such an obvious bug (apparently) it may well be only a matter of time till it stops working. It may not be compatible with a later version of nodejs for example.

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [25 September 2020 21:12 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/13 "2020-09-25T21:12:42Z")

</div>

Have you looked at the one I suggested as the alternative?

> **[node-red-contrib-presence-faker](https://flows.nodered.org/node/node-red-contrib-presence-faker)**
>
> Let your home appear occupied by switching devices (e.g. lights) on and off at random (configurable) times.

---

<div class="post-metadata">

### Author: ![KasimirGuenter1259](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kasimirguenter1259/32/29063_2.png) [@KasimirGuenter1259](https://discourse.nodered.org/u/KasimirGuenter1259)
#### Post date: [27 September 2020 19:15 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/14 "2020-09-27T19:15:41Z")

</div>

Yes i did. And i'm using this node [node-red-contrib-presence-faker](https://flows.nodered.org/node/node-red-contrib-presence-faker) now.  
It's a pretty good thing.  
Thank you very much for your suggestion !

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [27 September 2020 20:43 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/15 "2020-09-27T20:43:24Z")

</div>

Really you should make my post as the solution, not your reply to it.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [11 October 2020 20:43 UTC](https://discourse.nodered.org/t/vacation-timer-problems-throwing-boolean-on-off-payloads/33328/16 "2020-10-11T20:43:31Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
