Overview

Skill Level: Intermediate

In this recipe - using Node-RED, Watson IoT Platform, dashDB and Watson Conversation - we will create a chatbot allowing us to ask a sensor questions like: What was the average temperature value you recorded ?, or How bright is day light now ?

Ingredients

[MAY 2018 UPDATE: since the time this recipe was first published in 2017, 2 of the services used here were renamed: the Watson Conversation service is now called Watson Assistant, and the dashDB service is now called Db2 Warehouse. Also, Bluemix is now called IBM Cloud. These are just name changes, i.e. this recipe's principles remain the same, and it will still work with the steps provided - just use the new services names when creating your services, and expect some minor User Interface changes]  

In order to complete this recipe, you will need the following ingredients:

  • Bluemix account
  • a sensor to connect to the Watson IoT Platform. This recipe uses the Texas Instrument TI CC2650 sensor, but we will provide tips on what to tune in the steps of this recipe to make it work for other devices

Step-by-step

  1. Solution Overview and Environment Setup on Bluemix

    SOLUTION OVERVIEW

    In this recipe, we will:

    1. connect a sensor to the Watson IoT Platform
    2. send the sensor data to a dashDB table
    3. write a Watson Conversation dialog that will allow us to ask the sensor questions in plain English about the temperature and light data it sends to the Watson IoT Platform
    4. write a Node-RED application that will wire the Watson IoT Platform, dashDB and Watson Conversation services and create a chatbot interface for the questions and answers    

    Here is an architectural overview of the solution:

    0-Architecture

    ENVIRONMENT SETUP

    Let’s create the Node-RED application that we will use for coding this solution, and connect all required services to it.

    1. First of all, let’s make sure we start with a fresh Bluemix Space. Click on the top-right menu next to your Bluemix account, and click Create a space. Call it RECIPES and click Create. This is the space we will use for this recipe.
    2. On the next page, click Create app. In the Search field, start typing Node-RED and select the Node-RED Starter Boilerplate. Enter Talk to your Sensor Your Initials in the App name field, and click Create. This will lead you to the app dahsboard main page. NOTE: do append your initials at the end of the name (e.g. CL) as if you use just the name Talk to your Sensor, you will get Someone already used the host name ‘Talk-to-your-Sensor’ error message. Note that in the rest of this recipe, we will refer to Talk to your Sensor.
    3. Go to the Connections menu of your app page. Note that as part of the boilerplate, a Cloudant NoSQL databse has been created. We will now add the followings services:
      • Click Connect New, and select the Internet of Things Platform service. Edit the service name to your liking, and click Create. Click Restage.
      • Repeat previous step by adding and connecting first a Watson Conversation service, then the dashDB for Analytics service to your app.
      • Note that after creating the dashDB service, you will not be asked to restage the application, and will be redirected to your Bluemix main dashboard – do wait a couple minutes, then reclick on the Talk to your Sensor app link.

    Your Talk to you Sensor app’s Overview page should now look like this:

    1.1-Dashboard

     

  2. Connect your IoT sensor to the Watson IoT Platform

    This recipe assumes that you know how to register your sensor to the Watson IoT Platform, and how to send your sensor data to the Node-RED Debug output.

    But for reference, the steps to follow to do this for the CC2650 sensor tag can be found in this recipe: Texas Instruments CC2650 SimpleLink™ Bluetooth® Smart BLE SensorTag

    Before proceeding to the next step, you should have:

    1. registered the CC2650 (or another sensor) to the Watson IoT Platform,
    2. created and deployed the simplest 2-nodes flow in Node-RED (i.e. 1 IBM IoT input node connected to 1 Debug node – as per picture below) that sends your sensor data to the Debug tab.

    TIP: whether you use CC2650 of another sensor, take good note of the msg.payload as it appears in the Debug tab. This payload will be our reference for creating the dashDB table in Section 3 and the Watson Conversation Entities in Section 4.

    2-TISensorTag

     

  3. Create a dashDB table and populate it with your sensor data

    Let’s now create the dashDB table that we will populate with the sensor data.

    1. From the Talk to you Sensor app’s Overview page, click on the dashDB fo Analytics service, then Launch it.
    2. In the dashDB interface, click on the Tables menu, then click Add Table
    3. Copy-paste the following DDL code, and click Run DDL. This creates the TIDATA table.
    CREATE TABLE "TIDATA" 
    (
    "MYNAME" VARCHAR(20),
    "AMBIENTTEMP" DOUBLE,
    "OBJECTTEMP" DOUBLE,
    "HUMIDITY" DOUBLE,
    "ACCELX" DOUBLE,
    "ACCELY" DOUBLE,
    "ACCELZ" DOUBLE,
    "GYROX" DOUBLE,
    "GYROY" DOUBLE,
    "GYROZ" DOUBLE,
    "MAGX" DOUBLE,
    "MAGY" DOUBLE,
    "MAGZ" DOUBLE,
    "LIGHT" DOUBLE,
    "TIMESENT" TIMESTAMP
    ); 

    You can check the successful creation of the TIDATA table in the Tables menu: select TIDATA as the Table Name, and check the Table Definition.

    TIP: if, instead of CC2650, you use another sensor that sends different data values to the Watson IoT Platform, you must update the above DDL to match the values that your sensor sends.

    The picture below depicts the previous steps and what your table should now look like.

    3-dashDB

    Now we are ready to populate the TIDATA table with the values sent by the sensor to the Watson IoT Platform:

    1. We will use a Node-RED flow to populate the dashDB TIDATA table. The TalkToYourSensor-dashDB-NodeRed.txt Node-RED file is available here: https://github.com/XopheLucas/TalkToYourSensor (as well as 2 other files we will use in Sections 4 and 5). In this GitHub repository, click on Clone or download – Download ZIP. Unzip, open the file TalkToYourSensor-dashDB-NodeRED.txt, and copy all its content.
    2. From the Talk to you Sensor app’s Overview page, open the Node-RED app by clicking the link next to the green Running icon. In your Node-RED editor menu, click Import – Clipboard, and paste the TalkToYourSensor-dashDB-NodeRed.txt code you just copied.

    NOTE: Once you have imported this code, you must check and update 2 things in the Node-RED flow: (a) in the imported IBM IoT App In node, make sure that the All or tickbox is clicked, with the name of your Sensor in it (e.g. TISensorTagCL), (b) ensure that on the dashDB TIDATA node, the dashDB for Analytics Service name is selected (this is the service we created in Section 1, and connected to the Node-RED app) and the name of the Table corresponds to the one you created in the above step 3.

    Each message your sensor sends is now formatted and being sent as a row in the dashDB TIDATA table. To check this: open the dashDB service, click the Tables menu and select the TIDATA Table Name, then Browse Data tab.

    In this picture, see (1) what your nodes should look like (in the Debug tab, note the msg.payload as it is sent to dashDB), (2) how the TIDATA table has been populated with the sensor data.

    4-SendDataToDashDB

  4. Create the Intents, Entities and Dialog in the Watson Conversation service

    We will now create all the Waston Conversation Intents, Entities and Dialog required.

    If you are not familiar with the Conversation service, you might want to follow this tutorial on Watson Developer Cloud.  

    We provide you with 2 options to achieve this step: OPTION A (just import the ready-to-use Watson Conversation workspace), or OPTION B (do it all yourself).

    OPTION A: Just import the workspace

    1. From the Talk to you Sensor app’s Overview page, click on the Watson Conversation service, then Launch it.
    2. The TalkToYourSensor-WatsonConversation.json corresponding to the conversation is available in the same repository you downloaded and unzipped in Section 3 (https://github.com/XopheLucas/TalkToYourSensor).
    3. On the Create Workspace page, click Import, and select the TalkToYourSensor-WatsonConversation.json file you just downloaded. Select Import Everything (Intents, Entities, and Dialog).
    4. Now test the whole flow. Click the Ask Watson icon (top-right) and Try it out by having a conversation as per the last picture in OPTION B of this section.
    5. That’s it ! You can now move directly to section 5 of this recipe … 

     

    OPION B: Do it yourself !

    From the Talk to you Sensor app’s Overview page, click on the Conversation service, then Launch Tool, and login with your IBM ID.

    • Create the Workspace, the Intents and the Entities

    In this section, we will create the Workspace, the Intents and the Entities of the conversation.

    For this recipe, we will only create 3 Intents, which will correspond to the ‘only’ conversation topics that Watson can answer to. The #Greetings and #developerWorks Intents will just be used to start the chat with Watson, whereas the #Environment Intent will contain those questions that will lead Watson to understand we want to know more about the data our sensor sends. The 2 Entities (@sensordata and @type) will be used to make Watson understand we want the max/min/average/last (@type) values of either light or temperature (@sensordata).

    TIP: if your sensor sends data other than light or temperature, make sure you adapt the Intents and/or Entities to something relevant to the data sent – e.g. if it sends Humidity values, update the @sensordata values (and their synonyms) accordingly.

    1. On the Watson Conversation homepage, click Create Workspace, and name it Talk to your Sensor
    2. On the next page, click Create Intent, name the 1st Intent #Greetings, and add the 5 User Examples provided below for #Greetings. Click Create (top right).
    3. Repeat above step 2. with the other Intents (#developerWorks and #Environment) and associated User Examples provided below.
    4. Click on the Entities menu, and Create the 1st Entity: @sensordata, add 2 values (light and temperature), and for these 2 values, add the synonyms provided below. Click Create (top right).
    5. Repeat above step 4. for the @type Entity.
    ------------------------------------------
    The 3 Intents and associated User Examples
    ------------------------------------------
    #Greetings
    1. Hi Watson
    2. Good Morning Watson
    3. Good Afternoon
    4. Are you there? Pleased talking to you again
    5. Hello!
    #developerWorks
    1. Can you tell me about developerWorks ?
    2. Can we talk about IBM's DW recipes ?
    3. What is developerWorks ?
    4. What is DW ?
    5. Tell me more about DW
    #Environment
    1. Are you able to help me with sensor and IoT data info ?
    2. Can you give me sensor information ?
    3. Can you provide me with IoT info like temperature or light ?
    4. Do you have IoT data available for me ?
    5. What is my sensor saying regarding environmental values ?
    ----------------------------------------------------
    The 2 Entities, their Values and associated Synonyms
    ----------------------------------------------------
    @sensordata
    light - synonyms: brightness, brilliance, luminosity, visibility
    temperature - synonyms: temp, cold, hot, heat, warmth
    @type
    maximum - synonyms: max, highest, biggest, top
    minimum - synonyms: min, lowest
    average - synonyms: avg, medium
    last - synonyms: latest, newest, now, present, most recent, up to date

    Your Intents and Entities pages should now look like this:

    5-Intents

    6-Intents

    • Create the Dialog
    1. Open the Dialog menu, and click Create
    2. In the Triggered by field, start typing welcome, and select welcome (create new condition) from the list. In the Fulfill with a response field, enter Welcome to the Talk to your Sensor demo. Press Enter. 
    3. Note that a node with the condition anything_else was automatically created in the dialog tree. Click on that node. In the Fulfill with a response field, enter My cognitive capabilities are presently limited. Feel free to boost my brain if you can, but for the time being, I can only answer questions relative to developerWorks, or to the MAX, MIN, AVG, LAST values recorded by a sensor for LIGHT and TEMPERATURE. This node will be called whenever Watson does not recognize the intent of your question.
    4. Select the + icon on the bottom of the welcome node. In the Triggered by field, start typing #Greetings and select #Greetings (create new condition) from the list. This condition will be triggered by any input that matches the #Greetings intent. In the Fulfill with a response field, enter How can I help?. Press Enter. In the Add a variation to this response field, enter What can I do for you?. Click Set to random next to the Response variations are sequential – that means that Watson will randomly select 1 of the 2 responses when recognizing the #Greetings intent.
    5. Select the + icon on the bottom of the #Greetings node. In the Triggered by field, start typing #developerWorks and select #developerWorks (create new condition) from the list. As in step 4., add the following random responses: developerWorks is a free web-based professional network and technical resource center from IBM where you can create Recipes and developerWorks provides tutorials, articles, recipes and other technical resources to help you grow your development skills on a wide variety of topics and products.
    6. Test your Dialog by clicking the Try it out (top right) and entering some questions – start by using those you defined in your #Greetings and #developerWorks intents, then by tweeking them a bit.
    7. Train Watson ! If you enter e.g. blablabla in the Try it out, Watson will provide you with the answer we defined in the anything_else node. If you want Watson to understand blablabla as a greeting, change the irrelevant intent to #Greetings in the Try it out tool. You will see a message saying that Watson is training on your recent changes. Once Watson is done training, re-enter blablabla and you will see that Watson will now treat this as a greeting. 
    8. We will now create the special #Environment node:
      1. Select the + icon on the bottom of the #developerWorks node. In the Triggered by field, start typing #Environment and select #Environment (create new condition) from the list. This condition will be triggered by any input that matches the #Environment intent. Do not add anything in the Add response condition.
      2. Select the + icon on the right side of the just created #Environment node. Start typing @sensordata and select @sensordata (create new condition). Do not add anything in the Add response condition.
      3. Select the + icon on the bottom of the just created @sensordata node. In the Trigger field, start typing true and select true (create new condition). In the Add response condition field, type: OK, good idea. I understand you want more IoT sensor info. I can provide you with LIGHT or TEMPERATURE info. 
      4. On the #Environment node, click the Jump to … icon, and select the @sensordata node and click Go to condition. 
      5. At this stage, we ensured that the true node will be triggered each time Watson understands you are asking a question with an #Environment intent.
      6. Select the + icon on the right side of the just created @sensordata node. Start typing @sensordata and select @sensordata:light. In the Add response condition, type: OK, what do you want to know for LIGHT: its MAXIMUM, MINIMUM, AVERAGE or LATEST value ?
      7. Select the + icon on the bottom of the just created @sensordata:light node. Start typing @sensordata and select @sensordata:temperature. In the Add response condition, type: I understand you want more info on TEMPERATURE. What do you want to know: its MAXIMUM, MINIMUM, AVERAGE or LATEST value ?
      8. On the #sensordata node, click the Jump to … icon, and select the @sensordata:light node and click Go to condition.
      9. Select the + icon on the right side @sensordata:light node. Start typing @type and select @type (create new condition). In the Add response condition field, enter: OK, giving you the @type value for LIGHT.
      10. Select the + icon on the right side @sensordata:temperature node. Start typing @type and select @type (create new condition). In the Add response condition field, enter: OK, giving you the @type value for TEMPERATURE.
      11. Now test the whole flow. Click the Ask Watson icon (top-right) and Try it out by having a conversation as per the picture below.
      12. IMPORTANT NOTE: In case the conversation returns a How can I help? or What can I do for you? answer corrresponding to a #Greetings intent when you first enter the values max, min, avg, latest, just change the #Greetings intent to #Environment intent in the Try it out window, and Watson will train on it, and provide the correct answer the next time.

    7-Dialog

  5. Create the Node-RED flow that glues everything together

    We now have all needed elements in place, and can create the Node-RED flow that wil glue everything together.

    We have created the Node-RED flow for you. Let’s import it:

    • From the GitHub repository you downloaded and unzipped in Section 3 (https://github.com/XopheLucas/TalkToYourSensor), open the TalkToYourSensor-NodeRED.txt, and copy all its content.
    • From the Talk to you Sensor app’s Overview page, click on the Talk to you Sensor app’s link, then go to your Node-RED flow editor.
    • From the top-right menu, click Import – Clipboard, and paste the TalkToYourSensor-NodeRED.txt code you just copied. The Node-RED flow should look like the picture below.

    NOTE: Make sure that you update the following elements in the Node-RED flow, so they map the exact environment that you set up:

    • Double-click the Watson Conversation node, and change the Workspace ID field from Your-Watson-Conversation ID to the ID of the workspace you defined in Section 4. To find that ID, open the Watson Conversation service, click on the top-right menu of the Talk to your Sensor workspace, anc click View details – that should look like this: 10789797-c767-443b-9be8-802b4fb479fe 
    • In the 8 dashDB in nodes (e.g. LAST TEMP, MIN TEMP, LAST LIGHT etc), make sure that (1) in the Service field, dashDB for Analytics is selected (this will automatically be ‘tied’ to the dashDB DB service you created and connected to the Node-RED application in Section 1), (2) the table name (TIDATA) and fields (e.g. AMBIENTTEMP) correspond exactly to the ones you defined in Section 3. 

    Let’s explain the overall Node-RED flow idea, and detail some of the nodes:

    1. Setup the Chatbot page: here we use 1 http in node, 1 template node coded in mustache, and 1 http out node. Have a look at the mustache code, and especially see how this invokes Ajax to send the answers to your Chatbot output page.
    2. Capture the Conversation’s input and output: The Watson Conversation node just returns the output of the conversation as-is. Note in the Post Service node that we set a global variable called theoutput, which we will use later on to construct the final answer.
    3. Switch depending on the Conversation’s output: This is the key part of the flow. Here we basically determine what as-is answer Watson Conversation has returned. Note in the first 8 values of the switch that we capture whether the answer returned corresponds to the furthest-right nodes of the Dialog we defined in Section 4, i.e. whether the answer is either OK, giving you the @type value for TEMPERATURE or OK, giving you the @type value for LIGHT.  In these cases, we will further refine the chatbot answer by doing SQLs. Otherwise (i.e. switch’s value 9), we simply return the answer as-is.
    4. Do SQLs and format when the Swicth identified the need, else return as-is output: If the switch has determined that the as-is answer returned by Watson Conversation corresponds to e.g. OK, giving you the @type value for TEMPERATURE (or LIGHT), then we: (1) query TIDATA using SQL to find the LAST or MIN or MAX or AVG value of either TEMP or LIGHT, (2) format the answer with the SQL returned value in the next function node (e.g. RETURN LAST TEMP) . Note how we finally construct the answer in the function node, i.e. see: globalvariable.botresponse.messageout.output.text.

    8-Node-RED

    WELL DONE !

    You can now start playing with the Chatbot:

     9-Chatbot-1

  6. Next Steps

    Now that you are able to interrogate your sensor in plain English to ask what last/max/min/avg values it recorded, you might want to consider extending this solution:

  7. Where could this be used ?

    The use cases that can be thought about using this ability to ‘Talk to your sensor’ are numerous. Here a couple examples:

    • At home: ask what the average temperature in a room was during a given day, then adjust the start/end time of your heating or air-co depending on that. This could save costs …
    • In any industrial environment (e.g. Mining) where Workers Health & Safety is key: what if in the case of a crisis situation, every member of an Operations Centre had the abilty to ask in plain English: ‘What was this Worker’s IoT helmet latest temperature, movement, CO2 level recorded‘ ? This could save lives … 

21 comments on"Talk to your Sensor using the Watson IoT Platform and Conversation services"

  1. Louis Stoop April 10, 2017

    Well done Christophe! Really like this. Will indeed experiment now with Text to Speech…

  2. Interesting!
    But when I tried this recipe, an error message(“Error whilst attempting to talk to Bot”) is returned.
    Is there any suggestion to resolve this error?


    Talk to your Sensor Chatbot
    You : Hi Watson
    Error : Error whilst attempting to talk to Bot

    And some logs from JavaScript are displayed on browser console.

    001-001 bot:98:2
    002-001 bot:51:2
    checking stashed context data bot:76:2
    undefined bot:77:2
    001-002 bot:102:2
    002-001 bot:51:2

    I restarted my application and browser(Firefox), but the error is not resolved.

    • Christophe Lucas July 07, 2017

      Hi sugatty,

      Hard to ‘debug’ your issue without more info.

      Quick first checks:
      1) Did you do this recipe step from Section 5 above: “NOTE: Make sure that you update the following elements in the Node-RED flow, so they map the exact environment that you set up:” ?
      2) When you try the conversation in the Watson Conversation service itself, does it ‘work’ ?
      3) On your Node-RED flow, do you see any issue with the blue ‘Watson Conversation’ node (e.g. ‘not connected’) ? And in the Node-RED debug tab, did you see this error message: ‘NLU Service Error: Protocol error’ after having written ‘Hi Watson’ in the bot ?

      Asking the above questions because I just re-tested the Node-RED flow and the whole setup that I used to create this recipe. And quite strangely, on my first attempt to talk to the bot, I got the same ‘Error whilst attempting to talk to Bot’ error as yours.
      I then simply opened the Watson Conversation service itself (which I see has been updated since this recipe was published), tried ‘Hi Watson’ in ‘Dialog – Try it out’, and got that ‘NLU Service Error: Protocol error’ error, and noticed that Watson Conversation could not identify the Intent of that ‘Hi Watson’ phrase (should be #Greetings).
      I then just waited a minute, just clicked on the ‘Intents’ and ‘Entities’ tabs, re-entered ‘Hi Watson’ in ‘Dialog – Try it out’, and now everything works perfectly fine again in Watson Conversation.
      I then re-deployed the Node-RED flow – and the bot works like a charm again !

      Let me know, cheers, Christophe

      • Thank you so much for your kind and detailed reply.
        >1) Did you do this recipe step from Section 5 above: …
        Yes.
        >2) When you try the conversation in the Watson Conversation service itself, does it ‘work’ ?
        Yes. It works as expected.
        >3) On your Node-RED flow, do you see any issue with the blue ‘Watson Conversation’ node (e.g. ‘not connected’) ?…
        No.

        From your reply and my additional test, I confirmed that conversation and dashDB are working as I expected.
        So I could get following result by modifying your flow with Slack node =)

        Tadashi Sugawara [5:16 PM] Hi Watson
        slackbot4testAPP [5:16 PM] What can I do for you?
        Tadashi Sugawara [5:16 PM] Tell me about developerWorks
        slackbot4testAPP [5:16 PM] developerWorks provides tutorials, articles, recipes and other technical resources to help you grow your development skills on a wide variety of topics and products.
        Tadashi Sugawara [5:16 PM] Can you give me sensor information?
        slackbot4testAPP [5:17 PM] OK, good idea. I understand you want more IoT sensor info. I can provide you with LIGHT or TEMPERATURE info.
        Tadashi Sugawara [5:17 PM] Is it hot?
        slackbot4testAPP [5:17 PM] I understand you want more info on TEMPERATURE. What do you want to know: its MAXIMUM, MINIMUM, AVERAGE or LATEST value ?
        Tadashi Sugawara [5:18 PM] The latest value please
        slackbot4testAPP [5:18 PM] Here is what you asked for. The LATEST TEMP recorded by the IoT Sensor is 26.09 celsius degrees. This was recorded on 2017-07-05 09:10:15.000000
        Tadashi Sugawara [5:19 PM] What about light?
        slackbot4testAPP [5:19 PM] OK, what do you want to know for LIGHT: its MAXIMUM, MINIMUM, AVERAGE or LATEST value ?
        Tadashi Sugawara [5:19 PM] lowest value please
        slackbot4testAPP [5:19 PM] Here is what you asked for. The MINIMUM LIGHT recorded by the IoT Sensor is 0.08 lux units.

        • Christophe Lucas July 18, 2017

          Thanks sugatty for getting back to me.
          Not sure I fully got what you did with the ‘Slack node’, but from what I see, you managed to make the chatbot work and return IoT sensor data – great and well done ! And seeing that result, I would assume that the ‘standard chatbot’ I used for this recipe would now also work in your case.
          If you are able to detail that ‘Slack node’ thing, that’d be great – I assume you used the https://flows.nodered.org/node/node-red-contrib-slack Node-RED module, correct ?
          Else, thanks again for getting back here.
          Cheers, Christophe

  3. >I assume you used the https://flows.nodered.org/node/node-red-contrib-slack Node-RED module, correct ?
    That’s right. Template node is highly customizable. But by using Slack bot in/out node, it is very easy to show how conversation and dashDB work.

  4. electrodude@1995 July 21, 2017

    hey Christophe Lucas! I was able to replicate this and it worked well. The doubt I have how do I convert by node-red flow into the .txt file? I thought I should export it but I was wrong. please instruct me on how you did that.
    Thank You!

    • Christophe Lucas July 21, 2017

      Hi Electrodude,
      I actually just selected all the nodes in Node-RED, clicked ‘Export – Clipboard’, then clicked ‘Export to clipboard’ (you can also just do ctrl-c), then simply did a ‘Paste’ (ctrl-v) in an empty notepad document, which I then saved as a .txt file.
      Hope this helps, cheers, Christophe

  5. Hi Christophe – I’m running into an issue with connecting to dashDb from node-red. I keep getting an error stating that the bindings file can’t be located (below). Any suggestions?

    “Error: Could not locate the bindings file. Tried:↵ → /home/vcap/app/.node-red/node_modules/ibm_db/build/odbc_bindings.node↵ → /home/vcap/app/.node-red/node_modules/ibm_db/build/Debug/odbc_bindings.node↵ → /home/vcap/app/.node-red/node_modules/ibm_db/build/Release/odbc_bindings.node↵ → /home/vcap/app/.node-red/node_modules/ibm_db/out/Debug/odbc_bindings.node↵ → /home/vcap/app/.node-red/node_modules/ibm_db/Debug/odbc_bindings.node↵ → /home/vcap/app/.node-red/node_modules/ibm_db/out/Release/odbc_bindings.node↵ → /home/vcap/app/.node-red/node_modules/ibm_db/Release/odbc_bindings.node↵ → /home/vcap/app/.node-red/node_modules/ibm_db/build/default/odbc_bindings.node↵ → /home/vcap/app/.node-red/node_modules/ibm_db/compiled/6.11.4/linux/x64/odbc_bindings.node”

    • For anyone else that runs into the binding issue I’ve found out since that when you install the dashDB nodes it does not add the dependency to your package.json file. You must go into the application and add the dependency manually. Once done all works fine.

  6. ZeidMatoussi January 02, 2018

    Hi Christophe ,
    Good job I really enjoy this recipe ! unfortunately the dashDB service si not longer available ! I want to know if there is an alternative service in the lite edition ?

  7. ZeidMatoussi January 02, 2018

    Hi Christophe ,
    Good job I really enjoy this recipe ! unfortunately the dashDB service is no longer available ! I want to know if there is an alternative service in the lite edition ?*

  8. James_Belton February 09, 2018

    Thanks, Chrstophe – this is a great recipe and I like it a lot. I hope you don’t mind but I have created versions of the flows which use mySQL as an alternative to dashDB / DB2 Warehouse. I’ve added those flows to a git repo here: https://github.com/jamesbeltonIBM/TalkToYourSensor, just in case anyone else is interested. If nothing else, it demonstrates how to use and handle mySQL in Node-RED.

    • Christophe Lucas February 09, 2018

      Thanks James, great idea – appreciate your sharing !
      Happy that this recipe can ‘work’ with other DBs – the more the better, the important point here just being the ‘Transform an English question into an SQL statement’ logic.

  9. James_Belton February 14, 2018

    Have further added to the flows in my git repo https://github.com/jamesbeltonIBM/TalkToYourSensor to include some speech! Hear a warning if the light reported by the sensor hits 80 Lux and above and also hear the bot speak it’s replies.

  10. Do you know how to create a table in the new DB2 System? Seems like things have drastically changed from this instruction publication.

Join The Discussion