How to pass data from a URL to a virtual device?


#1

Hi, I’m a total Core newbie. I’ve been browsing for a few hours but haven’t found anything helpful for my use case. Can someone help me figure out how to make this connection?

I have an Airtthings radon detector that feeds data to a Raspberry Pi, which I can then export or publish in pretty much any format since it uses a Python script. Here’s an example of the output: http://lymanbuttler.com/radon.txt

What I need is a way to capture data from a URL like this and feed it to a virtual device. For example, the Python script on the RPi will run every hour and update the URL with a new value (maybe even just a single number if it makes the parsing easier). The “Virtual Radon Detector” grabs the number, and other devices (e.g. exhaust fans) respond to changes.

Any ideas? Thanks!


#2

@WCmore, I’m pretty sure you could answer this question.


#3

I am tied up at the moment… Maybe something like:

Every hour
   Make web request (HTTP GET) to URL
   Store results into variables
   Do cool stuff with data found *

* If simple, it might be combined in this piston, but I usually do the “cool stuff” in a separate piston.


#4

You can read some good discussions (w/examples) using the search term “HTTP GET”.


If the above link is not enough, another popular term here might be “$response”… This is often used in the very next line after the web request.