For the life of me I cannot call service with function node. Can someone please explain basics how to send payload from inject/function to event node?
I managed to get a working example by filling the Data attributes inside event node. I can activate this node by using timestamp injection or switch node which triggers event based on VOC level readings: Imgur: The magic of the Internet
As first step I have created two identical event nodes with different profiles which are being called based on the VOC sensor reading levels. VOC levels which are over threshold calls {“preset_mode”: “Boost”} and below threshold {“preset_mode”: “Home”} is being called.
For the next step, I would like to use function node which would send preset_mode via payload. This would give more flexibility to build custom logic with more sensors which would trigger the preset_mode accordingly.
Prior writing code for function node, I tried to inject msg.payload {“preset_mode”: “Boost”}. The event node is the same as in example above, but with empty “Data” field. I was hoping the msg.payload will fill this field and trigger an event with payload value.
Instead, Im getting errors. Please see screenshot with debug information included: Imgur: The magic of the Internet
Can someone please help to understand why event node wont accept the payload from inject node?
Thank you very much!