Huemagic increment brightness with procent?

I’m running Huemagic within Node red in Hassio.
I want to to able to increase/decrease brightness with for example +30, not set brightness 30. I read about that I should be able to do incrementBrightness but it’s not working when i try using Change node. Even tried to do it via function node but I’m not good at programing so just got it to set brightness but not for example msg.payload.incrementbrightness as I thought would be the correct message.

Sorry for noob question but how do I solve this? :slight_smile:
Thanks in advance!

what node are you using for your HUE… there are different nodes available to handle HUE lights. Some of them allow direct control on brightness (absolute and relative). see node-library

You should not use the HA Change-Node to modify HUE!

Huemagic. I have been using that to see lights/sensors and get them into node red but they are there only like entities not any way to control but maybe I dont understand how to use them correctly. What node should I use to change if not Change node?

Huge thanks for your answer and effort!

When using the Huemagic nodes you can directly control the brightness incrementally by sending “msg.payload.incrementBrightness” to your light node.

Maybe you can share your node sequence so I know what you are trying so far.

I did a new flow and tested this. Using only regular brightness works but “incrementBrightness” doesn’t do anything.

Heres my test flow.

[{“id”:“1ffc6b46.8b1c25”,“type”:“inject”,“z”:“71a28332.a9335c”,“name”:"",“topic”:"",“payload”:"{“incrementBrightness”:50}",“payloadType”:“json”,“repeat”:"",“crontab”:"",“once”:false,“onceDelay”:0.1,“x”:110,“y”:271,“wires”:[[“d33f00aa.d3c89”,“d7746f6a.e59a5”]]},{“id”:“d33f00aa.d3c89”,“type”:“hue-light”,“z”:“71a28332.a9335c”,“name”:“Kök tak”,“bridge”:“6005b0be.e4595”,“lightid”:“6”,“colornamer”:true,“x”:409,“y”:261,“wires”:[[“f6e7ac1d.52e8d”]]},{“id”:“d7746f6a.e59a5”,“type”:“debug”,“z”:“71a28332.a9335c”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“x”:382,“y”:169,“wires”:[]},{“id”:“f6e7ac1d.52e8d”,“type”:“debug”,“z”:“71a28332.a9335c”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“false”,“x”:609,“y”:177,“wires”:[]},{“id”:“6005b0be.e4595”,“type”:“hue-bridge”,“z”:"",“name”:“Philips hue”,“bridge”:“192.168.0.15”,“key”:“9AD9LgeN01xTm4XIdv6NtFBxDT387tV767jA0B8G”,“interval”:“1300”}]

Thanks so much again!

Did you succeed to manage your light? I try to do the same but nothing is working.

Here is my flow:

[{"id":"102a25f1.a71a6a","type":"function","z":"e2a7aef6.1e5a9","name":"set bri","func":"if (msg.payload===true)\n{\nmsg.payload =  {\"decrementBrightness\":-10} ;\nreturn msg;\n}\nif (msg.payload===false)\n{\nmsg.payload =  {\"incrementBrightness\":10} ;\nreturn msg;\n}\nreturn null;\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":250,"y":740,"wires":[["abe138fb.af12e8","c6660c0f.4fe1a"]]},{"id":"c6660c0f.4fe1a","type":"hue-light","z":"e2a7aef6.1e5a9","name":"Salle à manger","bridge":"ed539dda.0eeb9","lightid":"1","colornamer":false,"skipevents":false,"universalevents":false,"x":480,"y":740,"wires":[[]]},{"id":"abe138fb.af12e8","type":"debug","z":"e2a7aef6.1e5a9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":330,"y":660,"wires":[]},{"id":"ae29bb87.af4978","type":"inject","z":"e2a7aef6.1e5a9","name":"True","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":90,"y":660,"wires":[["102a25f1.a71a6a"]]},{"id":"e1b0912e.00607","type":"inject","z":"e2a7aef6.1e5a9","name":"False","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":90,"y":800,"wires":[["102a25f1.a71a6a"]]},{"id":"ed539dda.0eeb9","type":"hue-bridge","name":"LumiereRomelie","bridge":"192.168.1.6","key":"NL3-0NnY0S6GZ227stSfBD3u41fDMjFzXVxDfgUe","interval":"3000","disableupdates":false}]

I was looking for something else and stumbled upon your post, just having a quick glance at your export it says "decrementBrightness":-10 but that should actually increment the brightness too, as the value is negative.
decrementBrightness was actually added in February 2020 to avoid this kind of confusion.

In short: using incrementBrightness with a negative value decrements the brightness, using decrementBrightness with a negative value increases the brightness :wink: