cinhcet/node-red-contrib-component-dashboard

Add Element Properties

Opened this issue · 4 comments

I think it would be helpful, if you add an element properties (e.g. "paperButton1", ..) to the messages.

This would simplify further processing.

you mean that the msg object should contain the elementId ?
What would be a use case for that?

For example: for my roller shutter, I have several buttons (roller shutter 1 up/middle/down, roller shutter 2 ...). I would like to send the Messages from all Buttons to one function node. These function node creates the necessary commands and then send them to the shutter.

Without the information I would have to set a node behind each button node, which would either create the commands or add the information from which button the message comes.

maybe it make sense to use msg.topic for this.

Or look at the "node red dashboard" implementation:
bildschirmfoto vom 2019-01-21 20-38-04

ahh, I thought you meant that each node should automatically append its elementId for example, which I do not like.
However, what you describe makes sense. And, for your information, I already implemented it that you can configure the payload as json, string, number etc. (like the inject node) for a button press.

Since I am a bit busy at the moment, this will have to wait until the next release. I plan to make final little refactoring chances and then release version 1.0.0

please have a look at the updated version