Vacation timer: Problems throwing boolean On/Off payloads

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?

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.

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

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.

I'm sure there would be a similar node.

I guess the problem is knowing the name.

Try this one.

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

[{"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:

[{"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":[]}]

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

Yes, the topic is comming correctly!

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!

In that case you can use a Change node configured like this to do the conversion from on/off to true/false
image

Or even just like this
image

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

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.

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

Yes i did. And i'm using this node node-red-contrib-presence-faker now.
It's a pretty good thing.
Thank you very much for your suggestion !

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

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