Overview

The following steps will have you setting up your Read Temp, Format Data, and Append Data nodes from the previously imported flow.

Step 1 - Configure the groov I/O device

  1. Double-click the groov I/O Read Temp node to open the “Edit groov i/o read node” view. If this is the first groov I/O node, a groov device configuration must be added.
  2. Click the pencil icon to the right of the Device field to open the “Edit groov-io-device node” view.
  3. For the Address field, enter the hostname or IP address of the groov I/O device.
    • If using Node-RED and groov I/O on the same device (such as a groov EPIC processor), then enter “localhost” for the address.
    • Do not include HTTPS:// as a part of the address.
  4. For the API Key field, enter a valid API key for a user on the groov I/O device. This can be found in the Accounts section of groov Manage on the device.
  5. Configure the SSL Certificates fields.

    If the groov I/O and Node-RED are on different devices, then you must configure Node-RED to use the groov device’s public key SSL certificate.

    • If using a self-signed certificate, then enter the certificate’s filename or full path in the “CA or Self-Signed” field.
      • If using a groov EPIC processor or groov Edge Appliance, just enter the filename of a certificate you uploaded using groov Manage or Node-RED Admin.
      • If using Node-RED on a computer, enter the path and filename of a certificate on the same computer.
    • If using a CA-signed certificate, then enter the CA certificate’s filename or full path in the “CA or Self-Signed” field and groov’s public key in the “Public Key” field.
      • If using a groov EPIC processor or groov Edge Appliance, just enter the filenames of the certificates you uploaded using groov Manage or Node-RED Admin.
      • If using Node-RED on a computer, enter the path and filenames of the certificates on the same computer.
  6. Click Done to return to the “Edit groov i/o read node” view.

Configure the device

Step 2 - Configure the “Read Temp” Read node

This step will read from an ICTD that returns temperature to keep things simple.

With the “Edit groov i/o read node” view still open:

  1. For the Data Type field, select Analog Channel.
  2. For the Module Index and Channel Index, enter the ITCD point information.
  3. Leave the Value field. msg.payload selected.
  4. Leave the Name field, Read Temp.
  5. Click Done.

Step 3 - Configure the “Format Data” Node

  1. Format data using the provided Function Node.

Example of the formatting:

msg.payload = [ new Date(msg.payload).toLocaleString(), msg.temp.toFixed(2) ]; return msg;

Each index of the above JSON array is a new column of data in a single row. A comma (,) separates the fields/elements in JSON.

Step 4 - Configure the “Append Data” Google Sheet Node

  1. Double-click the “Append Data” Google Sheet Node.
  2. Click the pencil icon next to the creds input field.
  3. Open the file you downloaded from the Google API website and copy and paste it into this new window.
  4. Click Update
  5. In your browser, copy the ID part from the HTTPS URL of the spreadsheet. The link looks similar to this: “https://docs.google.com/spreadsheets/d/1ymMNrJxXqvWtKl_d9S3VKKp6WvL49cKOV-Waz_iQge8/edit#gid=0”. In this example, the ID is “1ymMNrJxXqvWtKl_d9S3VKKp6WvL49cKOV-Waz_iQge8”.
  6. Paste into the SpreadsheetID field.
  7. Click Done.

Configure the device

In the example given, the ID is 1ymMNrJxXqvWtKl_d9S3VKKp6WvL49cKOV-Waz_iQge8

Configure the device

Step 5 - Deploy

  1. Deploy your flow from the top right.
  2. Click the Inject node to inject manually.
  3. Your spreadsheet should have a new row indicating the Date/Time and temperature.

Results

Additional Methods

In addition to the Append Row method, Google Sheets API also provides several other methods for working with spreadsheet data. These methods include Get Cells, Update Cells, and Clear Cells.

Each of these methods can be used in combination with Node-RED and groov I/O to create powerful integrations between your physical devices and Google Sheets.

Conclusion

Congratulations! You’ve successfully integrated groov I/O with Google Sheets using Node-RED. By following this tutorial, you’ve learned how to extract temperature data from a groov I/O ICTD channel and publish it to a Google Sheets spreadsheet using the Append Row method.

This is just the beginning of what you can accomplish with Node-RED and groov I/O. With the help of the many available nodes and integrations, you can connect your devices to a wide range of online services and build powerful automation workflows.

If you want to learn more, be sure to check out the Google Sheets API documentation for additional information and documentation. You can also explore the node-red-contrib-google-sheets homepage for more details on the various methods and functionality available.

Thanks for following along with this tutorial, and happy integrating!

Previous Step

Return to Creating an API with Google.