csuermann / node-red-contrib-presence-faker

Node-RED node that fakes presence in a smart home by switching devices (e.g. lights) on and off at random times.
MIT License
23 stars 2 forks source link

Presence Faker node delete all the data on the message at the output. #35

Closed Seba-VT closed 2 years ago

Seba-VT commented 2 years ago

The node only outputs the "topic", "payload" and "_msgid" rather than the whole input message. Is there any setting to let the node output the complete message?

As you can see at the screenshot, the message at the input (node: deb1) have a lot of information, but at output (node: deb2) all the data is gone.

image

csuermann commented 2 years ago

Hi @Seba-VT,

I'm not quite sure what you're trying to accomplish here. The presence-faker node is not processing inbound messages with the exception of dynamic configuration overwrites.

What you screenshot is showing (I think) is an inbound msg with a payload property of true, which activates the presence-faker node. Upon receiving, it generates a random schedule according to your configuration and immediately outputs a new msg object with the msg.topic "" and msg.payload false as configured in the node.

Seba-VT commented 2 years ago

Hi @csuermann,

You are correct, the node is doing what it is supposed to do. But, my issue here is that the node won't output the complete inbound message. In my case I need the T1_Entity_ID information at the output of the node, but the Presence Faker, apparently, deletes all the message and create a new one with his new information, in this case, with the payload set to false.

I hope I explained the issue better this time, sometimes is hard to explain something when you are not fluent in English.

I resolved my issue temporarily by putting a function node that stores all the data on flow variables before the Presence Faker and then another function node that retrieves the flow variables and joins it with the message at the output.

csuermann commented 2 years ago

Glad to hear you found a workaround. I'm closing this issue as presence-faker is not meant to forward inbound messages.