Search code examples
ibm-cloudnode-redwatsonwatson-iot

Node-RED action not fired after rule on Watson IoT Platform


I'm currently using Watson IoT Platform to collect datas from my raspberrypi.

I created a rule based on a threshold and three actions if the rule is activated:

  • the first one is a Node-RED action invoking a Node-RED node on Bluemix
  • the second one is another Node-RED action invoking a Node-RED node on my raspberry pi
  • the third one is a simple "send mail"

The first two actions are never fired while the email is always correctly sent.

My Node-RED node on BlueMix is at the following url: https://xxx.eu-gb.mybluemix.net and the http endpoint is /command so the URL I configured is https://xxx.eu-gb.mybluemix.net/command.

What is wrong with this configurations?

Thanks,

Diego


Solution

  • The http in node must use POST as the method. Here is a sample flow which when triggered writes to a debug node.

    [{"id":"7ad184c7.c898cc","type":"debug","z":"ed48ac5f.aa6c68","name":"","active":true,"console":"false","complete":"false","x":443.9000244140625,"y":289.79998779296875,"wires":[]},{"id":"f269a1cd.d46d5","type":"function","z":"ed48ac5f.aa6c68","name":"","func":"msg.payload= \"Hello from my IoT Platform Rule\";\nreturn msg;\n","outputs":1,"noerr":0,"x":396.90000915527344,"y":201.59999084472656,"wires":[["aa867d6d.2b6518","7ad184c7.c898cc"]]},{"id":"e9a7c24c.2c8128","type":"http in","z":"ed48ac5f.aa6c68","name":"/inventory","url":"/inventory","method":"post","swaggerDoc":"","x":203.90000915527344,"y":206.99998474121094,"wires":[["f269a1cd.d46d5"]]},{"id":"aa867d6d.2b6518","type":"http response","z":"ed48ac5f.aa6c68","name":"","x":578.9000091552734,"y":207.40000915527344,"wires":[]}]