ioBroker / ioBroker.node-red

Instantiate the server with node-red
Apache License 2.0
52 stars 27 forks source link

Add "sendTo" Node to send messages to adapters #291

Closed Apollon77 closed 9 months ago

Apollon77 commented 2 years ago

e.g. for Telegram and other cases where we want request/response like communication and adapter supports it

Sineos commented 2 years ago

I'd really appreciate this feature. In my use case it would be valuble for working with homematic methods from within NR, e.g. putParamset, reportValueUsage, rssiInfo etc.

setfire2 commented 1 year ago

I would also definitely make use of it.

setfire2 commented 1 year ago

This would allow me to get rid of the Javascript adapter completely.

klein0r commented 9 months ago

Like this? FYI @mickym2

You can specify the instance and the command (default is send if empty). And the payload of the msg object is used as the message for sendTo. Output is the result of the message callback.

Screenshot 2023-11-16 at 20 57 16 Screenshot 2023-11-16 at 21 33 57

same result as this blockly:

Screenshot 2023-11-16 at 21 42 13
mickym2 commented 9 months ago

No not only to the pushover adapter - General a Node which you can use to use directly the sendTo functionality to any iobroker adapter like the generic sendTo puzzle piece.
image So you can decide which and how many parameters you want to send.

Therefore I didn't understand, why this new puzzle was created:

image

with the generic, existing piece you could send messages to the mqtt adapter as well.

image

So within the node the adapter which should be addressed should be selectable, the command should be specified and variable options for parameters as requested by the adapter. Same functionality as the generic SendTo puzzle in blockly.

klein0r commented 9 months ago

No not only to the pushover adapter

Of course... I've thought the pushover example is self explanatory

Screenshot 2023-11-16 at 21 33 57
mickym2 commented 9 months ago

yes and then you need different parameters or objects depending on the receiving adapter.

klein0r commented 9 months ago

and then you need different parameters

At the moment msg.payload is used. The example above is the same as this blockly:

Screenshot 2023-11-16 at 21 42 13

Please draw a mockup what do you expect.

mickym2 commented 9 months ago

No then its fine - so the payload is then an object with different properties as requested by the adapter!

klein0r commented 9 months ago

the payload is then an object with different properties as requested by the adapter

Yes, and the output message object contains the result.

I will add the possibility to set msg.instance and msg.command also via the msg object for maximum flexibility.

mickym2 commented 9 months ago

Great