Closed bartbutenaers closed 4 years ago
I can understand your idea behind this request, but I am sorry to disagree. The settings are already complicated enough and I would rather not make them even more complicated. Also all the nodes, that I have used so far use the same approach es my node does.
If there is a bigger group of people all requesting this change I might reconsider, but for the moment I will not change it. Maybe you can use a subflow to create one node, that has got the desired behavior. https://nodered.org/docs/user-guide/editor/workspace/subflows
@bartbutenaers Just found this fantastic node, but ran into the same problem as you. Can i ask if you found a solution? And of course thanks alot to the creator of the node.
Hi @SalkinDK, Unfortunately I had no time yet to build my own solution. Bart
@bartbutenaers ok, i tried to fiddle around with it yesterday. My workaround is to put the dimmer node into a subflow. in the subflow i store the info i need, in my case the entity of the lamp in hass, as a flow variable then run through the dimmer node and on the other side restore the flow variable before sending the payload.
Hope it can help somebody in the same situation. :)
Hi @Woozinator,
My best wishes for 2020!
In the following example flow, the input message contains RGB values:
Currently the output message only contains your dimmer value in the payload, but our RGB values are thrown away. Which is normal behaviour, since you create a new object from scratch:
It would be nice if your output message could be based on the input message, so our input message data would be kept unchanged (apart from the payload content of course).
If you would agree to implement that, I 'think' you can do it like this:
Remark: the cloning is really required! If you would pass the same input message N times to the output, this would result in very weird effects. Because you would end up with N references to the same message object. So at every tick you would end up overwriting the previous value (in the same msg object)!
Thanks again for your time! Bart