Node-RED: Sending multiple commands to dimmer

I have recently added a dimmer (Ultrapro) and I wanted to always set the level to 25% when it is turned on (in case someone messes with the level manually). Currently I am doing this in two steps - msg.command = on and then a device node with setLevel hardcoded to 25.

Q1: Is there a way to send both commands at the same time?
Q2: What would be the correct syntax for msg.command if I wanted to set the level in the flow (not hardcoded in the device node). Would it be msg.command = setLevel,25?

Thanks for your help

I have a couple of those and don't send an On.. just the setlevel. If it's non-zero, that's the level it goes to. "On" is implied. I understand that there are brands that don't behave like this. I don't have any and would return them if I found I had gotten one :smiley:

3 Likes

Thanks for the tip - let me try that.

That seemed to work but only when I hardcoded it in the device node. I was using msg.command = setLevel, 25. I also tried msg.command=setLevel;25. Thoughts?
There is also an odd "flashing" behavior when it turns on/off - not sure what that is about.

Screenshot 2024-12-12 at 5.52.50 PM
Works for me. The Above is an experiment. The OFF node is hardcoded.

Screenshot 2024-12-12 at 5.53.01 PM
The dimmer node has no Arguments, but hints at the format.

Screenshot 2024-12-12 at 5.52.39 PM
The two Change nodes set two different levels like that.

It could have been "24, 30" to have a 30 second ramp.

2 Likes

msg.command = setLevel
msg.arguments = 25

msg.command is a string.
msg.arguments is a number, but the hubitat nodes are forgiving, so you want to specify a ramp time, you can make it a string (like "25,30")

You can have a single change node in which you set both msg.command and msg.arguments.

2 Likes

Thanks so much @csteele and @aaiyar. I’ve used msg.command and msg.arguements before but completely forgot the syntax! :pray::pray::pray:

3 Likes

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