Node Red - Shelly Pro 3

Hello

i have a Shelly Pro 3 (3 phases can be switched separately)
Manuel works very well
ID 0=Phase 1
ID 1=Phase 2
ID 2=Phase 3

i try to do this over the funktion note it doesn’t work
I see that the output syntax is not the same, but I’m not sure how to adjust it.

infos:
Shelly API : Switch | Shelly Technical Documentation

Thank you
Roberto

Your logic (if…else if) is not correct.

„if xyz>2000“ means that everything after the „else“ will only be executed if xyz is <=2000. So it will never be >6000 or >8000 there.

And, of course, the „parameters“-object belongs into the payload.

Just delete the else-statements and make a chain of if-then cases. And yes, the msg1 should look like this:
msg1 = { firstvalue : value1,
secondvalue : value2 }

Or sort it just the other way round. >8000, >6000, and then >2000.