# Same output different response

**URL:** https://discourse.nodered.org/t/same-output-different-response/2417
**Category:** General
**Created:** [20 August 2018 13:39 UTC](https://discourse.nodered.org/t/same-output-different-response/2417 "2018-08-20T13:39:49Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jarcher12](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@jarcher12](https://discourse.nodered.org/u/jarcher12)
#### Post date: [20 August 2018 13:39 UTC](https://discourse.nodered.org/t/same-output-different-response/2417/1 "2018-08-20T13:39:49Z")

</div>

In the flow below i'm trying to get a timed alarm to trygger a yeelight. it works when triggered from the inject node, but the excact same json code does not work when triggered from the trigger node. i have also tried using a function node but that doesnt work either, have been working on it for quit a few hours now. Im sure there must be people who can explain this. i have been looking at the full debug and the outputs are different as well.

this is the output for the failing one :  
8/20/2018, 8:14:01 PM[node: 43f4d1f7.07f8d](http://192.168.2.10:1880/#)msg : Object

object

topic: ""

payload: object

on: true

bri: 171

duration: 5000

\_msgid: "82e4f1d9.fe024"

this is the output when i inject the exact same code and it turns the light on.  
8/20/2018, 8:14:25 PM[node: a830ea75.5221f8](http://192.168.2.10:1880/#)msg.payload : Object

object

state: object

on: true

bri: 171

colormode: "rgb"

hex: "#ab8a6f"

hue: 4929

sat: 89

name: ""

raw: object

name: ""

power: "on"

bright: "67"

rgb: "11242095"

ct: "4000"

hue: "359"

sat: "100"

color\_mode: "1"

delayoff: "0"

flowing: "1"

flow\_params: ""

music\_on: "0"

here is the flow:

[{"id":"da41a101.b50c","type":"schedex","z":"4e43db21.ba2014","name":"","suspended":false,"lat":"-7.36","lon":"111","ontime":"","ontopic":"","onpayload":"1","onoffset":0,"onrandomoffset":0,"offtime":"","offtopic":"","offpayload":"2","offoffset":"","offrandomoffset":0,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":470,"y":1440,"wires":[["5daba965.9a26a8"]]},{"id":"a1a15b61.302d38","type":"debug","z":"4e43db21.ba2014","name":"","active":true,"console":"false","complete":"true","x":390,"y":1340,"wires":[]},{"id":"43f4d1f7.07f8d","type":"debug","z":"4e43db21.ba2014","name":"","active":true,"console":"false","complete":"true","x":790,"y":1340,"wires":[]},{"id":"784c4557.06acac","type":"ui\_text\_input","z":"4e43db21.ba2014","name":"","label":"alarm time","group":"443e46f0.105dd8","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":170,"y":1440,"wires":[["a1a15b61.302d38","7411e8af.4e9548"]]},{"id":"7411e8af.4e9548","type":"function","z":"4e43db21.ba2014","name":"","func":"msg.payload = "ontime "+msg.payload\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":1440,"wires":[["da41a101.b50c"]]},{"id":"1a63cf00.500a11","type":"inject","z":"4e43db21.ba2014","name":"","topic":"","payload":"{"on":true,"bri":171,"duration":5000}","payloadType":"json","repeat":"","crontab":"","once":false,"x":700,"y":1540,"wires":[["18ae08e9.92cfa7"]]},{"id":"5daba965.9a26a8","type":"trigger","z":"4e43db21.ba2014","op1":"{"on":true,"bri":171,"duration":5000}","op2":"{"on": false}","op1type":"json","op2type":"json","duration":"2","extend":false,"units":"min","reset":"","name":"","x":630,"y":1440,"wires":[["43f4d1f7.07f8d","18ae08e9.92cfa7"]]},{"id":"18ae08e9.92cfa7","type":"yeelight-compat-hue-out","z":"4e43db21.ba2014","name":"side room","server":"ff3a37f7.313238","x":840,"y":1440,"wires":[]},{"id":"443e46f0.105dd8","type":"ui\_group","z":"","name":"Wake-up light","tab":"5be6df44.2a324","order":4,"disp":true,"width":"6"},{"id":"ff3a37f7.313238","type":"yeelight-compat-hue-config","z":"","hostname":"192.168.2.43","port":"55443","name":"Side room"},{"id":"5be6df44.2a324","type":"ui\_tab","z":"","name":"Lights","icon":"dashboard"}]

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [20 August 2018 15:03 UTC](https://discourse.nodered.org/t/same-output-different-response/2417/2 "2018-08-20T15:03:10Z")

</div>

It is not possible to import your flow. I had to tweak it (hopefully without modifying the flow). However you use a couple of nodes that I dont have installed, so no way to test...

I provide the flow below in case someone else is able to test...

```auto
[{"id":"5fad6bd0.7cfee4","type":"tab","label":"Flow 14","disabled":false,"info":""},{"id":"66888d35.634744","type":"schedex","z":"5fad6bd0.7cfee4","name":"","suspended":false,"lat":"-7.36","lon":"111","ontime":"","ontopic":"","onpayload":"1","onoffset":0,"onrandomoffset":0,"offtime":"","offtopic":"","offpayload":"2","offoffset":"","offrandomoffset":0,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":430,"y":240,"wires":[["a379234d.6146d"]]},{"id":"d470f214.feb35","type":"debug","z":"5fad6bd0.7cfee4","name":"","active":true,"console":"false","complete":"true","x":350,"y":140,"wires":[]},{"id":"3e48c02a.0021d","type":"debug","z":"5fad6bd0.7cfee4","name":"","active":true,"console":"false","complete":"true","x":750,"y":140,"wires":[]},{"id":"1f8ab593.d4346a","type":"ui_text_input","z":"5fad6bd0.7cfee4","name":"","label":"alarm time","group":"5bff1923.8549b8","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":130,"y":240,"wires":[["d470f214.feb35","a7dfb974.2f9cd8"]]},{"id":"a7dfb974.2f9cd8","type":"function","z":"5fad6bd0.7cfee4","name":"","func":"msg.payload = \"ontime \"+msg.payload\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":240,"wires":[["66888d35.634744"]]},{"id":"a615e041.5d89f","type":"inject","z":"5fad6bd0.7cfee4","name":"","topic":"","payload":"{\"on\":true,\"bri\":171,\"duration\":5000}","payloadType":"json","repeat":"","crontab":"","once":false,"x":660,"y":340,"wires":[["1aba9e3e.d3c682"]]},{"id":"a379234d.6146d","type":"trigger","z":"5fad6bd0.7cfee4","op1":"{\"on\":true,\"bri\":171,\"duration\":5000}","op2":"{\"on\": false}","op1type":"json","op2type":"json","duration":"2","extend":false,"units":"min","reset":"","name":"","x":590,"y":240,"wires":[["3e48c02a.0021d","1aba9e3e.d3c682"]]},{"id":"1aba9e3e.d3c682","type":"yeelight-compat-hue-out","z":"5fad6bd0.7cfee4","name":"side room","server":"ff3a37f7.313238","x":800,"y":240,"wires":[]},{"id":"5bff1923.8549b8","type":"ui_group","z":"","name":"Wake-up light","tab":"d4ffad50.d1a35","order":4,"disp":true,"width":"6"},{"id":"d4ffad50.d1a35","type":"ui_tab","z":"","name":"Lights","icon":"dashboard"}]

```

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [20 August 2018 15:36 UTC](https://discourse.nodered.org/t/same-output-different-response/2417/3 "2018-08-20T15:36:25Z")

</div>

1. what node are you using to communicate with the light?
2. I notice a lot of differences between the debug outputs

try to send the same data and see what happens.

---

<div class="post-metadata">

### Author: ![jarcher12](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@jarcher12](https://discourse.nodered.org/u/jarcher12)
#### Post date: [20 August 2018 19:58 UTC](https://discourse.nodered.org/t/same-output-different-response/2417/4 "2018-08-20T19:58:46Z")

</div>

thanks both for responding the node i use is this one

> **[node-red-contrib-yeelight-compat-hue](https://flows.nodered.org/node/node-red-contrib-yeelight-compat-hue)**
>
> A collection of Node-RED nodes for controlling and observing Yeelight lighting devices, compatible with node-red-contrib-node-hue flows.

i am sending the exact same data to the node just one from an inject and one from a trigger node thats what has me confounded  
i mean i copied and pasted the data from one to the other  
i forgot to say that when it runs it seems to crash and reset the dashboard  
and even more confusing i am able to send data to the same node on the same page from a function node but that doesnt work in this flow so color me confused  
its 3 in the morning here so more testing tomorrow

---

<div class="post-metadata">

### Author: ![jarcher12](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@jarcher12](https://discourse.nodered.org/u/jarcher12)
#### Post date: [20 August 2018 20:39 UTC](https://discourse.nodered.org/t/same-output-different-response/2417/5 "2018-08-20T20:39:16Z")

</div>

i did some more tesing and it seems the schedex node is to blame  
i switched it with the bigtimer and the flow works fine  
thank you for your help
