SmartThings Community

Getting text file data in to ST?

(James Heath) #1

Hi There,

I’m about to embark on my first integration - I want to add data from (but not control of) my solar thermal heating controller - it’s a RESOL.
It logs the data I want to a text file on an SD card.
I’ve installed a Toshiba wifi SD card, and have that mounted on a windows PC so that I can read it whenever I want.
I used to be able to code & am now embarking on having a go with Groovy.

I figure that I need to create an app (or possibly just a batch file) running once a minute on the windows PC, that reads the text file, extracts the data from the last line, then uses curl to post the data to smartthings.
I then presume I’ll need a custom handler / smartapp to grab the data and handle/display it.

Is there anything out there already that I might use as a starting point for this, or something similar that I can use to get the basics of getting data / info in from the outside world.

Thanks in advance!

James

(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2

This part has no need to use Groovy - use the language of your choice. This part certainly can be done with a simple Batch file or Shell script.

Read the “web services SmartApps” section of https://docs.SmartThings.com ; and you’ll also find dozens of examples in the Forum and SmartThings Public GitHub.

Creating an “endpoint” using a SmartApp to receive the data posted by Curl, is, relatively, trivial. Similarly with subsequently calling Commands to a Device instance to update its Attributes / States.

(James Heath) #3

Thanks for the pointers.

Relatively trivial sounds like my level!!

I’ll give it a try as soon as I get a chance.

1 Like