NodeRed - multiplus to ON if SOC < 20%

Help Nodered

Good morning

I have a nodered command line that switches multiplus to ON if SOC < 20%
and switches the Multiplus to INVERTER ONLY if SOC > 20%
It works very well
Picture 1

My question:
I would like to be able to activate and deactivate this line so I thought we could use the Relay button
I would like this automation to only work if the relay 1 button is activated
But I can’t set it up under nodered
I tried photo 2 but it doesn’t work

Can you help me?

THANKS
Sebastian

-------------------------------- French below
Bonjour

J’ai une ligne de commande nodered qui passe le multiplus sur ON si le SOC < 20%
et passe le Multiplus sur INVERTER ONLY si SOC > 20%
Ça fonctionne très bien
Photo 1

Ma question :
J’aimerai pouvoir activer et désactiver cette ligne donc je me suis dit qu’on pouvait utiliser le bouton du Relay
J’aimerai que cette automatisation fonctionne uniquement si le bouton relay 1 est activé
Mais je n’arrive pas le mettre en place sous nodered
J’ai essayé photo 2 mais ça ne fonctionne pas

Pouvez vous m’aider ?

Merci
Sébastien

Hi and welcome.
I find that when more control is needed it is better to write a function and set conditional global/flow variables as a test for whether something should run or not.
It is more “programmy” and the purists who like these enormous nodered snail-trails might disagree :wink:

There are some good online web tutorials if you dig around.

You can also solve this with the join node. Set to manual and it will create one message with both payloads, split by topic. Check node red documentation for exact details.

You will then be able to reference the following, depending on your topic names:
msg.payload.soc and msg.payload.relay2

Use these in the switch node expressions

Hello thank you for the quick response,

I’m a beginner with nodered

I found the join node, can you help me configure it for my use?

help me in the case applied to my example please

Thanks in advance

Good morning,
I advanced with the join node, with 2 playloads (playload.soc and playload.relay2)

On the other hand my problem now is that the joinnode function does not update itself

how to do it?

THANKS

I only use the function node. So I totally agree. :stuck_out_tongue: