# Deconz-out with transition time

**URL:** https://discourse.nodered.org/t/deconz-out-with-transition-time/43322
**Category:** General
**Created:** [28 March 2021 15:35 UTC](https://discourse.nodered.org/t/deconz-out-with-transition-time/43322 "2021-03-28T15:35:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![WordsOfMe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wordsofme/32/39388_2.png) [@WordsOfMe](https://discourse.nodered.org/u/WordsOfMe)
#### Post date: [28 March 2021 15:35 UTC](https://discourse.nodered.org/t/deconz-out-with-transition-time/43322/1 "2021-03-28T15:35:40Z")

</div>

Hello,  
I am trying to get the colour effects output of the **Hue Magic** node (node-red-contrib-huemagic) to my Zigbee lights via the **deconz-out** node (node-red-contrib-deconz). Basicall **Hue Magic** outputs a colour hex-code and a transition time, of which I convert the hex to HSV values and adjust those in range.

As I need to feed two parameters (e.g. Hue and Transition Time) into each **deconz-out** node I wanted e.g. the Hue value be read from _msg.payload.hsv.hue_ and the Transition Time from _msg.payload.transitionTime_. However, this does not work. I always get an "invalid value for parameter" error.

Setting a fixed transition time and msg.payload as payload in **deconz-out** , plus adding a **change** node to move _msg.payload.hsv.hue_ to _msg.payload_ in the upstream would make everything work, albeit ignoring the transition time.

Flow:

 ![flow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/c/5c3d7d40ffe377b50b074675bd689ac6fb9931eb.png)

deconz-out settings:  
 ![deconz-out](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/7/c7d964b31fbad9767cffb13cd9b06a83847983a7.png)

What am I doing wrong?  
I hope this is not too much of a noob question... 🙂  
Stefan

---

<div class="post-metadata">

### Author: ![steff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steff/32/80733_2.png) [@steff](https://discourse.nodered.org/u/steff)
#### Post date: [29 March 2021 10:02 UTC](https://discourse.nodered.org/t/deconz-out-with-transition-time/43322/2 "2021-03-29T10:02:39Z")

</div>

Is msg.payload.transitionTime still present after the Color Converter Node? I would not be surprised if msg.payload is completely overwritten with the HSV values. If this is the case, I would copy the variable to another place before, e.g. msg.transistiontime or as flow variable.  
You could also pack everything into a json object for the deconz out node and select "object json" as option command. Then you would only need to use one deconz out node.

 ![Unbenannt](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/d/cd79263fa845645a4ed95abafdd15163f562f098.png)

---

<div class="post-metadata">

### Author: ![WordsOfMe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wordsofme/32/39388_2.png) [@WordsOfMe](https://discourse.nodered.org/u/WordsOfMe)
#### Post date: [29 March 2021 22:47 UTC](https://discourse.nodered.org/t/deconz-out-with-transition-time/43322/3 "2021-03-29T22:47:46Z")

</div>

...thanks steff, I got this up and running by packing the required data into a JSON object as you suggested, following the [deconz API documentation](https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/lights/#parameters_2). 🥳

This is the flow:

```auto
[{"id":"a2d6592.5f6dfa8","type":"hue-magic","z":"a26c11c5.cbe52","name":"Night Sky","endless":true,"restore":false,"preset":"003-nightsky","steps":"[{\"delay\":0,\"animation\":{\"hex\":\"#0029ff\",\"transitionTime\":15}},{\"delay\":0,\"animation\":{\"hex\":\"#6ca9ff\",\"transitionTime\":15}}]","x":520,"y":780,"wires":[["e13ac6cb.6b0e78"]]},{"id":"e13ac6cb.6b0e78","type":"node-red-contrib-colorspace","z":"a26c11c5.cbe52","name":"","target":"payload","x":680,"y":780,"wires":[["489e9ae.4565864"]]},{"id":"4bcb9d42.6ccbb4","type":"rbe","z":"a26c11c5.cbe52","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":370,"y":780,"wires":[["a2d6592.5f6dfa8"]]},{"id":"99e6ea66.95e218","type":"deconz-output","z":"a26c11c5.cbe52","name":"","server":"a2a0bebe.0f766","device":"group_29","device_name":"○ RGB Wohnzimmer","command":"json","commandType":"object","payload":"payload","payloadType":"msg","transitionTime":"","transitionTimeType":"num","x":1120,"y":780,"wires":[]},{"id":"489e9ae.4565864","type":"function","z":"a26c11c5.cbe52","name":"deconz JSON","func":"if (typeof msg.payload.on !== 'undefined') {\n \n var on = msg.payload.on;\n var hue = msg.payload.hsv.hue;\n var sat = msg.payload.hsv.saturation;\n var bri = msg.payload.brightness;\n var transitiontime = msg.payload.transitionTime;\n \n delete msg.animation;\n msg.payload = {};\n msg.payload.on = on;\n msg.payload.transitiontime = transitiontime;\n msg.payload.hue = Math.round(hue / 360 * 65535);\n msg.payload.sat = Math.round(sat / 100 * 255);\n if (typeof bri !== 'undefined') {\n msg.payload.bri = Math.round(bri / 100 * 255);\n }\n \n return msg;\n\n} else {\n return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":780,"wires":[["99e6ea66.95e218"]]},{"id":"a2a0bebe.0f766","type":"deconz-server","name":"node-red.example.com","ip":"192.0.2.100","port":"80","ws_port":"443","secure":false,"polling":"15"}]

```

I'll have to add a routine for randomizing colours in the deconz JSON node, but everything else looks good so far.

Thanks again! 🙂  
Stefan

---

<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: [12 April 2021 22:48 UTC](https://discourse.nodered.org/t/deconz-out-with-transition-time/43322/4 "2021-04-12T22:48:27Z")

</div>

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