I have a node red automation that turns on a GE Enbrighten (not dimmer) switch to a light fixture with a hue bulb in it when motion is detected on a motion detector. It is also set up with a trigger to turn the light on then turn it off after a specified time when no motion is detected. All of this is working correctly.
Now I want to add an additional complication. Once the switch turns on the fixture, I want node red to set that hue bulb to a specific brightness (ex. 50%). I’m not sure where to specify the brightness. Do I do it in the Call Service node that turns on the switch or do I set up a separate node since the bulb is a separate entity than the switch and then set it in that node? Once I know which node, where do I specify the brightness?
Any help you can provide would be greatly appreciated.
It does not receive power and I’m okay with a short delay. Would I just chain those two service call nodes together sequentially or run them in parallel from the trigger node?
@michaelblight I tried what you suggested, but I must have done something wrong. I’ve included a couple of screenshots. Does this look correct or can you see what I’ve done incorrectly.
Brightness should be just a number rather than an array, so:
{ "brightness_pct": 50 }
I’m guessing that’s why you’re getting an error. What I tend to do is fill out the details in the UI of the Services tab of Developer Tools, then go to YAML mode and manually convert the YAML to JSON for Node Red (or use this site to convert).
As mentioned, you might also want to look into using a “wait until” node rather than a delay, in case it takes more than 3 seconds for the bulb to appear available.