# Schedex payload format

**URL:** <https://discourse.nodered.org/t/schedex-payload-format/5011>\
**Category:** General\
**Created:** [18 November 2018 22:05 UTC](https://discourse.nodered.org/t/schedex-payload-format/5011 "2018-11-18T22:05:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinschki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/martinschki/32/737_2.png) [@martinschki](https://discourse.nodered.org/u/martinschki)\
**Post date:** [18 November 2018 22:05 UTC](https://discourse.nodered.org/t/schedex-payload-format/5011/1 "2018-11-18T22:05:17Z")

</div>

I'm using schedex for a couple of things and found that payload is a string. Is it possible to have on/off also as boolean or do I always need to convert with a JSON node after?  
Maybe I'm missing something  
thanks

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [19 November 2018 01:16 UTC](https://discourse.nodered.org/t/schedex-payload-format/5011/2 "2018-11-19T01:16:03Z")

</div>

Not sure what you are trying to do - i for instance use the following to put information on my dashboard with the schedex node

{{msg.payload.state}}

Craig

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [19 November 2018 01:20 UTC](https://discourse.nodered.org/t/schedex-payload-format/5011/3 "2018-11-19T01:20:02Z")

</div>

You can also just use a change node to convert/transform it rather than messing with JSON

Craig

---

<div class="post-metadata">

**Author:** ![martinschki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/martinschki/32/737_2.png) [@martinschki](https://discourse.nodered.org/u/martinschki)\
**Post date:** [19 November 2018 06:47 UTC](https://discourse.nodered.org/t/schedex-payload-format/5011/4 "2018-11-19T06:47:19Z")

</div>

the next node expects a boolean payload (true/false) and receives inputs from more than one node, so it needs to be at msg.payload

The change node only changes the position, not the type. JSON node changes from string "true" to boolean "true"

---

<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:** [19 November 2018 07:17 UTC](https://discourse.nodered.org/t/schedex-payload-format/5011/5 "2018-11-19T07:17:15Z")

</div>

Just for interest, what is that next node ? In general it is easier to make the input more tolerant than outputs.

---

<div class="post-metadata">

**Author:** ![martinschki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/martinschki/32/737_2.png) [@martinschki](https://discourse.nodered.org/u/martinschki)\
**Post date:** [19 November 2018 07:30 UTC](https://discourse.nodered.org/t/schedex-payload-format/5011/6 "2018-11-19T07:30:07Z")

</div>

I'm going from:

- homekit
- Alexa-local
- ui node with toggle button
- schedex

into ads output node

and currently I have to do this, question is, can I have that any easier?  
It is working, it's just not pretty (and maybe not efficient)

```auto
[{"id":"5b01b037.34f798","type":"ui_template","z":"68f82b36.6c6414","group":"c713dff5.21ab3","name":"Toggle Button","order":2,"width":"3","height":"2","format":"<md-button\n class=\"vibrate filled bigfont\"\n ng-style=\"{background: !msg.payload ? 'red' : 'green' }\"\n ng-click=\"send({payload: !msg.payload })\"\n > \n {{msg.topic}}<br/>\n </md-button>","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":560,"y":80,"wires":[["82b530e3.ee3d5"]]},{"id":"90b8309b.44ae38","type":"homekit-service","z":"68f82b36.6c6414","bridge":"3ede67af.17963","name":"Sterne","serviceName":"Lightbulb","manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","characteristicProperties":"{}","x":530,"y":40,"wires":[["fd6bcd69.678d4"]]},{"id":"fd6bcd69.678d4","type":"change","z":"68f82b36.6c6414","name":"","rules":[{"t":"move","p":"payload.On","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":40,"wires":[["82b530e3.ee3d5"]]},{"id":"bb7b1869.63cd","type":"alexa-local","z":"68f82b36.6c6414","devicename":"Sterne","inputtrigger":false,"x":530,"y":120,"wires":[["e7f0c860.559138"]]},{"id":"e7f0c860.559138","type":"change","z":"68f82b36.6c6414","name":"","rules":[{"t":"move","p":"on","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":120,"wires":[["82b530e3.ee3d5"]]},{"id":"82b530e3.ee3d5","type":"ADS Output","z":"68f82b36.6c6414","name":"","datasource":"6052e4.0430bd1c","varName":"test.out","varTyp":"BOOL","outValue":"payload","varSize":"","timezone":"UNCHANGED","topic":"","x":1040,"y":80,"wires":[]},{"id":"9567a2cc.6deae","type":"schedex","z":"68f82b36.6c6414","name":"","suspended":false,"lat":"47.00000","lon":"11.000000","ontime":"dusk","ontopic":"","onpayload":"true","onoffset":"","onrandomoffset":0,"offtime":"22:30","offtopic":"","offpayload":"false","offoffset":"","offrandomoffset":0,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":550,"y":180,"wires":[["7d54da86.96307c"]]},{"id":"7d54da86.96307c","type":"json","z":"68f82b36.6c6414","name":"","property":"payload","action":"","pretty":false,"x":750,"y":180,"wires":[["82b530e3.ee3d5"]]},{"id":"c713dff5.21ab3","type":"ui_group","z":"","name":"Beleuchtung","tab":"a2b4d00e.93a548","order":1,"disp":true,"width":"10","collapse":false},{"id":"3ede67af.17963","type":"homekit-bridge","z":"","bridgeName":"Wohnzimmer","pinCode":"222-22-222","port":"","manufacturer":"Default Manufacturer","model":"bli","serialNo":"75928475"},{"id":"6052e4.0430bd1c","type":"ads-connection","z":"","host":"192.168.66.10","amsNetIdTarget":"10.10.10.10.1.1","amsNetIdSource":"10.10.10.11.1.1","port":"48898","amsPortSource":"32905","amsPortTarget":"801"},{"id":"a2b4d00e.93a548","type":"ui_tab","z":"","name":"Wohnraum","icon":"fire","order":1}]

```
