Need help and I'm an absolute beginner

I will create an Flow, where the Friends of hue Switch (there are 4 Buttons) send an 1 to garden door if I press the button.

I don't know which node I have to use for that and I have no idea how I get an "1" to the "Gartentor" output.... so long I press the Button 1.

In the picutre attached you see, what I get on the Debug Note, when I press the Button 1.

I would be really a pleasure, if someone helps me... I have no Idea.....

Thanks a lot

Hi @logol01, welcome.

first you need to use the switch node to route your message according to the action, then using a change node you can set the payload to what ever you require.
If you use a debug node and use the copy value button that appears when you hover near the object name, you can then post a copy of the incoming objects. I could then use that to post an example flow for you.

You should take some time and read through the node-red docs and watch the videos, as this will help you understand many things, including how to share info and how message routing work and how to share flows, import/export.
When sharing code on this forum it is best to use the </> button in the post editor

1 Like

I found an other solution....
This works perfect for my Problem.

I used a fuction node with the following code:

const Button = msg.payload.button;
const Action = msg.payload.action;

if(Button === 1 && Action === 'initial_press'){
return {payload: 1}
}
if(Button === 1 && Action === 'short_release'){
return {payload: 0}
}
return msg;

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