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
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":[]}]
Related
I am trying to use node-red to connect to my Watson chatbot using the Watson assistant v2 node. For some reason, I keep getting forbidden returns and It doesn't seem to connect properly? Has anyone managed to successfully connect to a Watson service using Node-red?
I am not sure the correct combination of API key or ID to connect to the correct service
In the Watson Assistant UI go to the Assistant you want to use, then to the Settings section. The Assistant ID and URL are shown, then in the Service credentials section the API key.
Enter them in the configuration of your node.
For those who came late for this question:
To use IBM watson node-red nodes
search for the service in IBM cloud.
Create the service.
Get the credentials.
Go to node-red editor and paste the credentials (API key + URL)
In view
https://cloud.ibm.com/resources
I m having two elements
Cloud Foundry services -> App Connect
Services -> MQ
Within App Connect I would like to use MQ.
How do I tell cloud.ibm.com that the two shall work with each other?
In appconnect.ibm.com/create I would like to work with that MQ - but don't know how.
In appconnect.ibm.com/catalog/apps -> MQ I also do not see a smart way to connect to MQ.
I just deployed IBM MQ and IBM App Connect to test this. In this example, I connect to MQ from App Connect and deploy a flow that is triggered when a message arrives on DEV.QUEUE.1. The flow then puts a new message, copying the payload from the first, on to DEV.QUEUE.2. It looks like you already have IBM App Connect and IBM MQ services deployed, so I will dive straight into the configuration of MQ and the App Connect flow. Here's the steps I took:
On the MQ cloud deployment I followed the guided tutorial, created a Queue Manager QM1 and then created, and downloaded an API key. I made a note of the username shown on the Application Credentials page.
I also made a note of the Connection Information shown for my Queue Manager on the Queue Managers page. This information can also be downloaded by clicking the Connection Information button at the top right corner of the page.
In the IBM App Connect Catalog view, I added IBM MQ as an application and created a new account Account 1.
I then populated the account configuration with the Queue Manager details collected in Step 2.
In the App Connect Dashboard view, I created a new Event-driven flow, Selected MQ from the applications list, Account 1 and New message on a queue
I entered the inbound queue name DEV.QUEUE.1
I completed the flow by again selecting MQ from the Applications list, then Put message to a queue and this time I entered the queue name DEV.QUEUE.2.
I then started the flow using the menu in the top right corner.
To open the IBM MQ Console for testing, I selected Administer for my Queue Manager in the resource list view.
Finally, I logged into the IBM MQ Console, selected Manage, clicked on DEV.QUEUE.1 and then Create to put a simple test message. Returning back to the Manage view, I could see my message had been processed by IBM App Connect and was now on DEV.QUEUE.2.
Is there a way to see who was creating a app or a service in Bluemix where I have multiple users/developers in a org/space ?
Espen
Using the Bluemix CLI you can find out about the events associated with an application by using the command:
bx app events <application_name>
There is not a similar command for services.
When you look at the Overview of an application, in the Activity Feed you can see a username associated with every Start, stop, and update of the app.
I'm able to use the node-red-node-watson library to call an instance of Watson Conversation hosted in the US-South region of IBM Cloud. If I try it in the Germany region, it does not work.
In github I spotted the following line
ConversationV1.URL = 'https://gateway.watsonplatform.net/conversation/api';
which is the URL for Conversation in US-South. The URL shown in Bluemix VCAP_SERVICES for the Frankfurt instance is different:
"https://gateway-fra.watsonplatform.net/conversation/api"
I'm not sure if the hard-coded URL is just a default and I just missed the code reading the actual URL from VCAP_SERVICES or if this is actually a bug.
Has somebody successfully used the Node-RED node for Watson Conversation within a region other than US-South?
When you initialize the Conversation object it should be possible to set the correct base URL. This is for Node SDK, not Node-RED:
// Create the service wrapper
var conversation = new Conversation({
username: '<username>',
password: '<password>',
url: 'https://gateway-fra.watsonplatform.net/conversation/api',
version_date: Conversation.VERSION_DATE_2017_04_21
});
I more familiar with the Python SDK and there the same (only in Python :) is working successfully for me.
For Node-RED there are two scenarios. When the Conversation service is bound to the Node-RED app, then the credentials including URL are taken from the VCAP environment. This works for me and should for you. If the service is not bound then there is a "feature gap" based on the Conversation Node source code.
I am working with the Node-RED editor on Bluemix, and am trying to execute rules that are deployed to the Business Rules service. How do I do so?
I found that I had to bind the app to the Business Rules service instance on Bluemix. Then, in the Node-RED flow editor, I used an http request node, with the following attributes defined with values for the ruleset retrieved from the Details page on the Bluemix console:
Method: POST
URL: https://brsv2-12345678.ng.bluemix.net/DecisionService/rest/MyRuleApp/1.0/myrules/1.0
"Use basic authentication?" checked
Username: resAdmin
Password: <password>
Return: a parsed JSON object